14 Tipul de data logic

gapminder$tara_mica <- gapminder$pop <1000000
table(gapminder$tara_mica)
## 
## FALSE  TRUE 
##  1524   180
ggplot(gapminder, aes(x=tara_mica, y=lifeExp))+
  geom_boxplot()
gapminder$tara_mica_f <- factor(gapminder$tara_mica, labels=c('mare','mica'))
ggplot(gapminder, aes(x=tara_mica_f, y=lifeExp))+
  geom_boxplot()
gapminder$tara_mica_f_o <- ordered(gapminder$tara_mica_f, levels=c('mica','mare'))
ggplot(gapminder, aes(x=tara_mica_f_o, y=lifeExp))+
  geom_boxplot()