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
| # set up | |
| pak::pak("YODAdam/ClimSeasonR") | |
| library(tidyverse) | |
| library(ClimSeasonR) | |
| # read and clean daily data for multiple stations | |
| data<-readxl::read_excel("~/Downloads/rain.xls",skip = 2) %>% | |
| janitor::clean_names() | |
| # compute season length, for a set of stations |
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
| #' Round to a given multiple | |
| #' | |
| #' @param x Numeric scalar or vector. | |
| #' @param to Target multiple. Default: `5`. | |
| #' @param direction Rounding direction: `"nearest"` (default), `"up"`, or | |
| #' `"down"`. | |
| #' | |
| #' @return Numeric vector rounded to the nearest multiple of `to`. | |
| #' @export | |
| #' |
OlderNewer