# [R] the error in DoSimulateRF function

Ben Bolker bolker at ufl.edu
Sun Mar 14 21:25:27 CET 2010

```maddy <madhura1301 <at> gmail.com> writes:

>
>
> Hello,
>
> I did not understand what you mean by updating the system. I am new
> user of R and I downloaded R a few days ago. Also I installed the
> required packages for my program(geoR, randomFields), there was just
> one version I could see for the packages.
> The code I am using is as follows
>

Where did you get the advice to set .Random.seed that way?
You probably wanted set.seed() [see ?set.seed] instead.  Removing
.Random.seed, or not setting in the first place, should make
things work.

Here's what I did, from a clean R session:

get_spherical_map <- function(N,phi) {
sim<-grf(N*N,grid="reg",cov.model="spherical",cov.pars=c(1,phi),method="RF")
sim\$data <- (sim\$data - mean(sim\$data)) / sd(sim\$data)
local <- array(sim\$data, dim=c(N,N))
}

library(geoR)

tmp <- get_spherical_map(300,0.25)
## works

.Random.seed <- 1

tmp <- get_spherical_map(300,0.25)
## error

rm(.Random.seed)
tmp <- get_spherical_map(300,0.25)

## Warning message:
## In grf(N * N, grid = "reg", cov.model = "spherical", cov.pars = c(1,  :
##   .Random.seed not initialised. Creating it with by calling runif(1)

```
{"ft_lang_label":"__label__en","ft_lang_prob":0.7597291,"math_prob":0.60988796,"size":1279,"snap":"2019-51-2020-05","text_gpt3_token_len":381,"char_repetition_ratio":0.118431374,"word_repetition_ratio":0.0,"special_character_ratio":0.31821737,"punctuation_ratio":0.20071685,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9812235,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-13T03:27:15Z\",\"WARC-Record-ID\":\"<urn:uuid:08b9af2c-d55c-4496-8435-33ea1442d8da>\",\"Content-Length\":\"4053\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b0bf156d-54d3-426c-91bf-3a946a40f138>\",\"WARC-Concurrent-To\":\"<urn:uuid:e877506c-885b-4a8e-b45a-3b78c60f1174>\",\"WARC-IP-Address\":\"129.132.119.195\",\"WARC-Target-URI\":\"https://stat.ethz.ch/pipermail/r-help/2010-March/231840.html\",\"WARC-Payload-Digest\":\"sha1:K2JMYSK577VIDGJWFBJXN42MBX545YA4\",\"WARC-Block-Digest\":\"sha1:G5YFLYUFEOAMTCMSZMXCB5BJPTXBBRM6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540548537.21_warc_CC-MAIN-20191213020114-20191213044114-00065.warc.gz\"}"}