r - Creating overlay plots with a loop in r
问题描述
Hey guys I hope someone can help me out. I want to make a loop that gives me an overlapping density plot. I have tried the following...
for (i in length(df)) {
x <- df[,i]
plot(density(x))
lines(density(x ))
}
However, this only gives me a plot with one density line. But in my case it should be 100 density lines overlapping in one plot.
解决方案
推荐阅读
- python - python函数标记数据帧中前30%的事务
- r - 具有 2 个捕获组的正则表达式,“key=value”或“value_only”
- java - 当读取和写入请求来自同一段时,ConcurrentHashMap 如何工作?
- wordpress - 在 WooCommerce 中为每个购物车项目设置运输方式
- typescript - 如何在我的 http 服务器中使用 Express Session?
- flutter - 广告未在颤动中显示时占用的空白空间
- python - Python子进程导出环境变量(使用其他环境变量)
- android - 颤振“字符串”不是“列表”类型的子类型
' - javascript - 如何等待功能完成?
- node.js - Firestore 从 where 查询中获取子集合