Re: [R] dependent nested for loops in R

2021-01-31 Thread David Winsemius
On 1/31/21 1:26 PM, Berry, Charles wrote: On Jan 30, 2021, at 9:32 PM, Shaami wrote: Hi I have made the sample code again. Could you please guide how to use vectorization for variables whose next value depends on the previous one? I agree with Charles that I suspect your results are not

Re: [R] union of two sets are smaller than one set?

2021-01-31 Thread Avi Gross via R-help
Martin, You did not say your two starting objects were already sets. You said they were vectors of strings. It may well be that your strings included duplicates. For example, If I read in lots of text with a blank line between paragraphs, I would have lots of seemingly empty and identical parts. J

Re: [R] dependent nested for loops in R

2021-01-31 Thread Berry, Charles
> On Jan 30, 2021, at 9:32 PM, Shaami wrote: > > Hi > I have made the sample code again. Could you please guide how to use > vectorization for variables whose next value depends on the previous one? > Glad to help. First, it could help you to trace your code. I suspect that the results ar

Re: [R] union of two sets are smaller than one set?

2021-01-31 Thread Enrico Schumann
On Sun, 31 Jan 2021, Martin Møller Skarbiniks Pedersen writes: > This is really puzzling me and when I try to make a small example > everything works like expected. > > The problem: > > I got these two large vectors of strings. > >> str(s1) > chr [1:766608] "0.dk" ... >> str(s2) > chr [1:59387]

Re: [R] union of two sets are smaller than one set?

2021-01-31 Thread Duncan Murdoch
On 31/01/2021 3:57 p.m., Martin Møller Skarbiniks Pedersen wrote: This is really puzzling me and when I try to make a small example everything works like expected. The problem: I got these two large vectors of strings. str(s1) chr [1:766608] "0.dk" ... str(s2) chr [1:59387] "043.dk" "0

[R] union of two sets are smaller than one set?

2021-01-31 Thread Martin Møller Skarbiniks Pedersen
This is really puzzling me and when I try to make a small example everything works like expected. The problem: I got these two large vectors of strings. > str(s1) chr [1:766608] "0.dk" ... > str(s2) chr [1:59387] "043.dk" "0606.dk" "0618.dk" "0888.dk" "0iq.dk" "0it.dk" ... And I need to creat

Re: [R] Help with Using spTimer or spTDyn to estimate "GP" Model

2021-01-31 Thread Bert Gunter
Also note that you should have a higher likelihood of getting a helpful response on the r-sig-geo list rather than here. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic stri

Re: [R] Help with Using spTimer or spTDyn to estimate "GP" Model

2021-01-31 Thread Bert Gunter
Please not per the posting guide linked below: "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R ), ask questions on R-help. If the question relates to a *contributed package*

Re: [R] Help with Using spTimer or spTDyn to estimate "GP" Model

2021-01-31 Thread alex_rugu--- via R-help
When I run the following scripts I get the following error and I do not understand the source. I believe N is specified as the number of observations by year in the time series variables.  The error is ### Output: GP models  Error in spGP.Gibbs(formula = formul

Re: [R] dependent nested for loops in R

2021-01-31 Thread Shaami
Hi I have made the sample code again. Could you please guide how to use vectorization for variables whose next value depends on the previous one? w = NULL for(j in 1:1000) { z = NULL x = rnorm(2000) z[1] = x[1] for(i in 2:2000) { z[i] = x[i]+5*z[i-1] if(z[i]>4 | z[i]<1)