I'm trying to get subset of my data in R by row names, but I'm getting flowing error.
mydata
is my main data file and I want just get subset of it by row names.
what I tried is :
data<-mydata[c("hsa-miR-150" , "hsa-miR-16" , "hsa-miR-192" , ..`enter code here`.. )]
and I got : error: unexpected string constant in "sa-miR-16" , "hsa-miR-192" ,....
also I tried this :
attributes(Arow)
$levels
[1] "hsa-miR-150" "hsa-miR-16" "hsa-miR-192" "hsa-miR-194" "hsa-miR-19a"
[6] "hsa-miR-19b" "hsa-miR-22"
> p<-matrix(nrow=16, ncol=1)
> p<-matrix(nrow=16, ncol=1, Arow)
> y<-mydata[p]
> dim(y)
>NULL
moreover, even this simple code didn't work for me !:
y<-c("hsa-miR-150" , "hsa-miR-16" , "hsa-miR-192" , "hsa-miR-194" , "hsa-miR-19a", "hsa-miR-19b" , "hsa-miR-22" , "hsa-miR-223" , "hsa-miR-23a" ,"hsa-miR-23b" ,"hsa-miR-25" , "hsa-miR-30b" ,"hsa-miR-30c" , "hsa-miR-425" , "hsa-miR-486-5p" "hsa-miR-92a" )
Error: unexpected string constant in "sa-miR-16" , "hsa-miR-192" , "hsa-miR-194" , "hsa-miR-19a",
Can somebody tell me, what's going wrong here?! and what should I do ?