[R] correction needed in codes

Rui Barradas ruipbarradas at sapo.pt
Sun Dec 23 15:14:08 CET 2012


Hello,

Can't you simply lapply(b, lines, lwd = 2) ?

Hope this helps,

Rui Barradas

Em 23-12-2012 02:19, eliza botto escreveu:
> Dear useRs,while trying to plot the yearly curves of 1000 stations and overlapping each set of curves with mean curve and then saving it automatically in a pdf file, i tried the following commands
>> Path = "C:\\R\\003.pdf">pdf(file=Path)   for (i in seq(1:1000)
>> a<-lapply(seq_along(tcp), function(x) tcp[[x]][,-1])
>
>> b<-lapply(seq_along(a), function(a) matrix(rowMeans(tcp[[a]]),ncol=1))
>
>> lapply(seq_along(tcp), function(i) (matplot(tcp[[i]][,-1],
> type="l",col="grey") )
>
>
>> lines(b, lwd=2, type="l"))
>   } >dev.off()although i was successful in plotting yearly curves of each station, but overlapping them with the mean curves still remains an issue.kindly guide me what kind of improvement is needed in my codes.thanks in advance
> regardseliza 		 	   		
> 	[[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