[R-sig-Geo] Saving a variogram in gstat

Mauricio Zambrano-Bigiarini hzambran.newsgroups at gmail.com
Mon Nov 5 17:07:47 CET 2012


Hi Carolina,

You can save all the variables of your current session by using 'save.image':

save.image("myVGMsession.RData")

and then load it as before (from Windows or GNU/Linux):

load("myVGMsession.RData")

Kinds,

Mauricio

2012/11/5 carolina monmany <acmonmany at gmail.com>:
> I see, Sarah. Thank you!
>
> Now I need to transfer those variograms to my PC running windows and that
> was the reason I  was doing
>
> save(variog11.2, file="tuc11.2.200.var.Rdata")
>
> and transfering those files from Linux to Windows. Should I transfer the
> .Rdata in the directory instead? Where are the objects themselves?
>
>
> 2012/11/5 Sarah Goslee <sarah.goslee at gmail.com>
>
>> On Mon, Nov 5, 2012 at 10:26 AM, carolina monmany <acmonmany at gmail.com>
>> wrote:
>> > Thanks Sarah and Mauricio,
>> >
>> > here's the example
>> >
>> >> library(gstat)
>> >> setwd("/home/acmonmany/matricesDN")
>> >> tuc11.2.frm = read.table("plot11_2.txt", header=T)
>> >> coordinates(tuc11.2.frm) <- c("X", "Y")
>> >> proj4string(tuc11.2.frm) <-CRS("+proj=utm +zone=20 +south +ellps=intl
>> > +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs")
>> >> variog11.2 <- variogram(reflectance~1, data=tuc11.2.frm)
>> >> save(variog11.2, file="tuc11.2.200.var.Rdata")
>> >
>> > NOW when I try to load the saved file (I do not change directory and I
>> can
>> > see the files there, in the directory stated above):
>> >
>> >
>> >> load("tuc11.2.200.var.Rdata")
>> >> class("tuc11.2.200.var.Rdata")
>> > [1] "character"
>>
>> Of course it is:
>>
>> "tuc11.2.200.var.Rdata" is a character string, as is anything in quotes.
>>
>>
>> >> summary(tuc11.2.200.var)
>> > Error in summary(tuc11.2.200.var) :
>> >   error in evaluating the argument 'object' in selecting a method for
>> > function 'summary': Error: object 'tuc11.2.200.var' not found
>>
>> That's not anything, just the name of your Rdata file. The R object
>> itself keeps the same name as it had when you saved it: variog11.2
>> summary(variog11.2)
>> will show you its properties. If you ls() you'll see there is no R object
>> called
>> tuc11.2.200.var
>>
>> If you want your saved object to have that name, you need to rename it
>> before saving.
>>
>> Sarah
>>
>>
>> --
>> Sarah Goslee
>> http://www.functionaldiversity.org
>>
>
>
>
> --
> ---------------------------
> A. CAROLINA MONMANY
> Universidad de Puerto Rico
> Departamento de Biologia - CN 235
> POBOX 23360
> San Juan, Puerto Rico 00931-3360
> Tel: +1 787 764 0000 x2847
> Fax: +1 787 764 2610
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



-- 
=====================================
Water Resources Unit
Institute for Environment and Sustainability
Joint Research Centre, European Commission
webinfo    : http://floods.jrc.ec.europa.eu/
=====================================
DISCLAIMER:\ "The views expressed are purely those of th...{{dropped:13}}



More information about the R-sig-Geo mailing list