Question: (Closed) Extracting value from csv file with condition using if else and & operator
0
gravatar for shawin
4.0 years ago by
shawin10
United Kingdom
shawin10 wrote:

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

forum R • 2.5k views
ADD COMMENTlink modified 4.0 years ago by Devon Ryan91k • written 4.0 years ago by shawin10

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!

ADD REPLYlink written 4.0 years ago by Michael Dondrup46k
0
gravatar for Lesley Sitter
4.0 years ago by
Lesley Sitter460
Netherlands
Lesley Sitter460 wrote:

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!

ADD COMMENTlink written 4.0 years ago by Lesley Sitter460

sorry its typing error , and i mistakenly  posted twice 

ADD REPLYlink written 4.0 years ago by shawin10
0
gravatar for Devon Ryan
4.0 years ago by
Devon Ryan91k
Freiburg, Germany
Devon Ryan91k wrote:

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).

ADD COMMENTlink written 4.0 years ago by Devon Ryan91k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1519 users visited in the last hour