I try to select columns that are located in data.frame columns. Sounds easy, however, I am at a loss..
library(tidyverse)
#test data
df <- tibble(name=c("a","b","c"),
type=data.frame(motor=c(1,2,3),
engine=c(1,2,3)),
more=list(c(list(1,2,3),
list(2,3,4),
list(1,1,1))))
df
#> # A tibble: 3 x 3
#> name type$motor $engine more
#> <chr> <dbl> <dbl> <list>
#> 1 a 1 1 <list [9]>
#> 2 b 2 2 <list [9]>
#> 3 c 3 3 <list [9]>
Created on 2020-06-23 by the reprex package (v0.3.0)
I would like to select the name and engine column.
I tried something like this without success:
df %>% select(name,$engine)