Вот набор данных:
set.seed(123)
myd <- data.frame (class = rep(1:4, each = 100), yvar = rnorm(400, 50,30))
require(ggplot2)
m <- ggplot(myd, aes(x = yvar))
p <- m + geom_histogram(colour = "grey40", fill = "grey40", binwidth = 10) +
facet_wrap(~class) + theme_bw( )
p + opts(panel.margin=unit(0 ,"lines"))
Я хочу добавить метки в бары, к которым относится каждый предметный класс, и создать что-то вроде обработанного графа пост-powerpoint. Есть ли способ сделать это в R?......
Изменить: мы можем думать о разных указателях, таких как точка или панель ошибок, если стрелка не невозможна.
Скажем, следующие предметы должны быть помечены:
class name yvar
2 subject4 104.0
3 subject3 8.5
3 subject1 80.0
4 subject2 40.0
4 subject1 115.0
classd <- data.frame (class = c(2,3,3,4,4),
name = c ("subject4", "subject3", "subject1", "subject2", "subject1"),
yvar = c(104.0, 8.5,80.0,40.0, 115.0))