Re: [R] savehistory()

2018-10-05 Thread Nancy S
Hi Sarah, Thank you for pointing out this. I am using Mac. Suy On Thu, Oct 4, 2018 at 1:23 PM Sarah Goslee wrote: > Hi Suy, > > It is very important to specify what OS and version of R you're using. > > But I'm going to make a wild guess that you're using Mac, and that you > didn't read the do

Re: [R] How can I create a loop for this? Please help me

2018-10-05 Thread Albrecht Kauffmann
Hi Ivy, try this: k <- 0 i <- 1 while((k*12+13) <= ncol(Sent2Field2@data) { i <- k+1 n <- paste("Sent2Field2",i, sep="_") assign(n, Sent2Field2@data[,c(1,k*12+c(2:13))]) k <- k+1 } Best, Albrecht -- Albrecht Kauffmann alkau...@fastmail.fm Am Fr, 5. Okt 2018, um 16:30, sc

Re: [R] How can I create a loop for this? Please help me

2018-10-05 Thread Jeff Newmiller
In addition to using plain text format when you post, please try to create a complete minimal example [1][2][3] that sets up a representative set of the variables you are using because the behavior of functions can change depending on what kind of data you are working with. For instance, so you

Re: [R] How can I create a loop for this? Please help me

2018-10-05 Thread MacQueen, Don via R-help
Bert (in his separate email) is right about learning the basics, and using R-sig-geo. You're kind of jumping right into the deep end! None the less, here's an example that should help. For one thing, you're being more complicated than necessary. SpatialPointsDataFrame objects can, much of the t

Re: [R] How can I create a loop for this? Please help me

2018-10-05 Thread Bert Gunter
Two things: 1. As your query is about spatial data, you may do better posting (in plain text, **not** html, which often gets mangled on these plain text lists) on the r-sig-geo list. 2. These lists can help, but do not replace, your obligation to do your own homework. There are many good R tutor

[R] How can I create a loop for this? Please help me

2018-10-05 Thread Ivy Pieters
Hey there, I am very much a newbie in the R world. I have to work with R for my internship. I really hope that someone can help me out here, since it costs me ages to run and adjust the same script over and over again. I have a SpatialPointsDataFrame table (sent2field2@data) that I would like t

Re: [R] Strange paradox

2018-10-05 Thread Bert Gunter
This list is about R programming. Statistics questions, which this is, are generally off topic here. Try posting on a statistics list like stats.stackexchange.com instead. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it.

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
Nope. This IS a bug: _*The negative auto-correlation mostly disappear when I randomize small samples using the R function '*__*sample*__*'.*_ Please check thoroughly the code of the 1st mail I sent, there should be no difference between the two R functions I wrote to illustrate the bug.

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
I got it ! thanks and sorry for annoying you with that. have a nice day, hugo On 05/10/2018 11:16, Deepayan Sarkar wrote: > On Fri, Oct 5, 2018 at 2:07 PM hmh wrote: >> On 05/10/2018 10:28, Annaert Jan wrote: >>> you discard any time series structure; >> But that is PRECISELY what a call a

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Deepayan Sarkar
On Fri, Oct 5, 2018 at 2:07 PM hmh wrote: > > On 05/10/2018 10:28, Annaert Jan wrote: > > you discard any time series structure; > But that is PRECISELY what a call a bug: > There should not be any "time series structure" in the output or rnorm, > runif and so on but there is one. > > rnorm(N,0,1)

Re: [R] Problems to obtain standardized betas in multiply-imputed data

2018-10-05 Thread Paul Johnson
Greetings. I would adjust approach to calculate standardized estimates for each imputed set. Then summarize them . The way you are doing it here implies that standardization concept applies to model list, which seems doubtful. The empirical std. dev. of the variables differs among imputed data set

[R] Strange paradox

2018-10-05 Thread CHATTON Anne via R-help
Hello, I am currently analysed two nested models using the same sample. Both the simpler model (Model 1 ~ x1 + x2) and the more complex model (Model 2 ~ x1 + x2 + x3 + x4) yield the same adjusted R-square. Yet the p-value associated with the deviance statistic is highly significant (p=0.0047),

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
On 05/10/2018 10:28, Annaert Jan wrote: > you discard any time series structure; But that is PRECISELY what a call a bug: There should not be any "time series structure" in the output or rnorm, runif and so on but there is one. rnorm(N,0,1) should give on average the same output as sample(rnorm(N

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Annaert Jan
On 05/10/2018, 09:45, "R-help on behalf of hmh" wrote: Hi, Thanks William for this fast answer, and sorry for sending the 1st mail to r-help instead to r-devel. I noticed that bug while I was simulating many small random walks using c(0,cumsum(rnorm(10))). The

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread hmh
Hi, Thanks William for this fast answer, and sorry for sending the 1st mail to r-help instead to r-devel. I noticed that bug while I was simulating many small random walks using c(0,cumsum(rnorm(10))). Then the negative auto-correlation was inducing a muchsmaller space visited by the random w