[R] pretty(range(data$z),10) Error

Hadley Wickham hadley at rice.edu
Fri Feb 10 13:50:02 CET 2012


Hi Mario,

If you're still having problems, I'd suggest sending a small
reproducible example
(https://github.com/hadley/devtools/wiki/Reproducibility) to the
ggplot2 mailing list.

Hadley

On Tue, Jan 17, 2012 at 12:32 PM, Mario Giesel <rr.giesel at yahoo.de> wrote:
> Hello, R-List,
> I'm getting error messages when adding geom_density2d() [package ggplot2]:
> ============================================================================
> Fehler in pretty(range(data$z), 10) :
>   NA/NaN/Inf in externem Funktionsaufruf (arg 1)
> Zusätzlich: Warnmeldungen:
> 1: Removed 10000 rows containing missing values (stat_contour).
> 2: In min(x) : kein nicht-fehlendes Argument für min; gebe Inf zurück
> 3: In max(x) : kein nicht-fehlendes Argument für max; gebe -Inf zurück
> 4: In min(x) : kein nicht-fehlendes Argument für min; gebe Inf zurück
> 5: In max(x) : kein nicht-fehlendes Argument für max; gebe -Inf zurück
> ============================================================================
>
> I installed 2.11.1 Patched in the hope to overcome this obstacle but in vain.
> I tried reading spss and csv format - no effect.
>
> While this one works:
> ggplot(sp2, aes(x=Qq04, y=Qq01)) + geom_point() + facet_wrap(~ segment,ncol=3)
> This one fails:
> ggplot(sp2, aes(x=Qq04, y=Qq01)) + geom_point() + facet_wrap(~ segment,ncol=3) + geom_density2d()
>
> But it only fails for 2 out of 10 x-variables, although they do not differ in structure.
> Data structure looks like this:
>
> segment Qq01 Qq02 Qq02a Qq04 Qq05 Qq07 Qq08 Qq10 Qq11 Qq15 Qq17a
> A 7 5 5 5 5 4 5 5 3 7 7
> A 5 4 4 3 4 3 4 4 4 5 6
> B 3 3 3 3 2 3 4 2 4 3 2
> B 6 4 5 3 3 3 4 4 3 6 6
> C 3 3 3 3 3 4 2 3 3 4 2
> C 2 1 4 3 1 4 1 1 3 4 2
> D 5 3 4 3 3 3 4 3 3 6 3
> D 5 3 4 2 2 4 4 3 3 4 4
> E 3 3 3 2 3 4 4 3 2 3 4
> E 7 5 5 5 5 4 4 5 1 7 7
> F 6 5 4 3 3 3 4 3 3 6 6
> F 5 3 4 3 3 4 4 3 3 4 4
> G 4 3 3 3 2 1 3 3 3 4 4
> G 6 5 5 5 5 4 5 5 3 7 7
> H 6 5 5 4 4 4 5 4 3 5 6
> H 7 5 5 5 4 4 5 5 3 7 7
> I 6 5 5 4 4 4 5 4 3 6 6
> I 6 3 4 2 3 4 4 3 4 6 4
> J 5 3 4 1 3 4 4 3 3 5 5
> J 4 2 4 3 2 2 3 2 3 4 4
> K 4 4 4 2 3 4 4 4 3 5 5
> K 6 4 3 3 2 3 4 3 3 6 5
> L 6 4 5 3 3 4 5 4 3 6 6
> L 3 1 2 2 1 3 3 1 3 4 4
> ...
> About 1.800 cases (more than 100 per segment).
> Did anybody experience similar problems?
>
> Thanks for all comments,
>  Mario
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>



-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list