【发布时间】:2020-04-08 12:54:44
【问题描述】:
感谢 SO 用户,我最近学习了命令 dput()。现在的问题是我不理解输出。我想了解我的变量 edu.deg.level 的数据。我可以看到列表格式中有 10 个值,但我不明白 1L、0L 的含义或分配给它们的含义。代码如下:
> dput(head(df1,10))
structure(list(edu.degree.level = c(1L, 0L, 1L, 1L, 0L, 1L, 1L,
1L, 1L, 0L), immig.view = structure(c(7, 4, 5, 1, 7, 5, 7, 1, 3, 1),
label = "J1 Do you think immigration is good or bad for Britain's economy?",
labels = c(`Not stated` = -999,
`Don`t know` = -1, `1 Bad for economy` = 1, `2` = 2, `3` = 3,
`4` = 4, `5` = 5, `6` = 6, `7 Good for economy` = 7), class = "haven_labelled")),
row.names = c(NA, 10L), class = "data.frame")
非常感谢!
【问题讨论】:
-
1L只是数字1,但存储为整数(0L等相同)。它显示了数据框每一列的值。 -
@IceCreamToucan 谢谢。所以只是为了确认,如果有 1L 数据帧中的值是 1 如果 2L 它是 2 等等?
-
是的,没错
-
@IceCreamToucan 太好了,谢谢。