Description Usage Arguments Value Author(s) Examples

This is an internal helper function for extractSamples which extracts numbers from (BayesX log file) strings.

1 | ```
getNumbers(beforeStringsList, stringVector)
``` |

`beforeStringsList` |
The list with the strings standing before the numbers which shall be extracted. |

`stringVector` |
The vector of strings to be searched for the numbers. |

Returns a list with the extracted numbers.

Daniel Sabanes Bove

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
## create a nice example
sampleStrings <- c("Second: 385",
" First: 70000 ",
"asdfkf T: 24 ")
## test the function
extractedNumbers <- BayesX:::getNumbers(beforeStringsList=
list(first="First:",
second="Second:",
third="T:"),
stringVector=sampleStrings)
## and assert that the result is as expected
stopifnot(identical(extractedNumbers,
list(first=70000, second=385, third=24)))
## specific test
stopifnot(identical(BayesX:::getNumbers(beforeStringsList=
list(Iterations = "Number of iterations:"),
stringVector=
" Number of iterations: 70000 "),
list(Iterations=70000)))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.