R/data.subset.R

# this function is not efficient if data is huge
# will optimize it later
data.subset <- function(data, subset, options){
  
  if(!is.null(subset)){
    subset <- intersect(subset, 1:nrow(data))
    if(length(subset) > 0){
      data <- data[subset, ]
    }else{
      msg <- "No data left. Check subset"
      if(options$print) message(msg)
    }
  }
  
  data
  
}

Try the ARTP2 package in your browser

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

ARTP2 documentation built on May 2, 2019, 3:38 p.m.