Re: [R] filter data

2014-03-12 Thread arun
Hi, This is not clear.  May be this helps: dat - read.table(text=cid cname  101 us  102 uk  103 gm  104 NA  105 SA  106 fr  102 us  104 fr  105 gm  101 uk  102 us  106 SA  103 gm  105 SA  101 us  106 fr,sep=,header=TRUE,stringsAsFactors=FALSE)  lst1 - split(dat,list(dat$cid,dat$cname),drop=TRUE)

Re: [R] Filter data

2010-12-20 Thread AlexZolot
You missed the first, the most important line of str() output. What type is your data? -- View this message in context: http://r.789695.n4.nabble.com/Filter-data-tp3070069p3108011.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Filter data

2010-12-03 Thread Petr PIKAL
Hi Hm. Does str(poli) revealed said explicitly that poli is data frame? I presume that it told you that it is list. In that case you need to use appropriate indexing, which suits structure of your list. Regards r-help-boun...@r-project.org napsal dne 02.12.2010 22:06:15: Simplified

[R] Filter data

2010-12-02 Thread Diogenas
Hello, I understand that question is probably stupid, but ... I have data (polity IV index) country,year,democ,autoc,polity,polity2 1,Afghanistan ,1800,1,7,-6,-6 2,Afghanistan ,1801,1,7,-6,-6 3,Afghanistan ,1802,1,7,-6,-6 I need to create new data sets which

Re: [R] Filter data

2010-12-02 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Diogenas Sent: Thursday, December 02, 2010 12:09 PM To: r-help@r-project.org Subject: [R] Filter data Hello, I understand that question is probably stupid, but ... I

Re: [R] Filter data

2010-12-02 Thread Diogenas
Simplified version of str(poli): (real dataset includes 36 variables) $ country : chr [1:15846] Afghanistan Afghanistan Afghanistan Afghanistan ... $ year: num [1:15846] 1800 1801 1802 1803 1804 ... $ democ : num [1:15846] 1 1 1 1 1 1

Re: [R] Filter data

2010-12-02 Thread mohamed . lajnef
Hi Diogenas, Try this, data-subset(poli, poli$year1994) Best, M Diogenas dioge...@gmail.com a écrit : Hello, I understand that question is probably stupid, but ... I have data (polity IV index) country,year,democ,autoc,polity,polity2 1,Afghanistan ,1800,1,7,-6,-6 2,Afghanistan

Re: [R] Filter data

2010-12-02 Thread Mike Rennie
Try looking at subset()... I typically use this when I'm trying to isolate specific cases from a data frame. Also, Dalgaard's introductory R book has some great examples for parsing data in the manner you're attempting you might want to look at that. Mike On Thu, Dec 2, 2010 at 2:08 PM,

Re: [R] filter data from data frame

2008-02-12 Thread John Kane
?merge Let the data.frame be xx yy - data.frame(ORF= c(YAL026C,YAL041W,YAL048C,YAL007C,YAL012W, YAL016W )) merge(xx,yy, by=ORF) should do it. --- Roberto Olivares Hernandez [EMAIL PROTECTED] wrote: Hi, I have a data frame Y with the following information, ORF

Re: [R] filter data from data frame

2008-02-12 Thread Romain Francois
Hi Roberto, One of these ? Y[ Y$ORF %in% X , ] ORF spectra 3 YAL007C 2 4 YAL012W 8 5 YAL016W 24 11 YAL026C 2 16 YAL041W 4 18 YAL048C 1 subset( Y, ORF %in% X ) ORF spectra 3 YAL007C 2 4 YAL012W 8 5 YAL016W 24 11 YAL026C

[R] filter data from data frame

2008-02-12 Thread Roberto Olivares Hernandez
Hi, I have a data frame Y with the following information, ORF spectra 1 YAL001C 2 2 YAL005C 21 3 YAL007C 2 4 YAL012W 8 5 YAL016W 24 6 YAL019W 3 7 YAL020C 2 8 YAL021C 7 9 YAL022C 3 10 YAL023C 6 11 YAL026C 2 12 YAL029C

[R] filter data from data frame

2008-02-12 Thread Roberto Olivares Hernandez
Hi, I have a data frame Y with the following information, ORF spectra 1 YAL001C 2 2 YAL005C 21 3 YAL007C 2 4 YAL012W 8 5 YAL016W 24 6 YAL019W 3 7 YAL020C 2 8 YAL021C 7 9 YAL022C 3 10 YAL023C 6 11 YAL026C 2 12 YAL029C