I am using the tidycensus package to pull out some census variables. I am making a list of desired variables with set variable names (dummy data below). I want to also create a codebook, where, ideally, I'd use the list of variable names to pull the rest of the information from the variable list that you can access with the command load_variable. I'm not sure how to do that join, or pull out that information, just using a character list. Any suggestions?
library("tidycensus")
library("dplyr")
decvarlist <- load_variables(2000, "sf1")
desiredvars = c(var1 = "H001001",
var2 = "H002002",
var3 = "H002003"
)
#this bit doesnt work, but is sort of how I'm thinking of it
codebook <- left_join(desiredvars, decvarlist, by = ())