Re: [R] Just 2 more questions - for now!

From: john seers (IFR) <john.seers_at_bbsrc.ac.uk>
Date: Thu, 24 Jul 2008 13:24:43 +0100

 

Q1:

Have a look at:
?save
?save.image
?load

Q2:

I am not sure this is right:

model<-lm(data$admissions~data$maxitemp)

Try and code a line that looks more like this with the variables the names of the columns in your data:

model<-lm(admissions ~ maxitemp + minitemp, data=data)

Have a read of ?formula for more information.

(I usually try and avoid using the name "data" for my data because data is a function in R.)

Regards

JS  

---

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org]
On Behalf Of Williams, Robin
Sent: 24 July 2008 12:02
To: r-help_at_r-project.org
Subject: [R] Just 2 more questions - for now!

Hi all,
Thanks for the help with my previous post. 
I have just two more questions for the minute. 
  I think I said in a previous post that I like to use the terminal,
i.e. run rterm.exe. On exiting the terminal, I am asked if I want to
save the workspace. If I hit y (yes), the workspace is just saved as
.rdata in my working directory, does anyone know how I can name it
directly from the terminal? 
  More importantly, I can't then open this file from the terminal.
Obviously loading the file from windows explorer brings up the GUI.
Anyone know the command I need? All I can think of doing is adding
rterm.exe to my path and running it from the command prompt (adding the
file as an argument to my command), but surely there is an easy way to
do this from R? Of course I would like to have the terminal open and
open and close various workspaces in one session, without wanting to
restart R all the time. 
 
  Finally, I rather embarrasingly can't get lm to work despite reading
the help. I can get it to work with a single explanatory variable, EG
model <- lm(data$admissions~data$maxitemp) but how to include a second
explanatory variable (minitemp)? I keep getting errors. Surely I don't
need to use
c(data$maxitemp,data$minitemp) etc? 
 
All help greatly appreciated - I am getting there slowly!    
 

Robin Williams
Met Office summer intern - Health Forecasting
robin.williams_at_metoffice.gov.uk 

 

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
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 code.

______________________________________________
R-help_at_r-project.org mailing list
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 code.
Received on Thu 24 Jul 2008 - 12:47:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Jul 2008 - 13:32:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive