mcp_example | R Documentation |
Get example models and data
mcp_example(name, sample = FALSE)
name |
Name of the example. One of:
|
sample |
TRUE (run |
List with
model
: A list of formulas
data
: The simulated data
simulated
: The parameters used for simulating the data.
fit
: an mcpfit
if sample = TRUE
,
call
: the code to run the above.
Jonas Kristoffer Lindeløv jonas@lindeloev.dk
ex = mcp_example("demo")
plot(ex$data) # Plot data
print(ex$simulated) # See true parameters used to simulate
print(ex$call) # See how the data was simulated
# Fit the model. Either...
fit = mcp(ex$model, ex$data)
plot(fit)
ex_with_fit = mcp_example("demo", sample = TRUE)
plot(ex_with_fit$fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.