R/load_example_data.R

Defines functions load_example_data

Documented in load_example_data

#' Load example DESeq2 data into the environment
#'
#' @param example.type Name of the example to load. Options: sirna, mirna
#' @return Loads either the Schlegel 2022 RNAseq data or miRDB into the environment.
#' @export
#'
#' @examplesIf interactive()
#' load_example_data()
load_example_data <- function(example.type){
  data.path = tempdir()

  sirna.path = paste0(data.path, "/Schlegel_2022.Rdata")
  mirna.path = paste0(data.path, "/mirdb.Rdata")

  if (example.type == "sirna") {
         ex.data = load(sirna.path)

         return(mget(ex.data))

    } else if (example.type == "mirna") {
         ex.data = load(mirna.path)

         return(get(ex.data))

    } else {
      stop("Invalid option. Options: sirna, mirna")
    }
}

Try the SeedMatchR package in your browser

Any scripts or data that you put into this service are public.

SeedMatchR documentation built on Oct. 25, 2023, 1:08 a.m.