我的数据是关于文件大小和处理文件的时间成本。
当我绘制点图时,我得到了以下结果:
ggplot(data,aes(filesize,time))+geom_point()
如何提取线附近的所有数据以供进一步分析?
有什么学习建议吗?提前谢谢你。
最佳答案
下一步最好是确定那些看起来更常见的比率,以便更容易地隔离这些观察结果。
library(dplyr)
data %>%
mutate(time_per_size = time/file_size) %>%
ggplot(aes(time_per_size)) +
geom_histogram(bins = 50) # 30 bins is default, fiddle to see what value captures the predominant ratios most cleanly
例如,使用@PavoDive 的示例数据,我们可以使用此过程查看比率,并使用 plotly
以交互方式查看尖峰,看到它们大约在 1.5 和 3 之间。
library(ggplot2); library(dplyr)
dt %>%
mutate(time_per_size = y/x) %>%
filter(time_per_size < 10) %>%
ggplot(aes(time_per_size)) +
geom_histogram(bins = 300)
plotly::ggplotly(.Last.value)
关于r - 我在我的散点图中发现了一条意想不到的线,我怎样才能提取线附近的所有数据以供进一步分析?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56695993/