R/read_hayes_plot_data.R

Defines functions read_hayes_plot_data

Documented in read_hayes_plot_data

#' Read in Hayes data from SPSS or R output
#' 
#' @description Wrapper for the `read_hayes_plot_data_spss` and 
#' `read_hayes_plot_data_R` functions that automatically detects
#' the correct function to call. Both functions are currently only supporting
#' models 1 - 3 (i.e. no mediation) as I did not have the time to work on those yet.
#' 
#' @param hayes_data The data object from which to extract the information. Can be 
#' a path to a .txt file (exported from SPSS via copy/paste) or an R object, generated by process
#' for R and saved to a variable using 
#' 
#' @returns A list of class HayesData consisting of the plot_data for visualizing the interaction as well as the various significance 
#' measures from the Hayes SPSS output as well as the model description.
#' 
#' @export

read_hayes_plot_data <- function(hayes_data){
  if (class(hayes_data) == data.frame) read_hayes_plot_data_R(hayes_data)
  else if (class(hayes_data) == "character") read_hayes_plot_data_spss(hayes_data)
}
daaawit/ABOHiwi documentation built on March 23, 2022, 3:27 p.m.