Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marcos Lancia
    Member
    • Apr 2015
    • 31

    #16
    Ok, my table is ready. Now, my problem is that I have non-numerical data in my columns. How can I avoid that? For example,
    plot(data$log2.FC.transcriptome., data$log2.FC.translatome.)

    In min(x) : no non-missing arguments to min; returning Inf

    Comment

    • blancha
      Senior Member
      • May 2013
      • 367

      #17
      As always, there are many ways, and many subtleties.
      If you've been using read.csv, I would recommend that you add the argument stringsAsFactors=FALSE.
      You don't need to bother with fread, which won't treat strings as factors.

      I'll just post two ways to do the filtering, supposing that you know the strings that you want to filter out.
      I'll have to get back to work on my own script then.
      There is an older, more conventional method, but dplyr has many advantages.

      Code:
      library(dplyr)
      data.filtered <- data %>% filter(log2.FC.transcriptome. != "Inf" & log2.FC.transcriptome. != "-Inf" & log2.FC.translatome. != "Inf" & log2.FC.translatome. != "-Inf")
      Older method
      Code:
      data.filtered <- data[data$log2.FC.transcriptome. != "Inf" & data$log2.FC.transcriptome. != "-Inf" & data$log2.FC.translatome. != "Inf" & data$log2.FC.translatome. != "-Inf", ]
      Sorry, I really have to go and finish my own script now.

      Comment

      • Marcos Lancia
        Member
        • Apr 2015
        • 31

        #18
        Ok, thanks so much for your time. You helped me so much. If you can read this, there's a problem with the %>%.
        Error: could not find function "%>%"

        The 2nd option you gave me deleted all data. The table is empty after that command.

        Comment

        • blancha
          Senior Member
          • May 2013
          • 367

          #19
          The "%>%" forward-pipe operator comes with dplyr.
          Either you haven't loaded the dplyr package, or you made a mistake writing the operator.
          It's just the greater sign in between two percentage sign, so the second mistake is less likely.
          Just make sure you've installed dplyr and loaded the package before using "%>%".

          Code:
          install.packages("dplyr")
          library(dplyr)

          For the problems you're experiencing with the more conventional filtering step, I'm not sure what the problem could be.
          I don't see any typos in my command, but there could always be a mistake on my part.
          The best troubleshooting step is always to simplify the command.
          Try just one filtering step at the time.

          Code:
          data.filtered <- data[data$log2.FC.transcriptome. != "Inf", ]
          I'm going to stop procrastinating now by spending time on seqanswers, and actually finish my own R script.

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, Yesterday, 11:13 AM
          0 responses
          16 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, Yesterday, 10:48 AM
          0 responses
          17 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          35 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          42 views
          0 reactions
          Last Post SEQadmin2  
          Working...