Re: [R] Problems with "predict" function ii

2018-01-31 Thread Rui Barradas
Hello, First of all, your question is about 'predict' but you include graphic instructions that have nothing to do with it. They do not hurt, but the reproducible example should also be minimal. Second, whenever you use RNG's, you should start it with set.seed(). Now, I have edited your

Re: [R] Problems with "predict" function ii

2018-01-31 Thread PIKAL Petr
] On Behalf Of WRAY NICHOLAS via R-help Sent: Wednesday, January 31, 2018 6:20 PM To: r-help <r-help@r-project.org> Subject: [R] Problems with "predict" function ii I have realised that I should have used "detach" before attaching another dataframe, but even when I do this

Re: [R] Problems with "predict" function ii

2018-01-31 Thread Jeff Newmiller
This is the kind of thing that leads experienced R users to avoid attach for data analysis. Read "The R Inferno". Use the "data" argument to lm, and the "newdata" argument to predict.lm. -- Sent from my phone. Please excuse my brevity. On January 31, 2018 9:20:10 AM PST, WRAY NICHOLAS via

[R] Problems with "predict" function ii

2018-01-31 Thread WRAY NICHOLAS via R-help
I have realised that I should have used "detach" before attaching another dataframe, but even when I do this it's still giving me lots of lines, rather than just one: My code: m<-runif(1,0,1) m mres<-m*(seq(1,12)) mres ssd<-rexp(1,1) ssd devs<-rep(0,length(mres)) for(i in