Created
April 16, 2021 00:43
-
-
Save juanchiem/3e0aba102fb2d595d1a3629be2638264 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dat <- readxl::read_excel("data/balcarce_clima.xlsx") | |
| dat <- dat %>% | |
| mutate(year = lubridate::year(date)) %>% | |
| select(year, everything()) | |
| library(openxlsx) | |
| your_df_list <- dat %>% split(dat$year) | |
| wb <- createWorkbook() | |
| for (i in 1:length(your_df_list)) { | |
| addWorksheet(wb, sheetName=names(your_df_list[i])) | |
| writeData(wb, sheet=names(your_df_list[i]), x=your_df_list[[i]]) # Note [[]] | |
| } | |
| saveWorkbook(wb, "data/meteo_eea.xlsx", overwrite = TRUE) | |
| drive_upload(path = as_dribble("Meteo Balcarce"), "data/meteo_eea.xlsx", overwrite = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment