Re: [R] Plot for 10 years extrapolation

2023-10-26 Thread Bert Gunter
Incidentally, if all you wanted to do was plot fitted values, the predict method is kinda overkill, as it's just the fitted line from the model. But I assume you wanted to plot CI's/PI's also, as the example illustrated. -- Bert On Thu, Oct 26, 2023 at 1:56 PM Bert Gunter wrote: > > from

Re: [R] Plot for 10 years extrapolation

2023-10-26 Thread Bert Gunter
from ?predict.lm: "predict.lm produces a vector of predictions or a matrix of predictions and bounds with column names fit, lwr, and upr if interval is set. " ergo: predict(model, dfuture, interval = "prediction")[,"fit"] ## or [,1] as it's the first column in the returned matrix is your

Re: [R] Need help to resolve the Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Execution halted

2023-10-26 Thread Ben Bolker
Hmm, I can't replicate (i.e., it works fine for me). What are the results of your sessionInfo() (from a *clean* R session)? == R Under development (unstable) (2023-10-25 r85410) Platform: x86_64-pc-linux-gnu Running under: Pop!_OS 22.04 LTS Matrix products: default BLAS:

[R] Need help to resolve the Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Execution halted

2023-10-26 Thread siddharth sahasrabudhe via R-help
Hello Colleagues, I am trying to get the Git repository using *remotes* package. I am using *remotes::install_github("dcl-docs/dcldata") *to get the Git repo. However, I am getting the following error message. I have absolutely no idea on what this error message means and how to get away with

[R] Plot for 10 years extrapolation

2023-10-26 Thread varin sacha via R-help
Dear R-Experts, Here below my R code working but I don't know how to complete/finish my R code to get the final plot with the extrapolation for the10 more years. Indeed, I try to extrapolate my data with a linear fit over the next 10 years. So I create a date sequence for the next 10 years and

Re: [R] Inquiry about bandwidth rescaling in Ksmooth

2023-10-26 Thread Bert Gunter
Apologies in advance if my comments don't help, in which case, no need to respond, but I noted in ?ksmooth: "bandwidth the bandwidth. The kernels are scaled so that their quartiles (viewed as probability densities) are at ± 0.25*bandwidth." So, could this be a source of the discrepancies you

Re: [R] Bug in print for data frames?

2023-10-26 Thread Christian Asseburg
Dear R users! Thank you for your excellent replies. I didn't know that the print.data.frame expands matrix-like values in this way. Why doesn't it call the column in my example C.A? I understand that something like that happens when the data.frame in position three has multiple columns. But

[R] Inquiry about bandwidth rescaling in Ksmooth

2023-10-26 Thread Jan Failenschmid via R-help
Dear Sir, Madam, or to whom this may concern, my name is Jan Failenschmid and I am a Ph.D. student at Tilburg University. For my project I have been looking into different types of kernel regression estimators and corresponding R functions. While comparing different functions I noticed that

Re: [R] Yext in parentheses.

2023-10-26 Thread Jeff Newmiller via R-help
I recommend cutting snippets out of your code by stopping the code at the point of interest and using dput() to pull out "data as it is" before the troublesome section and then using the reprex package to test that the snippet runs. Either you will notice the problem on your own while taking

Re: [R] Yext in parentheses.

2023-10-26 Thread Sarah Goslee
Hi, It isn't at all clear to me what you're trying to do. For one thing, you never actually add more items to cat.ref in the code snippet you give. You do use c() on zx.ref - is that what you mean? But you aren't adding cat.ref to it, you're adding v$cat.ref, and I have no idea what that might

[R] Yext in parentheses.

2023-10-26 Thread Steven Yen
Dear All My program is long and sorry I do not have a replicable set of codes to present. But I present a chunk of codes at the end below. Essentially, 1. I initialize cat.ref as NUL (see line 1) 2. Then, I repeatedly add elements to cat.ref, where each element include parentheses in double

Re: [R] Bug in print for data frames?

2023-10-26 Thread Rui Barradas
Hello, Inline. Às 13:32 de 26/10/2023, Ebert,Timothy Aaron escreveu: The "problem" goes away if you use x$C <- y[1,] Actually, if I understand correctly, the OP wants the column: x$C <- y[,1] In this case it will produce the same output because y is a df with only one row. But that is

Re: [R] Bug in print for data frames?

2023-10-26 Thread Ebert,Timothy Aaron
The "problem" goes away if you use x$C <- y[1,] If you have another row in your x, say: x <- data.frame(A=c(1,4), B=c(2,5), C=c(3,6)) then your code x$C <- y[1] returns an error. If y has the same number of rows as x$C then R has the same outcome as in your example. It looks like your code

Re: [R] Bug in print for data frames?

2023-10-26 Thread Rui Barradas
Às 07:18 de 25/10/2023, Christian Asseburg escreveu: Hi! I came across this unexpected behaviour in R. First I thought it was a bug in the assignment operator <- but now I think it's maybe a bug in the way data frames are being printed. What do you think? Using R 4.3.1: x <- data.frame(A =

Re: [R] Bug in print for data frames?

2023-10-26 Thread Duncan Murdoch
On 25/10/2023 2:18 a.m., Christian Asseburg wrote: Hi! I came across this unexpected behaviour in R. First I thought it was a bug in the assignment operator <- but now I think it's maybe a bug in the way data frames are being printed. What do you think? Using R 4.3.1: x <- data.frame(A = 1,

Re: [R] Bug in print for data frames?

2023-10-26 Thread Iris Simmons
I would say this is not an error, but I think what you wrote isn't what you intended to do anyway. y[1] is a data.frame which contains only the first column of y, which you assign to x$C, so now x$C is a data.frame. R allows data.frame to be plain vectors as well as matrices and data.frames,

[R] Bug in print for data frames?

2023-10-26 Thread Christian Asseburg
Hi! I came across this unexpected behaviour in R. First I thought it was a bug in the assignment operator <- but now I think it's maybe a bug in the way data frames are being printed. What do you think? Using R 4.3.1: > x <- data.frame(A = 1, B = 2, C = 3) > y <- data.frame(A = 1) > x A B C