[R] about ECDF display in ggplot2
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sun Jul 8 06:47:43 CEST 2018
It is a feature of ggplot that points excluded by limits raise warnings, while base graphics do not.
You may find that using coord_cartesian with the xlim=c(0,500) argument works better with ggplot by showing the consequences of points out of the limits on lines within the viewport.
There are other possible problems with your data that your non-reproducible example does not show, and sending R code in HTML-formatted email usually corrupts it.. so please follow the recommendations in the Posting Guide next time you post.
On July 6, 2018 4:32:41 PM PDT, Bogdan Tanasa <tanasa using gmail.com> wrote:
>I would appreciate having your advice/suggestions/comments on the
>1 -- starting from a vector that contains LENGTHS (numerically, the
>are from 1 to 10 000)
>2 -- shall I display the ECDF by using the R code and some "limits" :
>BREAKS = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400,
> 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000)
>ggplot(x, aes(LENGTH)) +
> stat_ecdf(geom = "point") +
> scale_x_continuous(name = "LENGTH of DEL",
> breaks = BREAKS,
> limits=c(0, 500))
>3 -- I am getting the following warning message : "Warning message:
>109 rows containing non-finite values (stat_ecdf)."
>The question is : are these 109 values removed from VISUALIZATION as i
>up the "limits", or are these 109 values removed from statistical
>4 -- in contrast, shall I use the standard R functions plot(ecdf),
>no "warning mesage"
>plot(ecdf(x$LENGTH), xlab="DEL LENGTH",
> ylab="Fraction of DEL", main="DEL", xlim=c(0,500),
> col = "dark red")
>Thanks a lot !
> [[alternative HTML version deleted]]
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
Sent from my phone. Please excuse my brevity.
More information about the R-help