[R] How to extract smoothed plot data?

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat Aug 20 17:00:05 CEST 2011



On 20.08.2011 12:57, derek wrote:
> Dear R,
>
> I have this script which from my data points creates smoothed plot:
>
> require(graphics)
> require(stats)
> A=read.table("some.txt",header =FALSE,sep = "", dec = ",",fileEncoding = "",
> encoding = "unknown", skip=18,nrows=400)
> attach(A)
> plot(A$V1, A$V2,col="white")
> lines(smooth.spline(A$V1, A$V2,spar=0.4),col="green",lwd=3)

sspline <- smooth.spline(A$V1, A$V2, spar=0.4)
write.table(data.frame(sspline[c("x", "y")]), file = .......)


Uwe Ligges


> I would like to export points coordinates from smoothed plot to file, so
> that I can then use new data for further analysis. In other words to pipe
> defined sequence of x coordinates and corresponding y values to file.
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-extract-smoothed-plot-data-tp3756894p3756894.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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