Re: [R] back tick names with predict function

2023-12-03 Thread Robert Baer
On 12/1/2023 11:47 AM, peter dalgaard wrote: Also, and possibly more constructively, when you get an error like CI.c = predict(mod2, data.frame( `plant-density` = x), interval = 'c') # fail Error in eval(predvars, data, env) : object 'plant-density' not found you should check your

Re: [R] back tick names with predict function

2023-12-01 Thread peter dalgaard
Also, and possibly more constructively, when you get an error like > CI.c = predict(mod2, data.frame( `plant-density` = x), interval = 'c') # fail Error in eval(predvars, data, env) : object 'plant-density' not found you should check your assumptions. Does "newdata" actually contain a columnn

Re: [R] back tick names with predict function

2023-11-30 Thread Bert Gunter
"Thank you Rui. I didn't know about the check.names = FALSE argument. > Another good reminder to always read help, but I'm not sure I understood > what help to read in this case" ?data.frame , of course, which says: "check.names logical. If TRUE then the names of the variables in the data

Re: [R] back tick names with predict function

2023-11-30 Thread Robert Baer
Thank you Rui.  I didn't know about the check.names = FALSE argument.  Another good reminder to always read help, but I'm not sure I understood what help to read in this case.  Since your clue, I've discovered that a tibble-based strategy could also work. x = seq(min(cob_wt$`plant-density`),

Re: [R] back tick names with predict function

2023-11-30 Thread Rui Barradas
Às 17:57 de 30/11/2023, Rui Barradas escreveu: Às 17:38 de 30/11/2023, Robert Baer escreveu: I am having trouble using back ticks with the R extractor function 'predict' and an lm() model.  I'm trying too construct some nice vectors that can be used for plotting the two types of regression

Re: [R] back tick names with predict function

2023-11-30 Thread Rui Barradas
Às 17:38 de 30/11/2023, Robert Baer escreveu: I am having trouble using back ticks with the R extractor function 'predict' and an lm() model.  I'm trying too construct some nice vectors that can be used for plotting the two types of regression intervals.  I think it works with normal column

[R] back tick names with predict function

2023-11-30 Thread Robert Baer
I am having trouble using back ticks with the R extractor function 'predict' and an lm() model.  I'm trying too construct some nice vectors that can be used for plotting the two types of regression intervals.  I think it works with normal column heading names but it fails when I have "special"