R/create_global_thirst_corr.R

Defines functions create_global_thirst_corr

Documented in create_global_thirst_corr

#' @title Correlation ptds and global thirst
#' @param data_ptds dataframe
#' @return
#' @author Aaron Conway
#' @export
#' @importFrom correlation correlation
#' @importFrom forcats fct_rev
#' @importFrom dplyr mutate select

create_global_thirst_corr <- function(data_ptds) {
  data_ptds %>%
    mutate(global = as.numeric(fct_rev(global_thirst_factor))) %>%
    select(ptds, global) %>%
    correlation(method = "kendall")
}
awconway/ptds documentation built on Oct. 20, 2020, 11:05 p.m.