I ask you about this problem, which I belive it is simple to resolve. I have this object:

```
data<-as.data.frame(data)    
colnames(data)<-c("A", "B", "C")
data

A   B   C
AA  5   6
AB  8   6
DC  5   4    
AD  3   9    
FE  2   8    
AF  4   4    
AG  2   0

```

and moreover I have a list of names:

```
common

AG    
FE    
AD

```

I want to obtain a file in which I find row associated to these names:

```
newdata
A   B   C    
AG  2   0    
FE  2   8    
AD  3   9

```

I try with dplyr R package, using this script, but it does not work.

```
library(dplyr)    
results <- data.frame()    
for (r in 1:nrow(common)) {    
    dat.query3[r] <- filter(data, C == common[r,] )    
    write(dat.query3[r],file="myfile",append=TRUE)    
    df <- data.frame(list(dat.query3[r]))
    newdata <- rbind(results, df)
}

```