#' Set a custom resighting period
#'
#' @param x A dataframe generated by \code{format_bandedbirds} with columns for ResightDate and FlagID.
#' @param y A dataframe imported to R with columns for ResightDate and ResightPeriod.
#' @return Dataframe with columns for ResightPeriod and FlagID (flag colour and
#' code).
#' @examples
#' custom_period(resight_data, resight_periods)
custom_period <- function(x, y){
resight_data <- merge(x, y,
by = "ResightDate",
all = TRUE) # merges dataframes with flag resights by date and
# survey periods by date to create dataframe of
# flag resights by survey period
resight_data$ResightDate<-NULL # removes ResightDate column
assign("resight_data", resight_data, envir = globalenv()) # sends dataframe back to R environment
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.