Skip to content

Commit

Permalink
Vigniettes use_recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroloprete committed Feb 25, 2024
1 parent 98c6891 commit 1531b35
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions vignettes/use_recipes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ knitr::opts_chunk$set(
```{r setup}
library(metaSurvey)
set_engine()
set_engine(
"data.table"
)
svy_example = load_survey(
svy_type = "eaii",
Expand All @@ -42,8 +44,7 @@ new_svy = svy_example %>%
B1_7_1 == 1 ~ 1,
B1_8_1 == 1 ~ 1,
B1_9_1 == 1 ~ 1,
.default = 0,
.copy = FALSE
.default = 0
) %>%
step_recode(
new_var = "sector",
Expand Down Expand Up @@ -160,6 +161,35 @@ steps = get_steps(new_svy)
```


```{r}
eph2022_3 = load_survey(
path = load_survey_example("eph2022_3.csv"),
svy_type = "eph",
svy_edition = "2022_3",
svy_weight = "PONDERA"
) %>%
metaSurvey::step_recode(
"pea",
ESTADO %in% 1:2 ~ 1,
.default = 0
) %>%
metaSurvey::step_recode(
"pet",
ESTADO != 4 ~ 1,
.default = 0
) %>%
metaSurvey::step_recode(
"po",
ESTADO == 1 ~ 1,
.default = 0
) %>%
metaSurvey::step_recode(
"pd",
ESTADO == 2 ~ 1,
.default = 0
)
```

# Introduction


Expand Down

0 comments on commit 1531b35

Please sign in to comment.