R/write.wtd.pctiles.R

Defines functions write.wtd.pctiles

Documented in write.wtd.pctiles

#' @title create lookup table as file of pop-weighted percentiles, mean, std.dev
#'
#' @param mydf data.frame with numeric data. Each column will be examined to calculate mean, sd, and percentiles
#' @param wts vector of numbers such as population counts as weights, as long as nrow(mydf)
#' @param filename prefix to use for filename to be saved locally
#' @examples
#'   \dontrun{
#'   write.wtd.pctiles(bg22[ , names.e], wts = bg22$pop, filename = 'envt-data')
#'   }
#'
#' @export
write.wtd.pctiles <- function(mydf, wts, filename) {

  write.wtd.pctiles.by.zone(mydf=mydf, wts=wts, filename=filename)
  # FUNCTION TO WRITE CSV FILE WITH PERCENTILES AND MEAN, AND MAYBE STD DEVIATION,
  # LIKE A LOOKUP TABLE
   # Example of usage:  write.wtd.pctiles(bg22[ , names.e], bg22$pop, 'envt-data')
}
ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.