R/read_numpy.R

Defines functions read_numpy

Documented in read_numpy

#' Read a numpy (python) data array into R
#'
#' @param filename  Filename for the numpy (.npy) file
#' @export
#' @examples
#' \dontrun{
#' r_ecg <- read_numpy("digital_ecgs.npy")
#' }
read_numpy <- function(filename) {
  ## load the numpy object
  np <- reticulate::import("numpy", convert=T) #Python's number library
  rawdata<- np$load(filename)
  return(rawdata)
}
rickeycarter/easyRecg documentation built on Dec. 22, 2021, 4:09 p.m.