Question

Eyy guys, I am processing some datum using R in a Mac, first of all let me show you my code.

require(spatstat)
require(maptools)
setwd("/Whereever") # in that folder I have the files sis1993.txt and colombia.shp...

mydata <- read.table("sis1993.txt", header = TRUE)
attach(mydata)
summary(mydata) 
datos=read.table("sis1993.txt", header=T, dec=",", sep="\t")
summary(datos)
attach(datos)

S=readShapePoly("colombia.shp")
SP=as(S,"SpatialPolygons")
W=as(S,"owin")

sis1993=ppp(datos$x, datos$y, window=W)
unitname(sis1993)="meter"

sis1993=ppp(datos$x, datos$y, window=W, marks=m )

unitname(sis1993)="meter"
summary(sis1993)

Kenv <- envelope(sis1993,fun="Kest",nsim=199,nrank=5)
plot(Kenv,xlab="r",ylab="Khat(r)",cex.lab=1.6,cex.axis=1.5,main="K-Hat", cex.main=1.5)

Then, as a result of the function plot, I see this:

enter image description here

Now, let me explain you my issue... It is just a test, it only has 2 points, but the task that I am facing has around 1000-1200 points and I also must do it around ten times, thanks to that I cannot do this simulation using my computer because it will spend so much time, instead of that I plan to rent one of these services: Amazon EC2 (Amazon Elastic Compute Cloud).

In there, I must do it through a Linux/UNIX shell (SO: Ubuntu, I guess.), now my question is related to the last two lines in my code, how can I export Kenv into a file or something in order to import it and then plot it in my computer.

I hope you have understood me, let me know if you have any question.

Was it helpful?

Solution

See help(save) in R. That saves things to a file.

Then copy the file from the Amazon instance to your PC (beyond the scope of me).

then see help(load) for how to load it back in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top