如何使用ggplot2绘制累积频率线图?

问题描述

如果这个问题是不言自明的,请原谅我,但我仍在努力掌握 R 的更多功能。

我目前正在尝试使用 R 用我在 excel 中绘制的线条重新绘制累积频率。

Here is a picture of the graph I am trying to recreate

我认为我的很多问题都来自有很多没有数据的单元格,因为我不断收到警告:

警告信息:
1:删除了包含缺失值的 81 行(geom_path)。
2:删除了包含缺失值的 81 行(geom_path)。
3: 删除了 81 行包含缺失值 (geom_path)。

这是因为每列代表一个记录频率,只发生了 21 天,每个记录周期之间有 20 天的休息时间。

My data table

我曾尝试使用 import Feather from 'react-native-vector-icons/Feather'; const App: () => React$Node = () => { return ( <Feather name="chevron-left" color={'#2F80ED'} size={30} /> ); }; export default App; geom_ steps(),但最终得到了这些:

Graphic produced using geom_step

graphic produced with geom_point

当我使用 geom_points() 函数时,轴被创建但没有绘制任何内容。

Graphic produced using geom_line

x 轴上的日期看起来也很糟糕,我尝试使用代码 geom_line() 来旋转标签,但它看起来仍然很糟糕,我不确定它是否只是多个日期。

这是我一直在尝试为各种 geom 函数工作的代码:

+ theme(axis.text.x = element_text(angle = 90))

我希望这一切都有意义,并提前感谢大家提供的任何帮助!

我使用 ggplot() + geom_point(aes(x = Date,y = d2s1,group = 1),data = cf) + geom_point(aes(x = Date,y = d20s1,y = d10s1,data = cf) + theme(axis.text.x = element_text(angle = 90)) ggplot() + geom_step(aes(x = Date,data = cf) + geom_step(aes(x = Date,data = cf) + theme(axis.text.x = element_text(angle = 90)) ggplot() + geom_line(aes(x = Date,data = cf) + geom_line(aes(x = Date,data = cf) + theme(axis.text.x = element_text(angle = 90)) 读入数据。

我在下面附上了 read.csv("cf.csv") 的输出。

dput(cf)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)