2
我搜索了,但我找不到答案。我想用geom_bin2d
進一步處理我在R中創建的情節的數據。我已經使用如何提取R中間隔的端點?
> library(ggplot2)
> my_plot <- ggplot(diamonds, aes(x = x, y = y))+ geom_bin2d(bins=3)
> plot_data <- ggplot_build(my_plot)
> data <- plot_data$data[[1]]
> data$xbin[[1]]
[1] [0,3.58]
Levels: [0,3.58] (3.58,7.16] (7.16,10.7] (10.7,14.3]
沒有我想的工作,包括min
和mean
提取從這樣的情節倉(間隔)。我如何訪問像data$xbin[[1]]
這樣的間隔的端點?
(更新:我把到例如基於內置的數據集的完整測試情況)
考慮提供一個可重複的例子。 –
['cut'中的最後一個例子](https://stat.ethz.ch/pipermail/r-help/2008-August/170445.html) – baptiste