【发布时间】:2021-05-06 11:02:21
【问题描述】:
我的三个专栏表现得很奇怪,即使它们在我的数据框中被声明为numeric。我也无法使用 colnames 更改这些列的名称
我的步骤:
-
install.packages("haven")
-
图书馆(避风港)
-
write_dta(data = df, "path/mydata.dta")
我的数据框df
structure(list(WeekDaysAbove28 = structure(list(`tapply(testdlong$value > 28, ceiling(seq(nrow(testdlong))/7), ` = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L)), row.names = c("1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18",
"19", "20"), class = "data.frame"), WDA28 = structure(list(`tapply(testdlong$value > 28, ceiling(seq(nrow(testdlong))/7), ` = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L)), row.names = c("1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18",
"19", "20"), class = "data.frame"), WDBM5 = structure(list(`tapply(testdlong$value < -5, ceiling(seq(nrow(testdlong))/7), ` = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L)), row.names = c("1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18",
"19", "20"), class = "data.frame")), row.names = c(NA, 20L), class = "data.frame")
错误 "Columns of type list not supported yet" 表明我需要以某种方式更改这些列中给出的信息,但我无法弄清楚到底出了什么问题。我有 294 列,当排除这三个列时,write_dta 命令工作得很好
【问题讨论】: