I am working on an assignment where we are only allowed to used Dplyr in R. We have to print the first 4 columns and the last 4 columns with customers that have 10 or less Open Accounts. So far I have the following
OpenAccount <- filter(loans,OpenAccounts < 10,)
however, I am not sure how to only include the first four columns and the last 4 columns.
We can use select
library(dplyr)
OpenAccount %>%
select(head(names(.), 4), tail(names(.), 4))
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments