Question: Choose specific column from a list of dataframes in Rstudio
0
gravatar for thanos_docp
6 weeks ago by
thanos_docp0 wrote:

Hi everyone, In the last couple of days, I was trying to complete some data analysis for a set of samples I ran a pipeline in Galaxy. I got the tabular file and wrote the R script successfully, getting the lists I wanted to have. https://pasteboard.co/Jm5EFR7.png https://pasteboard.co/Jm5F3BT.png

I was then trying to refine the script by choosing a specific column that worked for dataframe alone

FPKMs$SRR11517725$`Gene ID`

I wonder if there is a different way to express the above script for all the dataframes in my list, something like....

FPKMs[1:8]'Gene ID'

I tried many alternatives but I couldn't find that could work.

rna-seq R • 133 views
ADD COMMENTlink modified 6 weeks ago by genomax90k • written 6 weeks ago by thanos_docp0

Please use: How to add images to a Biostars post

ADD REPLYlink written 6 weeks ago by genomax90k
3
gravatar for RamRS
6 weeks ago by
RamRS30k
Baylor College of Medicine, Houston, TX
RamRS30k wrote:

Use lapply

lapply(FPKM, function(x) x$`Gene ID`)
ADD COMMENTlink written 6 weeks ago by RamRS30k

Thank you so much RamRS.

ADD REPLYlink written 6 weeks ago by thanos_docp0

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one answer if they all work.

Upvote|Bookmark|Accept

ADD REPLYlink written 6 weeks ago by RamRS30k
Please log in to add an answer.

Help
Access

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