R/S7.printHierarchyTree.R

Defines functions S7.printHierarchyTree

#' @export

S7.printHierarchyTree <- function(fileName='D6.treeAll_2010.rds'){

startTime <- Sys.time()

old <- options(stringsAsFactors = FALSE)
on.exit(options(old), add = TRUE)

# Load Data -------------------------------------------------------------------

path.local <- try(rprojroot::find_rstudio_root_file(), silent=TRUE)

if(class(path.local) == 'try-error'){
  path.local <- getwd()
} else{}

if(!file.exists(paste(path.local, "/data_beerConsumptionBrandChoice/", fileName, sep=""))) {

  stop("file does not exist in project directory. Run Script 6
       (S6.hierarchyTree.R) to generate the file called:
       D6.treeStudy_2010_X.rds")

} else{

  readRDS(paste(path.local, "/data_beerConsumptionBrandChoice/", fileName, sep=""))

}
}
malooney/beerConsumptionBrandChoice documentation built on May 23, 2019, 2:48 p.m.