[R] Choosing subset of data.frame

2013-06-20 Thread Katherine Gobin
Dear R Forum I have a data frame as beta_results = data.frame(instrument = c(ABC, DEF, JKL,  LMN, PQR, STU, UVW, XYZ), beta_values = c(1.27, -0.22, 0.529, 0.011, 2.31, -1.08, -2.7, 0.42)) beta_results   instrument beta_values 1    ABC   1.270 2    DEF  -0.220 3    JKL

Re: [R] Choosing subset of data.frame

2013-06-20 Thread andrija djurovic
Hi. Try this: beta_results[beta_results$instrument%in%instru, ] and see help page ?%in% Hope this helps Andrija On Thu, Jun 20, 2013 at 12:45 PM, Katherine Gobin katherine_go...@yahoo.com wrote: Dear R Forum I have a data frame as beta_results = data.frame(instrument = c(ABC, DEF,

Re: [R] Choosing subset of data.frame

2013-06-20 Thread arun
beta_values #3    JKL   0.529 #6    STU  -1.080 #8    XYZ   0.420 A.K. - Original Message - From: Katherine Gobin katherine_go...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Thursday, June 20, 2013 6:45 AM Subject: [R] Choosing subset