[R] save to file

Duncan Murdoch murdoch at stats.uwo.ca
Sat May 10 00:16:41 CEST 2008


On 09/05/2008 5:55 PM, mtrp mtrp wrote:
> Hi,
> I am new to R. I am using spatstat package to generate some sample points but don't know how to save the result to file. Could anyone please give me some instructions? Thanks
> 
> I generate some random point data by using:
> pp<-runifpoint(100)
> I can plot it out with plot(pp)
> I suppose that pp contains x and y. How can I save these x, y pairs to file that has following format?
> x1,y1
> x2,y2
> ...

write.csv(cbind(pp$x, pp$y), file="my.file") should do it.

Duncan Murdoch



More information about the R-help mailing list