小编Sal*_*lly的帖子

R:强制转换的错误消息“‘listgreater’中未实现的类型‘list’”

使用以下命令(x 是一个包含 3 列 A、B 和 C 的表)

library(reshape)
cast(x, A~B)
Run Code Online (Sandbox Code Playgroud)

出现以下错误:

Using C as value column.  Use the value argument to cast to override this choice
Error in order(A = list("xxx",  : 
  unimplemented type 'list' in 'listgreater'
Run Code Online (Sandbox Code Playgroud)

这意味着什么以及如何解决?


我想这可能是由于数据框的数据格式造成的(如果我错了,请纠正我)。正如我使用 str 命令测试了表 x 和 y 的格式。

str(x) returns
$ A: List of 6
..$ : chr "xxx"
....
$ B:chr "yyy" "yy2" ....
...
$ C: List of 6
..$ : num 22.....
...
Run Code Online (Sandbox Code Playgroud)

对于另一个具有 DE 和 F 列的表 y,当我运行cast …

casting r

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

casting ×1

r ×1