ices-eg / wg_WGEEL

Joint EIFAAC/ICES/GFCM Working Group on Eels
http://ices.dk/community/groups/Pages/WGEEL.aspx
5 stars 16 forks source link

Annex 10: instead of using col_types in read_xls use mutate(any_of #245

Closed elfunesto closed 2 years ago

elfunesto commented 2 years ago

Currently in annex 10, we specify columns and coltypes and use it in read_xls, but we as soon as the template change, we break the fucntion. It would be better to use something like

data_xls <- data_xls %>%
mutate(across(any_of(columns[col_types=="numeric"]),~as.numeric(.x))

... Since any_of is more flexible

elfunesto commented 2 years ago

this can be used for other annexes