This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Choose specific column from a list of dataframes in Rstudio

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.

r rna-seq

1 answer

Use lapply

lapply(FPKM, function(x) x$`Gene ID`)

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

Log in to answer this question.