当前位置:网站首页>R错误:缺少值不允许写在下面的作业的数据帧
R错误:缺少值不允许写在下面的作业的数据帧
2022-07-29 13:57:00 【qq_21478261】

Simulate an error occurs:
#生成一个data.frame
set.seed(0)
data <- data.frame(x=c(NA, rnorm(99)), y=c(1:5))
head(data)生成一个6x2的data.frame,包含一个NA值,
,
#将data.frame中小于0的值替换为0
data[data$x<0,]$x <- 0An error occurred:
Error in `[<-.data.frame`(`*tmp*`, data$x < 0, , value = list(x = c(0, :
missing values are not allowed in subscripted assignments of data frames
报错很明显,da
边栏推荐
猜你喜欢
随机推荐
企业代码安全防护分类
mariadbackup物理备份使用——筑梦之路
Meta,元宇宙和广告双败的一季
The interviewer was stunned by the self-growth of 4 mainstream database IDs in one breath
深度解析C语言文件操作以及常见问题
JUC阻塞队列-ArrayBlockingQueue
MySQL基础篇(四)-- 数据表的基本操作
Leetcode66. 加一
SIP system composition format
3555. 二叉树
「 工业缺陷检测深度学习方法」最新2022研究综述
Sqoop导入导出时数据内存溢出
推荐几款2022年好用的设备管理系统(软件)
Hash table implementation code
gee引擎修改UI界面图文教程
全开放式耳机怎么样?不塞耳朵的蓝牙耳机推荐
如何使用MISRA改进嵌入式编程
【论文阅读】Anomaly Detection in Video via Self-Supervised and Multi-Task Learning
一起来侃个球
连接oracle数据库指令









![[Numpy] np.where](/img/a7/928fd5d7b8916e47603bd5587a53c7.png)