私は次のティブルを持っています:
data_frame(type = list( c('1','2', 'text'), c(1L ,2L), c(1.5, 2.1), c(TRUE, FALSE))) %>%
mutate(typeof=unlist(map(type, typeof)),
mode= unlist(map(type, mode)),
class= unlist(map(type, class)))
# A tibble: 4 x 4
type typeof mode class
<list> <chr> <chr> <chr>
1 <chr [3]> character character character
2 <int [2]> integer numeric integer
3 <dbl [2]> double numeric numeric
4 <lgl [2]> logical logical logical
そして、次のような列タイプのコンテンツを含む列を追加したい:
# A tibble: 4 x 4
type typeof mode class vector
<list> <chr> <chr> <chr> <chr>
1 <chr [3]> character character character c('1','2', 'text')
2 <int [2]> integer numeric integer c(1L ,2L)
3 <dbl [2]> double numeric numeric c(1.5, 2.1)
4 <lgl [2]> logical logical logical c(TRUE, FALSE)
私は試しunlist(map(type, quote))
ましたが、それは与えます:
# A tibble: 4 x 5
type typeof mode class vector
<list> <chr> <chr> <chr> <list>
1 <chr [3]> character character character <symbol>
2 <int [2]> integer numeric integer <symbol>
3 <dbl [2]> double numeric numeric <symbol>
4 <lgl [2]> logical logical logical <symbol>
どちらかが何で<symbol>
あるかさえわかりません...