View source: R/lifetable_export.R
| lifeTable_export | R Documentation |
Writes all results of one data set into a multi-sheet 'Excel' workbook
(<file name>_out.xlsx): the population parameters, the
age-stage survival rates, the age-specific rates and, optionally, the
survival curve plot.
lifeTable_export(
lt,
results,
output_path = getwd(),
plot = NULL,
keep_tiff = FALSE,
dpi = 300
)
lt |
A |
results |
The result list returned by
|
output_path |
Character; folder the workbook is written to. Defaults to the current working directory. |
plot |
A ggplot object (usually from |
keep_tiff |
Logical; whether to keep the standalone tiff file
next to the workbook in addition to the copy embedded in it. Default
|
dpi |
Numeric; resolution of the exported image (default 300). |
The tiff is written through the internal lt_ggsave(),
which enables 'showtext' for the export device and pins the 'showtext'
internal dpi to the value the text sizes of lifeTable_plot
are calibrated for. The exported figure therefore looks the same in
every R session, no matter what 'showtext' settings are left over in
the session. If the reproduction-related parameters were skipped
(fecundity = FALSE in lifeTable_calculate_all),
the corresponding values in the Summary sheet are NA and the
sheets "Female fecundity (F_xj)" and "Age-specific fecundity (m_x)"
are omitted. If bootstrap results are attached
(results$boot <- lifeTable_bootstrap(lt); done automatically
by lifeTable_analyze and
lifeTable_calculate when bootstrap = TRUE), an
extra worksheet "Bootstrap (SE & CI)" with the parameter table
(original estimate, bootstrap mean, standard error, percentile
confidence interval) is written.
The path of the exported xlsx file (invisibly).
lifeTable_calculate, lifeTable_plot
f <- system.file("extdata", "lifetable_example.csv", package = "insectecol")
lt <- lifeTable_read(f)
results <- lifeTable_calculate_all(lt)
lifeTable_export(lt, results, tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.