#' Calibration values
#'
#' @description Get correction values for signal strength from calibration curves
#'
#' @param projList list, list generated by initProject function
#'
#' @param path_to_data string, path to filtered file
#'
#'
#' @author RadioTracking EU
#'
#' @export
calibrate <- function(projList, path_to_data) {
curve <- data.table::fread(path_to_data)
curve$timestamp <- as.POSIXct(curve$timestamp)
cValues <- calibration_values(curve)
data.table::fwrite(cValues, paste0(projList$path$correction, "/", curve$station[1], "_", as.Date(min(curve$timestamp)), ".csv"))
}
calibration_values <- function(data) {
maxis <- NULL
for (i in unique(as.character(data$receiver))) {
tmp <- subset(data, receiver == i)
maxis <- rbind(maxis, tmp[which.max(tmp$max_signal), ])
}
max_max <- maxis[which.max(maxis$max_signal), ]
maxis <- data.frame(correction = max_max$max_signal - maxis$max_signal, receiver = maxis$receiver, station = maxis$station)
return(maxis)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.