R/basic_functions.r

Defines functions calc_geo rescale

##%######################################################%##
#                                                          #
####                  small functions                   ####
#                                                          #
##%######################################################%##


# function to calculate the geometric mean
calc_geo <- function(x){
  exp(mean(log(x), na.rm = TRUE))
}


# function to rescale posterior geomean values
rescale <- function(x){

  multipier <- 100/x[1]
  rescaled <- x*multipier
  return(rescaled)
}
CharlieOuthwaite/UKBiodiversity documentation built on Jan. 24, 2020, 12:45 p.m.