R/readmydata.R

Defines functions readMyData

Documented in readMyData

#' Read My Data
#'
#' This function reads a webchip style dataset
#' @keywords data Freq
#' @export


readMyData <- function(datasetname){
	if (datasetname[1] == "")
	{
		return( warning("You haven't named a dataset"))
	}
	if (str_sub(datasetname, -4) != ".rds" ){
		datasetname<-paste0('./data/datasetname',".rds")
	}

	x <- readRDS(datasetname)
	if (is.null(x))
	{
		return(warning("No such data set. Check your spelling."))
	}

	return(x)
}
SOC345/lehmansociology documentation built on Sept. 19, 2017, 9:49 a.m.