R/fct_app_server.R

Defines functions production.or.development.environment read.in.dataset

#' app_server 
#'
#' @description A fct function
#'
#' @return The return value, if any, from executing the function.
#'
#' @noRd
read.in.dataset <- function( dataset_path, method = c("data.table", "RData", "feather", "rds", "Prsice")){
  if( method == "data.table"){
    data.table::fread( dataset_path)
  } else if( method == "RData"){
    base::mget( load(dataset_path))
  } else if( method == "feather"){
    feather::read_feather(dataset_path)
  } else if( method == "rds"){
    base::readRDS( dataset_path)
  } else if( method == "https_RData"){
    base::mget( load( gzcon( url(dataset_path))))
  } else if( method == "Prsice"){
    NULL
  }
}

# Get the location of where the app is located
production.or.development.environment <- function(){
  in_production <- golem::get_golem_options("app_production")
  return(in_production)
}
  
johnhubertjj/PRSent documentation built on Dec. 21, 2021, 2:13 a.m.