r - abs(x) 中的错误:数学函数 R lang 的非数字参数
问题描述
R中的新手,有一个问题,但不明白它到底有什么问题。单独的代码工作正常。我一起收到这个错误
Error in abs(x) : non-numeric argument to mathematical function
In addition: Warning message:
Removed 1 row(s) containing missing values (geom_path).
代码在这里
p + ggtitle("BTC Price Prformance") +
theme(plot.title = element_text(color="#002D7D", size=14, face="bold", hjust = 0.5)) +
theme(plot.title = element_text(color="#002D7D", size=14, face="bold", hjust = 0.5)) +
scale_x_continuous(limits = c(1,nrow(mResult)), expand = c(0, 0), breaks = as.numeric(mXLabels[,1]), labels = mXLabels[,2]) +
scale_y_continuous(limits = c(0,max( excelSheet$High[excelSheet$High!=max(excelSheet$High)] )), expand = c(0, 0), breaks=c(0, 2500, 5000, 7500, 10000, 12500, 15000, 17500, 20000)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
解决方案
错误消息说您缺少值。尝试
your_variable <- na.omit(your_variable)
得到一个无 na 的向量。
推荐阅读
- python - 用户点击赞按钮页面后不应刷新(重定向)并更新赞数
- python-3.x - 为什么我的程序无法识别文件位置?(Python 3.x)
- excel - 按主题、发件人和日期在 Excel 范围内搜索每个电子邮件地址的收件箱
- paramiko - 如何不记录套接字异常:paramiko lib 的对等方重置连接
- python - 从 FLAC 文件获取封面图像并将其显示在 Tkinter 窗口上
- amazon-web-services - 在 Ubuntu 18.04 上增加 EC2 卷(非 root)的大小(按照 AWS 指令失败)
- asp.net - Angular 与后端 .NET Core API 的最佳前端集成
- python - push_notebook 未更新散景变化 data_source
- python - 无法在 Windows 10 Pro 机器上访问本地 Flask 服务器端点
- r - 如何将每个拆分块写入 csv?