R/getNumbers.R

Defines functions getNumbers

Documented in getNumbers

## Author: Daniel Sabanes Bove [daniel *.* sabanesbove *a*t* campus *.* lmu *.*
## de] Time-stamp: <[getNumbers.R] by DSB Die 07/07/2009 14:49 (CEST)>
## Description: Internal helper function for extractSamples, which extracts
## numbers from (BayesX log file) strings.
getNumbers <- function(beforeStringsList, stringVector) {
  lapply(beforeStringsList, function(string) as.numeric(sub(pattern = ".+[[:blank:]]+([[:digit:]]+)[[:blank:]]*$", 
    replacement = "\\1", x = stringVector[grep(pattern = paste(".*", string, 
      sep = ""), x = stringVector)])))
}

Try the BayesX package in your browser

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

BayesX documentation built on Oct. 20, 2023, 9:11 a.m.