View source: R/hurdle-methods.R
| plot_subject | R Documentation |
Creates a demand curve plot for a single subject with optional observed data and population reference curve.
plot_subject(
object,
subject_id,
prices = NULL,
show_data = TRUE,
show_population = TRUE,
style = c("modern", "apa")
)
object |
An object of class |
subject_id |
The ID of the subject to plot. |
prices |
Numeric vector of prices for plotting. If |
show_data |
Logical; if |
show_population |
Logical; if |
style |
Plot styling, passed to |
A ggplot2 object.
data(apt)
fit <- fit_demand_hurdle(apt, y_var = "y", x_var = "x", id_var = "id")
plot_subject(fit, subject_id = "19")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.