Re: [R] Error message when adding drift for Arima model

2019-05-09 Thread Rui Barradas
Why not Arima(tsdata, c(0, 0, 1), include.drift = TRUE) ? Why do you say it should be an AR(2) model? Hope this helps, Rui Barradas Às 06:43 de 10/05/19, Rui Barradas escreveu: Hello, This is just a typo, in R logical values ("true) are not character strings. You must pass FALSE (the defa

Re: [R] Error message when adding drift for Arima model

2019-05-09 Thread Rui Barradas
Hello, This is just a typo, in R logical values ("true) are not character strings. You must pass FALSE (the default, can be omited) or TRUE. fitdata <- Arima(tsdata, c(2, 0, 0), include.drift = TRUE) From the help page ?logical Details TRUE and FALSE are reserved words denoting logical c

Re: [R] Error message when adding drift for Arima model

2019-05-09 Thread Bert Gunter
In future, always cc the list (unless it's personal,which this isn't). I have done so here. As I am largely ignorant on the subject matter, others will have to help, which is why you should cc the list. Cheers, Bert Gunter "The trouble with having an open mind is that people keep coming along and

Re: [R] Error message when adding drift for Arima model

2019-05-09 Thread Bert Gunter
Please start by reading and following the posting guide linked at the bottom of this email. In particular: 1) Post in **plain text** on this plain text list so we don't get the mangled html of your post. 2) Tell us what package Arima() is in. Cheers, Bert Gunter On Thu, May 9, 2019 at 2:27 P

[R] Error message when adding drift for Arima model

2019-05-09 Thread Michael Howell
Hello everyone, So this is my first post to this list, I'm trying to fit an Arima (2,0,0) model and I think a drift term would help but I'm getting an error term when I'm trying to include it. Here is my data: -6.732172338 -2.868884273 -5.371585089 -6.512740463 -4.171062657 -5.738499071 -3.3439471

[R] A question on generating Error message upon Timeout

2019-05-09 Thread Christofer Bogaso
Hi, I have created a function called myFn() which should be acting as below: 1. If function takes too long, then it will timeout and a specific message will be displayed 2. This function may generate error on its own, so if it evaluates before that specific time and fails then another specific me

Re: [R] Trying to understand the magic of lm

2019-05-09 Thread Bert Gunter
I don't think previous responses have addressed the question, which appears to be: "How does R know to look in the "data" object for the variable names in the formula?" And, of course, I could be wrong -- in which case ignore all the following. My answer to that question is: it's quite complicated

Re: [R] error in duplicated() man page

2019-05-09 Thread Bert Gunter
Thanks, Martin. I missed the duplication. My apology -- old age is asserting it's presence. Then my response is: I think the documentation is correct as written: > a <- matrix(rep(1:3,2), nr=3) > a [,1] [,2] [1,]11 [2,]22 [3,]33 > duplicated(a) [1] FALSE FALSE FALSE

Re: [R] Trying to understand the magic of lm

2019-05-09 Thread William Michels via R-help
Hello John, Others have commented on the first half of your question, but the second half of your question looks very much like R's built-in predict() functions: >?predict >?predict.lm Best Regards, Bill. W. Michels, Ph.D. On Wed, May 8, 2019 at 6:23 PM Sorkin, John wrote: > > Can someone

Re: [R] error in duplicated() man page

2019-05-09 Thread Martin Maechler
> Bert Gunter > on Thu, 9 May 2019 08:46:15 -0700 writes: > Juan: > No, I think there may be a bug: >> duplicated(array(c(1,2,3,2,5,6),c(3,2)), MARGIN=1:2) > [,1] [,2] > [1,] FALSE TRUE > [2,] FALSE FALSE > [3,] FALSE FALSE > ## This is wrong >

Re: [R] error in duplicated() man page

2019-05-09 Thread Bert Gunter
Juan: No, I think there may be a bug: > duplicated(array(c(1,2,3,2,5,6),c(3,2)), MARGIN=1:2) [,1] [,2] [1,] FALSE TRUE [2,] FALSE FALSE [3,] FALSE FALSE ## This is wrong ## But if we first define the array... > a <- array(c(1,2,3,4,5,6), c(3,2)) > duplicated(a, MARGIN = 1:2) [,1] [

[R] error in duplicated() man page

2019-05-09 Thread Juan Gomez
I think there is an error in duplicated() help page when it states that: "The array method calculates for each element of the sub-array specified by MARGIN if the remaining dimensions are identical to those for an earlier (or later, when fromLast = TRUE) element (in row-major order). " Instead of:

Re: [R] install R

2019-05-09 Thread Paul Bivand
I'd encourage you to install a full build system for your linux. That way you are able to compile any contributed packages you may want. Your linux package manager (apt, dnf, urpmi etc) may be able to provide an R compiled package, which with the exception of Debian/Ubuntu is likely to be several

Re: [R] Trying to understand the magic of lm

2019-05-09 Thread Rui Barradas
Hello, There is a "standard" deparse/substitute trick that gets the names of the variables passed to a function. There are more sophisticated ways but maybe that is what you are looking for. myfunction <- function(y, x, dataframe){ y <- deparse(substitute(y)) x <- deparse(substitute(x))

[R] functional autoregressive model of order two

2019-05-09 Thread Faheem Jan via R-help
HI, i am functional data analysis, using times series data to which i fit the functional autoregressive model of order one using FAR package in R, know i want to extend my model to order two as it is observed that the FAR package can  only do for order one., can any body help me that how to exte