[R] Forecast using VAR model

2017-05-20 Thread Dhivya Narayanasamy
I am building a VAR model to forecast of bivariate timeseries. But it shows flat forecast. So I would like to use recursive window forecasting technique using VAR model. Will it give what i expect (Avoid flat forecast) ? or should i have to go with other package. > datax.zoo <- read.zoo(datax)> d

[R] modulus operator?

2017-05-20 Thread McGann, Heidi
__ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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 co

Re: [R] train function in caret package

2017-05-20 Thread Hasan Diwan
A dput of your data may be helpful, Elahe? -- H[ On 19 May 2017 at 16:56, Elahe chalabi via R-help wrote: > Any answer?! > > On Friday, May 19, 2017 6:33 AM, Elahe chalabi via R-help < > r-help@r-project.org> wrote: > > > Hi all, > > I'm running train function from caret package on my data

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Ramnik Bansal
In the case of logical operations performed with an operand being a character type, the error is: "operations are possible only for numeric, logical or complex types" Now the display of this error message seems to be the OUTCOME of the fact that implicit coercion is NOT BEING APPLIED INTERNALLY to

Re: [R] Matching values between 2 data.frame.

2017-05-20 Thread William Dunlap via R-help
merge() may be useful here: > merge(OriginalData[1:3], TargetValue, by.x="AA1", by.y="AA", sort=FALSE)[-1] Value1 Value2 BB Value 1 1 11 B 7 2 3 13 B 7 3 11 21 B 7 4 2 12 B25 5 12 22 B25 6 9 19 B25 7 10

Re: [R] Matching values between 2 data.frame.

2017-05-20 Thread Bert Gunter
Like this? (use indexing to avoid explicit loops whenever possible): ## first convert factor columns to character, as David W. suggested i <- sapply(od,is.factor) od[i]<- lapply(od[i],as.character) i <- sapply(tv, is.factor) tv[i]<- lapply(tv[i],as.character) ## Now use ?match wh <- match(od

Re: [R] Matching values between 2 data.frame.

2017-05-20 Thread David Winsemius
> On May 20, 2017, at 11:23 AM, Christofer Bogaso > wrote: > > Hi again, > > Let say I have below 2 data frames. > > OriginalData = data.frame('Value1' = 1:12, 'Value2' = 11:22, 'AA1' = > c('AA4', 'AA3', 'AA4', 'AA1', 'AA2', 'AA1', 'AA6', 'AA6', 'AA3', > 'AA3', 'AA4', 'AA3'), 'Value' = NA) >

[R] Matching values between 2 data.frame.

2017-05-20 Thread Christofer Bogaso
Hi again, Let say I have below 2 data frames. OriginalData = data.frame('Value1' = 1:12, 'Value2' = 11:22, 'AA1' = c('AA4', 'AA3', 'AA4', 'AA1', 'AA2', 'AA1', 'AA6', 'AA6', 'AA3', 'AA3', 'AA4', 'AA3'), 'Value' = NA) TargetValue = data.frame('AA' = c('AA1', 'AA2', 'AA3', 'AA4', 'AA5', 'AA6'), 'BB

Re: [R] PROBLEM USING DICTIONARY WITH TM PACKAGE

2017-05-20 Thread Patrick Casimir
Jeff, Here is the solution: myTerms <- c("prostatic", "adenocarcinoma", "grade") inspect(DocumentTermMatrix(docs, list(dictionary = myTerms))) ## only returns from first 10 docs in DTM as.matrix(DocumentTermMatrix(docs, list(dictionary = myTerms))) ## returns from all docs in the DTM Pat

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Rolf Turner
On 20/05/17 22:42, Duncan Murdoch wrote: On 20/05/2017 6:39 AM, Rolf Turner wrote: On 20/05/17 22:18, Duncan Murdoch wrote: On 20/05/2017 5:53 AM, Martin Maechler wrote: Ramnik Bansal on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Duncan Murdoch
On 20/05/2017 6:39 AM, Rolf Turner wrote: On 20/05/17 22:18, Duncan Murdoch wrote: On 20/05/2017 5:53 AM, Martin Maechler wrote: Ramnik Bansal on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex number or a numeric as an operand in logi

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Rolf Turner
On 20/05/17 22:18, Duncan Murdoch wrote: On 20/05/2017 5:53 AM, Martin Maechler wrote: Ramnik Bansal on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex number or a numeric as an operand in logical > operations, to me it APPEARS that

Re: [R] [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Duncan Murdoch
On 20/05/2017 5:53 AM, Martin Maechler wrote: Ramnik Bansal on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex number or a numeric as an operand in logical > operations, to me it APPEARS that these two types are first coerced to

Re: [R] [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Martin Maechler
> Ramnik Bansal > on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex number or a numeric as an operand in logical > operations, to me it APPEARS that these two types are first coerced to > LOGICAL internally and then THIS lo