Re: [R] DROP OBSErVATIONs IN A GROUP

2011-06-29 Thread Ben Bolker
David Winsemius comcast.net> writes: > > The strategy of cbind vectors as an argument to data.frame and then > naming them seems wasteful and error prone. Why not: > > z <- data.frame(n=factor(n),y=y) > # all one step, no issues about every element needing to be the same > mode > # and no

Re: [R] DROP OBSErVATIONs IN A GROUP

2011-06-29 Thread David Winsemius
On Jun 29, 2011, at 4:29 PM, Peter Maclean wrote: People with more experience in R I need help on this. I would like to drop observation if they meet certain condition. In this example I would like to drop group 2 in "n" because the group in "Y" has more than 2 zeroes. #Example n <- c(1, 1

Re: [R] drop observations

2010-12-30 Thread DrorD
Hi Charlene, Have you looked at: >?subset dror -- View this message in context: http://r.789695.n4.nabble.com/drop-observations-tp3168884p3168906.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list http

Re: [R] drop observations

2010-12-30 Thread David Winsemius
On Dec 30, 2010, at 5:53 PM, David Winsemius wrote: On Dec 30, 2010, at 4:54 PM, Charlène Cosandier wrote: Hi, I want to drop observations with value 0 from my data.frame "dta" for each of the two variables "c01" and "ctotale". How can I do that? And on second look I wonder if my trans

Re: [R] drop observations

2010-12-30 Thread David Winsemius
On Dec 30, 2010, at 4:54 PM, Charlène Cosandier wrote: Hi, I want to drop observations with value 0 from my data.frame "dta" for each of the two variables "c01" and "ctotale". How can I do that? Thanks subset(dta, !( c01==0 | ctotale==0) ) ... remembering of course to assign this resu

[R] drop observations

2010-12-30 Thread Charlène Cosandier
Hi, I want to drop observations with value 0 from my data.frame "dta" for each of the two variables "c01" and "ctotale". How can I do that? Thanks Charlène Lisa Cosandier [[alternative HTML version deleted]] __ R-help@r-project.org mailing l

Re: [R] Drop observations in unbalanced panel data set according to missing values

2010-05-28 Thread David Winsemius
On May 28, 2010, at 5:58 PM, Christian Schoder wrote: Dear R-users, I use firm-level data in panel structure. I would like to drop all firms that have less than x observations over the time scale in any of the variables considered. I would appreciate any help that (a) indicates relevant

[R] Drop observations in unbalanced panel data set according to missing values

2010-05-28 Thread Christian Schoder
Dear R-users, I use firm-level data in panel structure. I would like to drop all firms that have less than x observations over the time scale in any of the variables considered. I would appreciate any help that (a) indicates relevant literature or websites or (b) indicates the code that could s