View source: R/mcmcInternals.R
makeBUGSFriendlyNames | R Documentation |
R is quite permissive with variables names and not all variable names allowed by R will result in functioning BUGS code. NIMBLE uses a dialect of BUGS and so this function will automatically convert variables names such that they can be interpreted correctly
makeBUGSFriendlyNames(inNames, warnType = NA, allowLeadingUnderscore = FALSE)
inNames |
A character vector of variable names to ensure are BUGS-compliant |
warnType |
A character scalar denoting whether to produce feedback to
the user if the variable names provided in |
allowLeadingUnderscore |
A logical scalar denoting whether leading
undercores are allowed in the name. This is usually not acceptable naming
convention (hence the default to |
A character vector of BUGS-compliant variable names
Joseph D. Chipperfield, joechip90@googlemail.com
nimbleCode
# A mixture of variable names
inputNames <- c(
"aGoodVariableName1", "aGoodVariableName2", # Compliant names
"1aBadVariableName", "aBadVariableName{2}" # Non-compliant names
)
outputNames <- makeBUGSFriendlyNames(inputNames, "message")
# outputNames now contains compliant conversions of the non-compliant names
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.