它只是把它作为一个tibble,这是或多或少的“增强”从tidyverse世界数据帧。您可以看到文档here
您可以与数据框交换使用它们。我曾经注意到一段时间,特别是空间函数,蹒跚造成的东西死了,所以有时你必须将它们转换回数据帧。
library(tibble)
x1 <- c(1, 2, 3, 4)
x2 <- c("one", "two", "three", "four")
example_df <- data.frame(x1,x2)
example_tibble <- tibble(x1,x2)
如果你看看他们两个人使用str
,你会看到他们基本上除了tibbles同样不会自动将字符串转换为因素(除其他事项外)。
> str(example_df)
'data.frame': 4 obs. of 2 variables:
$ x1: num 1 2 3 4
$ x2: Factor w/ 4 levels "four","one","three",..: 2 4 3 1
> str(example_tibble)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 4 obs. of 2 variables:
$ x1: num 1 2 3 4
$ x2: chr "one" "two" "three" "four"
此外,它仍然是一个数据帧,但是它有一些更具体的类
> is.data.frame(example_tibble)
[1] TRUE
包装纸用'data.frame了'read_feather'调用(。)'似乎解决这个问题,但目前还不清楚对我来说为什么甚至是必要的。 – Chris