简体   繁体   English

如何从外壳导出数据,然后如何在其他计算机上绘制数据? [R

[英]How to export data from a shell and then how to plot it in other computer? R

Eyy guys, I am processing some datum using R in a Mac, first of all let me show you my code. 大家好,我正在Mac中使用R处理一些数据,首先让我向您展示我的代码。

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: 然后,作为函数plot的结果,我看到了:

在此处输入图片说明

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) . 现在,让我向您解释我的问题...这只是一个测试,它只有2分,但是我要面对的任务大约有1000-1200分,而且我还必须做10次左右,这要归功于我无法使用我的计算机进行此模拟,因为它将花费大量时间,而不是我打算租用以下服务之一: 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. 在那儿,我必须通过Linux / UNIX shell(SO:Ubuntu,我想是)来完成它,现在我的问题与代码的最后两行有关,如何将Kenv导出到文件或其他东西中,以便导入它,然后将其plot在我的计算机中。

I hope you have understood me, let me know if you have any question. 希望您了解我,如果您有任何疑问,请告诉我。

See help(save) in R. That saves things to a file. 请参阅R中的help(save) 。将内容保存到文件中。

Then copy the file from the Amazon instance to your PC (beyond the scope of me). 然后将文件从Amazon实例复制到您的PC(超出我的范围)。

then see help(load) for how to load it back in. 然后请参阅help(load)了解如何将其重新加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM