[R] Question about using ggplot

Dominik Schneider dosc3612 at colorado.edu
Mon Nov 14 01:55:01 CET 2016


past versions of ggplot2 used to accept family as an argument directly, but
the latest ggplot2 (perhaps starting with v2?) requires method.args=list().
So the online sources you found using family directly were for an older
version of ggplot.

On Sun, Nov 13, 2016 at 8:18 AM, <overholic10 at ajou.ac.kr> wrote:

> Hi. I’m a student from South Korea, and I’m studying R by myself.
> While I am studying, I have a trouble dealing with ggplot(especially,
> about parameter ‘family’)
> > b <- biopsy
> > b$classn[b$class == "benign"] <- 0
> > b$classn[b$class == "malignant"] <- 1
> > ggplot(b, aes(x = V1, y = classn)) + geom_point(position =
> position_jitter(width = 0.3, height = 0.06), alpha = 0.4, shape = 21, size
> = 1.5) + stat_smooth(method = "glm", family = “bimomial")) #first code
> Warning: Ignoring unknown parameters: family
>
> While studying, I am wondering why there is a warning message. And also,
> there comes a wrong logistic model(Above picture). But in fact, I expect
> the below picture from the above code.
>
>
> And the below code yields ‘the model’ that I expected(below picture)
> ggplot(b, aes(x = V1, y = classn)) + geom_point(position =
> position_jitter(width = 0.3, height = 0.06), alpha = 0.4, shape = 21, size
> = 1.5) + stat_smooth(method = "glm", method.args = list(family =
> "binomial"))
>
>
>
>
> What’s wrong with the first code? When I searched about that from online,
> other people don’t seem to have a problem using family parameters.
> (I currently updated ggplot2, MASS, and sjPlot (Also, double checked it)
> Plus, I used code w/ or w/o using “”)
>
>
> I hope getting a good response from you.
> Thanks for reading my mail, and if my message has a rude expression, I’m
> sorry for my bad english skills..:(
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list