diff --git a/README.Rmd b/README.Rmd index 2d49fa1..8cc1306 100644 --- a/README.Rmd +++ b/README.Rmd @@ -54,7 +54,7 @@ using the package. Let's first generate some data: library(netidmtpreg) library(tidyverse) -n_ind <- 1e2 # number of simulated individuals +n_ind <- 5e2 # number of simulated individuals # Generate exponentially distributed event times without censoring synth_idm_data <- generate_uncensored_ind_exp_idm_data( @@ -121,10 +121,10 @@ future::plan("sequential") # close the multisession, see future's documentation We obtain a `TPreg` object with a dedicated plotting method using ggplot: ```{r plot} -plot(net_estimate) + ggplot2::coord_cartesian(ylim = c(-5, 5)) +plot(net_estimate) + ggplot2::coord_cartesian(ylim = c(-5, 5), clip = "off") ``` -*Warning: note the use of `ggplot2::coord_cartesian` instead of `ggplot2::ylim`. +*Warning: note the use of `ggplot2::coord_cartesian` with `clip="off"` instead of `ggplot2::ylim`. The former acts as a "zoom" command, while the latter acts as a filter on input data, and as such might prevent display of large confidence intervals.* @@ -171,7 +171,7 @@ set the linetype accordingly. autoplot(net_estimate, model = "Net estimate") + autolayer(crude_estimate, model = "Crude estimate") + autolayer(truth_estimate, model = "Ground Truth") + - ggplot2::coord_cartesian(ylim = c(-5, 5)) + ggplot2::coord_cartesian(ylim = c(-5, 5), xlim = c(0, 2), clip = "off") ``` These automated plotting routines are designed for quick inspection of the model. diff --git a/README.md b/README.md index 87b8d40..0bf50e4 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ library(tidyverse) #> ✖ dplyr::lag() masks stats::lag() #> ℹ Use the conflicted package () to force all conflicts to become errors -n_ind <- 1e2 # number of simulated individuals +n_ind <- 5e2 # number of simulated individuals # Generate exponentially distributed event times without censoring synth_idm_data <- generate_uncensored_ind_exp_idm_data( @@ -127,17 +127,17 @@ We obtain a `TPreg` object with a dedicated plotting method using ggplot: ``` r -plot(net_estimate) + ggplot2::coord_cartesian(ylim = c(-5, 5)) +plot(net_estimate) + ggplot2::coord_cartesian(ylim = c(-5, 5), clip = "off") #> Warning: Removed 1 row containing missing values or values outside the scale range #> (`geom_line()`). ``` -*Warning: note the use of `ggplot2::coord_cartesian` instead of -`ggplot2::ylim`. The former acts as a “zoom” command, while the latter -acts as a filter on input data, and as such might prevent display of -large confidence intervals.* +*Warning: note the use of `ggplot2::coord_cartesian` with `clip="off"` +instead of `ggplot2::ylim`. The former acts as a “zoom” command, while +the latter acts as a filter on input data, and as such might prevent +display of large confidence intervals.* The obtained TPreg plots are composable ggplot objects that can be combined. Let’s use this to compare our results with: 1) what would have @@ -186,7 +186,7 @@ automatically set the linetype accordingly. autoplot(net_estimate, model = "Net estimate") + autolayer(crude_estimate, model = "Crude estimate") + autolayer(truth_estimate, model = "Ground Truth") + - ggplot2::coord_cartesian(ylim = c(-5, 5)) + ggplot2::coord_cartesian(ylim = c(-5, 5), xlim = c(0, 2), clip = "off") #> Warning: Removed 1 row containing missing values or values outside the scale range #> (`geom_line()`). #> Removed 1 row containing missing values or values outside the scale range diff --git a/man/figures/README-plot-1.png b/man/figures/README-plot-1.png index 236032e..ec2c5a7 100644 Binary files a/man/figures/README-plot-1.png and b/man/figures/README-plot-1.png differ diff --git a/man/figures/README-plot_compare-1.png b/man/figures/README-plot_compare-1.png index 4cecd98..53b1dbf 100644 Binary files a/man/figures/README-plot_compare-1.png and b/man/figures/README-plot_compare-1.png differ