Skip to content

Too many columns for dplyr::select? #1368

Answered by kubu4
sr320 asked this question in Q&A
Jan 22, 2022 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Came up with a better solution!

The trick is to create a newline-delimited text file with your list of columns. Then, read the text file into a vector using readlines().

## Read in newline-delimited list of gene names
gene.selection <- readLines("~/Downloads/genes_of_interest.txt")

## Select genes of interest from fpkm data frame
select.treat <- fpkm %>% select(all_of(gene.selection))

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@kubu4
Comment options

@kubu4
Comment options

Comment options

sr320
Jan 23, 2022
Maintainer Author

You must be logged in to vote
1 reply
@kubu4
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sr320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
R code Any and all computer "coding" issues.
2 participants