Skip to content
Snippets Groups Projects
Commit 8a94d39d authored by gdutz's avatar gdutz
Browse files

Fix rename in list gen

parent 12de42f7
No related branches found
No related tags found
No related merge requests found
Package: leo Package: leo
Type: Package Type: Package
Title: Useful functions for LEO surveys Title: Useful functions for LEO surveys
Version: 0.2.2 Version: 0.2.3
Author: Gregor Dutz Author: Gregor Dutz
Maintainer: Gregor Dutz <gregor.dutz@uni-hamburg.de> Maintainer: Gregor Dutz <gregor.dutz@uni-hamburg.de>
Description: Implements simple functions to handle data from two German surveys Description: Implements simple functions to handle data from two German surveys
......
...@@ -37,8 +37,8 @@ leo_svydesign <- function(df, survey = "leo2018", replist = FALSE) { ...@@ -37,8 +37,8 @@ leo_svydesign <- function(df, survey = "leo2018", replist = FALSE) {
# create list with one pv-variable and one level-variable each (and all other variables) # create list with one pv-variable and one level-variable each (and all other variables)
repList <- lit %>% repList <- lit %>%
purrr::map(function(x) {dplyr::select(df, all, paste0("alpha_", x), x) %>% purrr::map(function(x) {dplyr::select(df, all, paste0("alpha_", x), x) %>%
dplyr::rename(.data$pv := !!x) %>% dplyr::rename(pv = !!x) %>%
dplyr::rename(.data$alpha_pv := !!paste0("alpha_", x))}) dplyr::rename(alpha_pv = !!paste0("alpha_", x))})
# create further alpha-variables for different analyses # create further alpha-variables for different analyses
# alpha3 (three levels): low literate (Alpha 1-3), Alpha 4, above Alpha 4 # alpha3 (three levels): low literate (Alpha 1-3), Alpha 4, above Alpha 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment