R/parseRowNumber.R

#' Extracts the row id number from the id string to delete individual rows
#' 
#' @param idstr the id string formated as id_INDEX
#' @return INDEX from the id string id_INDEX
#' @keywords internal
#' 
parseRowNumber <- function (idstr) {
  res <- as.integer (
    sub (
      pattern =".*_([0-9]+)", 
      replacement = "\\1", 
      x = idstr))
  
  if (! is.na (res)) 
    res
}

Try the wiad package in your browser

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

wiad documentation built on Feb. 12, 2021, 5:06 p.m.