To select a subset of columns in a dataframe in R, there are several ways, but the most straight-forward way is using R's subset function.
Subset lets you pass the dataframe as the first argument, and then use the select= keyword and pass a list of column names.
Helpful links
https://www.rdocumentation.org/packag...