Description Usage Arguments Value Author(s) See Also Examples
View source: R/construct_gam_formula.R
Takes a number for the spline basis_vec value and pastes it together with character strings giving the parts of the formula before and after the basis_vec number, then returns the pasted string as a formula. This utility function circumvents some specific function scope issues that arise when fitting the gam model with a passed parameter number of basis_vecs.
1 2 3 4 5 | construct_gam_formula(
basis_vecs_value = -1,
before_basis_vecs_value = "y ~ group + s( x, bs = \"tp\", k =",
after_basis_vecs_value = ", by = group )"
)
|
basis_vecs_value |
numeric integer value to be used for number basis_vecs. |
before_basis_vecs_value |
character string with the gam formula before the basis_vec number. |
after_basis_vecs_value |
character string with the gam formula after the basis_vec number. |
a formula object that can be passed to gamm4::gamm4(), which calls mgcv::gam().
Bill Forrest forrest@gene.com
1 2 3 4 5 | ## avoid a ':::'-related warning in package check by not running next lines:
## Not run:
test_gam_formula <- maeve:::construct_gam_formula( 6 )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.