r - 使用 text() 函数时如何在 r 中打印计算值
问题描述
嘿,我正在绘制散点图
plot(seq(1:n),x,xlab='Length of Vectors',ylab='Vectors',
type='p',col='black',pch=20,main='Scatter plot of X & Y vectors')
points(x,col='red',type='p',pch=1,cex=2)
points(y,type='p',col='black',pch=20)
points(y,type='p',pch=3,col='blue',cex=2)
text(which.max(x),max(x),'max of x: ',pos=1,cex=0.5)
像这样在我的观点之外,我想写一个文本说'x的最大值:max(x)<-x的实际最大值',但是由于我使用的是text()函数,我必须使用''来写下我的文字,但我无法弄清楚我应该如何将 x 的 max 的结果如上表所示。
解决方案
推荐阅读
- http - 非 OPTIONS 响应中的“Access-Control-Allow-Origin: *”是一个漏洞吗?
- rest - 是否可以使用 splunk dbxquery 运行 curl 命令?
- python - 重复使用对齐的图像进行边缘检测和阈值处理
- amazon-web-services - 放大配置
- javascript - 如何从第二个下拉值中从数据库中获取数据
- javascript - KendoUI - 选择时禁用某些节点
- binding - 如何在 SwiftUI(或替代方法)的主体方法中初始化派生变量
- sql - 如何创建一个将记录从一个表插入到另一个表并检查有效性的过程?PL/SQL
- tensorflow - gRPC+MPI 是否需要 RDMA?
- python - 如何解决问题 TypeError: cannot serialize '_io.BufferedWriter' object?