I have a tibble with lots of columns. I don't want to change them one by one. Let's say that tible looks like this:
df <- tibble(
x = c(1,0,1,1,'a'),
y = c('A', 'B', 1, 'D', 'A'),
z = c(1/3, 4, 5/7, 100, 3)
)
I want to convert their column types based on value in other tibble:
df_map <- tibble(
col = c('x','y','z'),
col_type = c('integer', 'string', 'float')
)
What's the most appropriate solution?