在对文件使用read_tsv时,我遇到了麻烦,这些文件的标题行缺少dataset中最后几列的条目。readr确实指出了警告/问题的发生,但这似乎与readr处理这些情况的方式背道而驰,如下所示:https://github.com/tidyverse/readr/issues/189
对read_csv的示例调用取自上面的链接:
read_csv("a,b\n1,2,3,4")
#> Warning: 1 parsing failure.
#> row # A tibble: 1 x 5 col row col expected actual file expected <int> <chr> <chr> <chr> <chr> actual 1 1 <NA> 2 columns 4 columns literal data file # A tibble: 1 x 5
#>
#> # A tibble: 1 x 2
#> a b
#> <int> <int>
#> 1 1 2
#> Warning message:
#> In rbind(names(probs), probs_f) :
#> number of columns of result is not a multiple of vector length (arg 2)注意,我使用的是Rv3.4.2和readrv1.1.1。根据以前使用readr (和上面的链接)的经验,readr仍然应该读取缺少标题的列,并自动为它们分配名称X1和X2。readr是否改变了处理这些情况的方式?这是tibble的副作用吗?
https://stackoverflow.com/questions/47761295
复制相似问题