我可以获取数据并在 ggplot 中使用管道制作标题吗?
假设我有这样的数据,
x <- c(5,17,31,9,17,10,30,28,16,29,14,34)
y <- c(1,2,3,4,5,6,7,8,9,10,11,12)
day <- c(1,2,3,4,5,6,7,8,9,10,11,12)
df2 <- reshape2::melt(df1, id.vars='day') %>% data.frame(x, y, day, company = 'inc. company name ')
df2 %>% ggplot(aes(x=day, y=value, fill=variable), xlab="Age Group") +
geom_bar(stat = "identity", position = "dodge", width = 0.5)
不过我想做这样的事情
df2 %>% ggplot(aes(x=day, y=value, fill=variable), xlab="Age Group") +
geom_bar(stat = "identity", position = "dodge", width = 0.5) +
+ labs(title = paste0(.$company, "numbers")) # NOT WOKRING CODE
To get to this,