Hi!

Well, you could try a subsetting rule like " year %in% yearsconsidered
".

Hope this helps,

Winfried
On Thu, 2004-03-25 at 14:33, Vumani Dlamini wrote:
> Dear R users;
> 
> I am trying to write a small program which reads in a data set, and selects 
> observations from certain years before the analysis. I have a problem 
> including the selection criteria in the header of the program.
> 
> Here is the problem;
> 
> dataFIT<-function(MODEL, MARGINS, yearConsidered){
>     library(foreign
>     CovPaper<-read.spss("C:/Data/data.sav")
>     NewData <- list(CovPaper$"YEAR"[CovPaper$"YEAR" == yearConsidered],
>                           CovPaper$"YEAR"[CovPaper$"SEX" == yearConsidered],
>                       #### and so on #####
>    #fit model to data #
> }
> 
> When I use one year there is no problem, but I would like some data sets to 
> span over years and I am not sure how to do this without having to change 
> the body of my fitting program.
> 
> I tried searching the R-list but to no avail.
> 
> Thanking you in advance.
> 
> 
> Vumani
> 
> _________________________________________________________________
> Hotmail en Messenger on the move 
> http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- 
-----------------------------------------------------------------
Dr. Dipl.-Math. Winfried Theis, SFB 475, Projekt C5,
Universit�t Dortmund, 44221 Dortmund
e-mail: [EMAIL PROTECTED]
Tel.: +49/231/755-5903 FAX: +49/231/755-4387

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to