[d9ee58]: / R / input.R

Download this file

15 lines (12 with data), 497 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#' Convert centres_df to more useable format
#' @param centres_df Dataframe with columns site, start_month, mean_rate,
#' region and site_cap
#' @return Dataframe with start_week, ordered by start_month and site
#'
do_clean_centres <- function(centres_df) {
# Get start weeks
centres_df$start_week <- get_weeks(centres_df$start_month - 1) + 1
# Order centres_df by start month and site number
centres_df <- centres_df[with(centres_df, order(start_week, site)), ]
return(centres_df)
}