On Nov 1, 2012, at 5:41 PM, kebrab67 wrote: > I have a set of data with 205 988 observation sand 10 variables , three of > which are Legal_status, Date_of_incorporation and . I set my time > horizon from 1989 to 2009. Now I want to know when a company is dead. If > Last_year is bigger or equal to 2009 then I say that a new "variable" last > is 2009. If Last_year is smaller than 2009 then my new variable "last" is > equal to the variable "Last_year". I wanted to know how I can generate this > new variable and connect it to my original data called data.
last <- pmin(Last_year, 2009) -- David Winsemius, MD Alameda, CA, USA ______________________________________________ R-help@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.