Skip to Content

indexing using character vectors

df

 primer exptname concentrate timepoints replicate    day     realConc
    Acan      0hr        55mM          0        b1 011311 0.0002771494
    Actb      0hr        55mM          0        b1 011311 0.0061298654
 Atf7ip2      0hr        55mM          0        b1 011311 0.0015750373
  Atp2c1      0hr        55mM          0        b1 011311 0.0010109867
   Casp6      0hr        55mM          0        b1 011311 0.0035939088
 Col10a1      0hr        55mM          0        b1 011311 0.0133760938
    Acan      0hr        55mM          0        b1 011311 0.0002771494
    Actb      0hr        55mM          0        b1 011311 0.0061298654
 Atf7ip2      0hr        55mM          0        b1 011311 0.0015750373
  Atp2c1      0hr        55mM          0        b1 011311 0.0010109867
   Casp6      0hr        55mM          0        b1 011311 0.0035939088
 Col10a1      0hr        55mM          0        b1 011311 0.0133760938

i Have character vector:

 ges <- c('Acan','Casp6')

I only want rows where $primer == ges

I've tried

df[df$primer == ges,]

but it only returns the first rows which equals these two characters as opposed to all rows in the data frame which equal this

I feel like this is ridiculously simple but I'm messing up somewhere basic

Help a brother out