小编Sha*_*mar的帖子

如何在R中设置变量的属性?

如何为变量分配属性?例如.

> x <- rpart(f.la, mydata) 
Run Code Online (Sandbox Code Playgroud)

分配属性:

$names
[1] "frame"               "where"              
[3] "call"                "terms"              
[5] "cptable"             "method"             
[7] "parms"               "control"            
[9] "functions"           "numresp"            
[11] "splits"              "variable.importance"
[13] "y"                   "ordered"            

$xlevels
named list()

$ylevels
[1] "cancelled"    "cart-abandon" "purchased"    "returned"    

$class
[1] "rpart"
Run Code Online (Sandbox Code Playgroud)

像这样,我想为变量创建属性并为该属性赋值.

attributes r

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

如何访问原子向量属性?

我使用attr函数设置了变量的属性,如下所示:

x <- 1 :20
attr(x,'name') <- c("RED","BLUE")
attributes(x)

$name
[1] "RED"  "BLUE"
Run Code Online (Sandbox Code Playgroud)

现在我已经设置了属性; 如果我使用'$'它说,访问它"Error : $ operator is invalid for atomic vectors".我也试过x['name']哪个节目NA

如何访问此原子向量属性?

attributes r vector atomic

3
推荐指数
1
解决办法
3600
查看次数

如何使用 Excel 打开 SAS 文件?

我有一组 SAS 数据集,我想使用 Excel 或 R 打开它。我没有随身携带 SAS 软件,因此无法使用其中的导出选项。是否有任何转换器可以从 SAS7BDAT 转换为 excel?

谢谢

excel r converter sas

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

标签 统计

r ×3

attributes ×2

atomic ×1

converter ×1

excel ×1

sas ×1

vector ×1