I'm running a code to format data, which goes into a rake weighting analysis. I started to run the lines but when I get to the parts "tibble::enframe" they don't run. What does tibble do in this code? The strange thing was it did run once upon a time in past but no longer does.
the code
dummy_data_age <- sample(c(18:90), 100, replace = TRUE)
dummy_data_income <- sample(c(0:100000), 100, replace = TRUE)
dummy_data_gender <- sample(c("Male", "Female"), 100, replace = TRUE)
dummy_data_gender <- as.integer(factor(dummy_data_gender))
dummy_data_region <- sample(c("North", "East", "South", "West"), 100, replace = TRUE)
dummy_data_region <- as.integer(factor(dummy_data_region))
dummy_data_age <- tibble::enframe(dummy_data_age, "unit", "age") %>% select("age")
dummy_data_income <- tibble::enframe(dummy_data_income, "unit", "income") %>% select("income")
dummy_data_gender <- tibble::enframe(dummy_data_gender, "unit", "gender") %>% select("gender")
dummy_data_region <- tibble::enframe(dummy_data_region, "unit", "region") %>% select("region")
dummy_data_df <- bind_cols(dummy_data_age, dummy_data_income, dummy_data_gender, dummy_data_region)
The error message I get
> dummy_data_age <- tibble::enframe(dummy_data_age, "unit", "age") %>% select("age")
Error in select(., "age") : unused argument ("age")
Is there a way I can rewrite this code to get the same format it would have been. I'm not sure what it would have been though, as i'd just run it without checking it. FYR it was taken from this site https://rpubs.com/anthonybmasters/survey-weights-in-r Any help greatly appreciated. Thanks