1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
library(freqparcoord)
data(prgeng)
library(tidyverse)
library(skimr)
data <- prgeng %>% as_tibble() %>%
filter(educ >= 13 & educ != 15) %>% # on filtre les individus dont educ est supérieur ou égal à 13 et différent de 15
mutate(educ = case_when(educ == 13 ~ "licence",
educ == 14 ~ "master",
educ == 16 ~ "doctorat"),
educ = fct_relevel(as.factor(educ), "licence", "master"),
sex = case_when(
sex == 1 ~ "homme",
sex == 2 ~ "femme"),
cit = as.character(cit),
engl = as.character(engl),
birth = as.character(birth),
powspuma = as.character(powspuma)) %>%
drop_na(wageinc)
data %>% skim() # une alternative à summary()
ggplot(data, aes(sex, age))+ geom_boxplot()
data %>% filter(wageinc>= 300000) # mais qui sont ces gens ?
ggplot(data, aes(sex))+ geom_bar()
ggplot(data, aes(educ))+ geom_bar()
ggplot(data, aes(wageinc, color = sex))+ geom_density()
ggplot(data, aes(wageinc, color = educ))+ geom_density()
ggplot(data, aes(age, wageinc, color = sex))+ geom_point() + facet_grid(sex ~ educ)
data %>% filter(wageinc>= 300000) %>% count(occ)
data %>% count(occ) |
Partager