The whole point of dplyr primitives is to support data frames... that is, lists of columns. When you pare your data frame down to one column you are almost certainly using the wrong tool for the job.
So, sure, your code works... and it even does what you wanted in the dplyr style, but what a pointless exercise. grep( "a", mytbl$file, value=TRUE ) On August 19, 2020 7:56:32 AM PDT, Ivan Calandra <calan...@rgzm.de> wrote: >Dear useRs, > >I'm new to the tidyverse world and I need some help on basic things. > >I have the following tibble: >mytbl <- structure(list(files = c("a", "b", "c", "d", "e", "f"), prop = >1:6), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame")) > >I want to subset the rows with "a" in the column "files", and keep only >that column. > >So I did: >myfile <- mytbl %>% > filter(grepl("a", files)) %>% > select(files) > >It works, but I believe there must be an easier way to combine filter() >and select(), right? > >Thank you! >Ivan -- Sent from my phone. Please excuse my brevity. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.