#' Function that makes prompts to read in manifest files for openSpecimen
#'
#' @export
#'
#' @return A dataframe with the manifest file
#'
#' @examples
#' df <- readData()
readData <- function(){
require(readxl)
require(readr)
data_loc <- readline("Where is the location of the data? ex: (/dcs01/static/data_sheet.xlsx) ")
data_type <- readline("Is the extension xlsx or csv? ")
if(data_type == 'xlsx'){
df <- read_excel(data_loc)
} else if(data_type == 'csv'){
df <- read_csv(data_loc)
} else{
print('invalid data type entered')
}
print(paste('Data type:', data_type))
print(paste('Data location:', data_loc))
return(as.data.frame(df))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.