Another simple question using DPLYR

If I have a dataframe read in using openxls it will contain over 30 columns

How do I filter using dplyr by columns A to H ie use only those columns

Thanks

 df %>% 
   select(1:8)

This should select the first 8 columns.

Or if you want to do it by name:

df %>%
  select(name_of_1st_col:name_of_8th_col)

Or both:

df %>%
  select(1:name_of_8th_col)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.