在R语言中,要给一个数据框添加一列数据,可以使用下列方法之一:
- 使用$符号:
dataframe$new_column <- new_data- 使用[]符号:
dataframe['new_column'] <- new_data- 使用cbind()函数:
dataframe <- cbind(dataframe, new_column = new_data)上一篇:centos7创建用户组的方法是什么
下一篇:python中怎么用post提交数据
r语言
在R语言中,要给一个数据框添加一列数据,可以使用下列方法之一:
dataframe$new_column <- new_datadataframe['new_column'] <- new_datadataframe <- cbind(dataframe, new_column = new_data)