dplyr filter() problems

Asked

Viewed 145 times

0

Hi, guys.

Well, I went to try to replicate a code I made on the work computer on my notebook. At some point, I do a data filtering with the dplyr using the signals "<" and ">". When I made the code in my notebook, the filtering didn’t work, it takes all the values. The data is like this:

inserir a descrição da imagem aqui

The code goes like this:

pilo12h<-piloexpression %>% select(GeneSymbol,FC12h,QV12h) %>% filter(FC12h>1.5 , QV12h< 0.01)

The problem is that it is selecting from Qv12h higher than 0.01, being that I only want the smaller ones than that, which are the significant ones for me. I use that same code on the work computer, and it works perfectly.

  • 3

    Welcome to the Portuguese SOF Lukas! To help people who want to help you, take a look at this link which details how we can ask a reproducible question. Your question is quite broad, how about starting by sharing a piece of the data (dput(head(data, 20)) and the function you used?

  • See if this link helps you: https://answall.com/questions/328859/como-divider-os-dataframes-de-lista-com-base-base-uma-vari%C3%A1vel-de-common-group

  • Edit your question and enter the code you are using. This way it will be easier to try to reproduce your problem

  • Guys, I figured out the mistake. I don’t know why, but R was importing my data as Character, down to the numbers. So I gave this error when filtering the values. I solved this by importing the data as . xls, instead of . csv, as I was doing. Thanks for the help, ;)

  • 1

    You can import as csv but use argument stringsAsFactors = FALSE of function read.csv.

1 answer

0

Reply by @Lukais Iohan Carvalho:

"Guys, I figured out the mistake. I don’t know why, but R was importing my data as Character, down to the numbers. So I gave this error when filtering the values. I solved this by importing the data as . xls, instead of . csv, as I was doing. Thanks for the help, ;) "

Browser other questions tagged

You are not signed in. Login or sign up in order to post.