Sorry it's a typing error, and I mistakenly posted twice
I have a csv file and I would like to extract the value of it with specific range for example; F>2 & F<2 & P=1, and then write the result to csv file.
I tried the code bellow but , it does not work?
FCPval <- read.csv("C:/Users/shawin/Desktop/RProgramms/RAdipose/FCPval.csv")
c=as.data.frame(FCPval)
for (i in 1:rowN){if (C$F[i] >= 2 && C$F[i]<=-2&& C$p[i]<=3){
dfrmPFC=data.frame(Fc=FC,p=p)}
}
The error is:
Error in C$FC : object of type 'closure' is not subsettable
2 answers
It seems this is a duplicate post (Extracting column value from csv file according to if else and & operator ), you should probably remove one or the other :S
Also it's not really a bioinformatics question but more an R problem. But it seems you are not consistently using capital and small letters, you created a data.frame named c but you want to access it using C for example or have a column Fc and then try to call $F... Maybe you should do a small R tutorial first before trying to do anything.
Grtz!
R is case sensitive, so c and C are different. Also, the code you showed will never produce the error you wrote. Finally, help(subset).
Log in to answer this question.
Hello shawinkarim!
We believe that this post does not fit the main topic of this site.
Basic R programming question (it's a typo)
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!