check.nbasis.poly <- function(x, nbasis) {
# check if the values of the polynomial basis expansion will
# exceed R's floating point abilities (i.e. max(x)^nbasis is too large)
nbasis.max <- floor(logb(.Machine$double.xmax, base = max(abs(x))))
if (nbasis > nbasis.max) {
warning(
paste0("Warning in check.nbasis.poly(): ",
"Basis dimension implies expansion values too ",
"large for R's floating-point arithmetic. ",
"Setting nbasis = ", nbasis.max, ".")
)
nbasis <- nbasis.max
}
nbasis
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.