Mercurial > repos > iuc > ggplot2_violin
diff utils.r @ 12:63d211052ffb draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ggplot2 commit 57b86418a4f032a5664b8dc1c9585a11be629158
author | iuc |
---|---|
date | Thu, 15 May 2025 13:02:07 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utils.r Thu May 15 13:02:07 2025 +0000 @@ -0,0 +1,13 @@ +# Function for the data input +load_data <- function(file_name, file_extension) { + if (file_extension == "csv") { + data_input <- read.csv(file_name, check.names = "false") + } else if (file_extension %in% c("tsv", "txt", "tabular")) { + data_input <- read.delim(file_name, sep = "\t", check.names = "false") + } else if (file_extension == "parquet") { + data_input <- arrow::read_parquet(file_name) + } else { + stop("Unsupported file format.") + } + return(data_input) +}