R/plot_APChexamap_helpers.R

Defines functions compute_yCoordinate compute_xCoordinate

Documented in compute_xCoordinate compute_yCoordinate

#' Internal helper to tilt the x-axis for the hexamap plot
#' 
#' Internal helper function to be called in \code{\link{plot_APChexamap}},
#' to tilt the x-axis for the hexamap plot.
#' 
#' @param period_vec Numeric vector of period values.
#' 
compute_xCoordinate <- function(period_vec) {
  x <- period_vec * sqrt(3) / 2
  return(x)
}



#' Internal helper to tilt the x-axis for the hexamap plot
#' 
#' Internal helper function to be called in \code{\link{plot_APChexamap}},
#' to tilt the x-axis for the hexamap plot.
#' 
#' @param period_vec Numeric vector of period values.
#' @param age_vec Numeric vector of age values.
#' 
compute_yCoordinate <- function(period_vec, age_vec){
  y <- age_vec - period_vec / 2
  return(y)
}

Try the APCtools package in your browser

Any scripts or data that you put into this service are public.

APCtools documentation built on Jan. 14, 2023, 1:15 a.m.