I would like to thank you for your kindness to help me.
But I am not sure if
temp <- grf(ncell(r), cov.pars=c(1, .25)) is correct as this will create
around
64.000 locations (not sure what the parameter location is in grf package).
Unfortunately it seems that I have a more serious problem when I try to load
RandomFields package.
1. Error in dyn.load(file, DLLpath = DLLpath, ...) :
2. unable to load shared library
'/home/apa/R/x86_64-unknown-linux-gnu-library/2.11/RandomFields/libs/RandomFields.so':
3. /usr/lib64/R/lib/libRlapack.so: undefined symbol: _gfortran_concat_string
I spend one hour in google for this but so far did not find anything.
You can find all the output I get during the installation of the package here
http://pastebin.com/apxPxnyd
Best Regards
Alex
>
>
________________________________
From: Nikhil Kaza <nikhil.list@gmail.com>
>Sent: Thu, July 29, 2010 1:29:52 AM
>Subject: Re: [R] Beginner stucked with raster + geoR package.
>
>
>
>I tried the following. Not sure if this is the right approach.
>
>require(RandomFields)
>r <- raster()
>> r <- setValues(r,1:ncell(r)/100)
>> temp <- grf(ncell(r), cov.pars=c(1, .25))
>> r <- setValues(r,temp$data)
>plot(r)
>
>
>Nikhil Kaza
>Asst. Professor,
>City and Regional Planning
>University of North Carolina
>
>nikhil.list@gmail.com
>
>On Jul 28, 2010, at 6:53 PM, Alaios wrote:
>
>> Can someone help me please with step 5?
>>
>> r <- setValues(r,temp) # Unfortunately this ends with the message:
Error in
>> setValues(r, temp) : values must be a vector
>>
>> How to make temp a vector?
>>
>>
>>
>> ________________________________
>>
>> To: r-help@r-project.org
>> Sent: Wed, July 28, 2010 3:55:54 PM
>> Subject: [R] Beginner stucked with raster + geoR package.
>>
>>
>>
>> Hello everyone.
>> I am trying to build up understanding in R by trying to develop just
some
>>simple
>>
>> scenarios.
>>
>> I would like to explain you what I am trying to do and what I did so
far.
>>
>> I would like to put inside a RasterLayer (raster package) a Gaussian
field
>(for
>> given covariance) using grf function (geoR package)
>>
>> 1. First I created a Raster Layer object
>> r <- raster() # Default values are ok
>> 2. Then I set some values to test how if setValues worked
>> r <- setValues(r,1:ncell(r)/100) # Every cell of the RasterLayer
takes as
data>> its cell number/100.
>> 3. Tested that 2 works with
>> getValuesBlock(r,1,nrow(r),1,ncol(r))
>> 4. Then I tried to generate a Gaussian random field for given
covariance
>> parameters using grf.
>> temp <- grf(1,nx=nrow(r),ny=ncol(r), cov.pars=c(1, .25)) # Note: The
first
>>input
>>
>> parameter in grf is locations. At first I tried nrow(r)*ncol(y) but I
got the
>> ouput that this will produce 15,5 Gb of data :(. I just wanted to
created a
>x*y
>> array of this data. Then I tried to pass the nrow(r) and ncol(r) to the
nx
and>> ny arguments. Now this seems ok to me.
>> 5. Final step is to set the values created in 4th step to the
RasterLayer
>>object
>>
>> that was created at first step.
>> r <- setValues(r,temp) # Unfortunately this ends with the message:
Error in
>> setValues(r, temp) : values must be a vector
>>
>> and at this point I am completely stuck :(
>>
>> I would like to request some of your kindness to help me unstuck
>>
>> Best Regards
>> Alex.
>>
>>
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@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.
>>
>>
>>
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@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.
>
>
>
>
[[alternative HTML version deleted]]