[R] Why no line? (ex. from Andy Filed book)

PIKAL Petr petr.pikal at precheza.cz
Fri Feb 15 15:08:35 CET 2013


Hi

The code gives me some warnings but all seems to be OK. 4 points, dashed red line and error bars. Did you expect some other line?

maybe issue of version/OS? (unstated)
Petr

> sessionInfo()
R Under development (unstable) (2012-10-29 r61044)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Czech_Czech Republic.1250  LC_CTYPE=Czech_Czech Republic.1250   
[3] LC_MONETARY=Czech_Czech Republic.1250 LC_NUMERIC=C                         
[5] LC_TIME=Czech_Czech Republic.1250    

attached base packages:
[1] splines   stats     datasets  utils     grDevices graphics  methods  
[8] base     

other attached packages:
[1] Hmisc_3.9-2      survival_2.36-14 reshape_0.8.4    plyr_1.7.1      
[5] ggplot2_0.9.0    lattice_0.20-10  fun_1.0         

loaded via a namespace (and not attached):
 [1] cluster_1.14.3     colorspace_1.1-1   digest_0.5.1       dichromat_1.2-4   
 [5] grid_2.16.0        MASS_7.3-22        memoise_0.1        munsell_0.3       
 [9] nlme_3.1-105       proto_0.3-9.2      RColorBrewer_1.0-5 reshape2_1.2.1    
[13] scales_0.2.0       stringr_0.6        tools_2.16.0      
>






> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Kevin Mc Inerney
> Sent: Friday, February 15, 2013 1:32 AM
> To: r-help at r-project.org
> Subject: [R] Why no line? (ex. from Andy Filed book)
> 
> The following script is written by the author of a book on R--Andy
> Field:
> You can also download the small datafile, hiccups.dat, from this
> address:
> 
> http://www.sagepub.com/dsur/study/articles.htm
> 
> The script:
> 
> hiccupsData <- read.delim("Hiccups.dat",  header = TRUE)
> hiccups<-stack(hiccupsData)
> names(hiccups)<-c("Hiccups","Intervention")
> hiccups$Intervention_Factor<-factor(hiccups$Intervention, levels =
> hiccups$Intervention)
> 
> line <- ggplot(hiccups, aes(Intervention_Factor, Hiccups)) line +
> stat_summary(fun.y = mean, geom = "point") + stat_summary(fun.y = mean,
> geom = "line", aes(group=1),colour = "Red", linetype = "dashed")+
> stat_summary(fun.data = mean_cl_boot, geom = "errorbar", width = 0.2) +
> labs(x = "Intervention", y = "Mean Number of Hiccups")
> saveInImageDirectory("04 Hiccups Line.png")
> 
> Why does this script not give me a line?
> 
> It's driving e crazy :-|
> 
> 	[[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.



More information about the R-help mailing list