如何更改data.frame中的单个值? [英] How do I change a single value in a data.frame?

查看:127
本文介绍了如何更改data.frame中的单个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释如何将 data.frame 中的单个单元格更改为其他内容。
基本上我只想重命名一个单元格,而不是所有与它匹配的单元格。
我不能使用 edit()命令,因为它会使我的脚本自动使用 data.frame 几次。



提前感谢

解决方案

p $ p> data.frame [row_number,column_number] = new_value

例如,如果 x 是您的data.frame:

  x [1 ,4] = 5 


Could anyone explain how to change a single cell in a data.frame to something else. Basically I just want to rename that one cell, not all cells which matches it. I can´t use the edit() command because it will screw up my script since im using the data.frame on several occasions.

Thanks in advance

解决方案

data.frame[row_number, column_number] = new_value

For example, if x is your data.frame:

x[1, 4] = 5

这篇关于如何更改data.frame中的单个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆