相关疑难解决方法(0)

R 2.15中scale_continuous抛出错误的formatter参数

自升级到R 2.15以来,formatter参数似乎抛出了错误.这是我每天都在使用2年的争论,所以这是一个巨大的失败.

R版本2.15.0(2012-03-30)

ggplot2版本0.9.0

> library(ggplot2)
> x <- 1:100
> y <- 1/x
> p <- qplot(x,y)
> p + scale_y_continuous(formatter = "percent")
Error in continuous_scale(c("y", "ymin", "ymax", "yend", "yintercept",  : 
  unused argument(s) (formatter = "percent")
Run Code Online (Sandbox Code Playgroud)

r ggplot2

14
推荐指数
1
解决办法
5460
查看次数

geom_text 仅位于堆积条形图的顶部

我只想在堆叠条形图的顶部有标签。

这是我的数据框:

#create data frame 
building <- c("Burj \nKhalifa", "Zifeng \nTower", "Bank of \nAmerica Tower", 
              "Burj Al Arab", "Emirates \nTower One", "New York \nTimes Tower",
              "Emirates \nTower Two", "Rose Rayhaan \nby Rotana", "The \nPinnacle", 
              "Minsheng \nBank Building")
occupiable<- c(585, 317, 235, 198, 241, 220, 213, 237, 265, 237)
nonoccupiable <- c(244, 133, 131, 124, 113, 99, 97, 96, 95, 94)
df.build <- data.frame(building, occupiable, nonoccupiable)

#melt data frame for stack bar plot
df.build2 <- melt(df.build, id.vars="building")
Run Code Online (Sandbox Code Playgroud)

我的堆积条形图:

#comparision true and …
Run Code Online (Sandbox Code Playgroud)

stack r bar-chart ggplot2 geom-text

3
推荐指数
1
解决办法
5697
查看次数

标签 统计

ggplot2 ×2

r ×2

bar-chart ×1

geom-text ×1

stack ×1