Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ggplot2: "Unknown parameters: probs" for fun.y = quantile in geom_line()

Tags:

r

ggplot2

The following code for drawing a line of the 10% quantile produces an error "Unknown parameters: probs". Does anybody know why?

ggplot(aes(y = mpg, x = cyl), data = mtcars) + 
geom_point(color = "orange") + 
geom_line(stat = 'summary', fun.y = quantile, probs = 0.1)

I have updated to the newest version of ggplot and use the following R version:

R.Version()

$platform
[1] "x86_64-w64-mingw32"

$arch
[1] "x86_64"

$os
[1] "mingw32"

$system
[1] "x86_64, mingw32"

$status
[1] ""

$major
[1] "3"

$minor
[1] "2.0"

$year
[1] "2015"

$month
[1] "04"

$day
[1] "16"

$svn rev
[1] "68180"

$language
[1] "R"

$version.string
[1] "R version 3.2.0 (2015-04-16)"

$nickname
[1] "Full of Ingredients"

like image 793
Daniel Pöhle Avatar asked Jan 03 '16 16:01

Daniel Pöhle


1 Answers

It took me some digging through the ggplot2 2.0-helpfiles. For this case, they are here. In the new version there is an argument fun.args. So, I was able to run this code with an updated version of ggplot and produce the desired plot:

ggplot(aes(y = mpg, x = cyl), data = mtcars) + 
  geom_point(color = "orange") + 
  geom_line(stat = 'summary', fun.y = "quantile", fun.args=list(probs=0.1))
like image 178
Heroka Avatar answered Nov 05 '22 19:11

Heroka