Open lgsmith295 opened 4 years ago
try
select(df, starts_with('jan', ignore.case = TRUE))
even better, use rename to standardize names
test <- tibble(FEB=seq(1:5))
rename(test, Feb = starts_with('feb',ignore.case = TRUE))
crashes if more than one column match, though. Example, doesn't work:
test <- tibble(FEB=seq(1:5), feb = seq(6:10))
rename(test, Feb = starts_with('feb',ignore.case = TRUE))
Right now requires very specific column names.
Make helper functions that change colnames to the format required by the function, i.e. check if any colname(climate) match c("jan", "Jan", "january", "January") change it to "1", etc.
Check that "year" col contain 4 digit consecutive integers.