Skip to content

Commit

Permalink
Adding more.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmueller18 committed Jan 12, 2025
1 parent 3eabfff commit 1c6139b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vignettes/mortAAR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

mortAAR is supposed to ease the import and display of archaeological life table data as well as to offer more advanced functions. The general idea behind life tables and the implementation in mortAAR is explained in the vignette("background"). This introduction gets you started with the import of different data sets, the computation of life tables and finally the plotting of life tables.
**mortAAR** is supposed to ease the import and display of archaeological life table data as well as to offer more advanced functions. The general idea behind life tables and the implementation in mortAAR is explained in the `vignette("background")`. This introduction gets you started with the import of different data sets, the computation of life tables and finally the plotting of life tables.

## Import of data

The import of data is controlled by the function mortAAR::prep.life.tabe(). In most cases, the data set will contain one row per individual with the respective age ranges, similar to the example of the cemetery of Nitra.
The import of data is controlled by the function `prep.life.tabe()`. In most cases, the data set will contain one row per individual with the respective age ranges, similar to the example of the cemetery of Nitra.

```{r, message=FALSE}
library(mortAAR)
Expand All @@ -34,7 +34,7 @@ In this case, the column with the number of deceased (`dec`) has to be named and

## Displaying the life table

If the data has been prepared as above, it is easy to generate a life table with the command mortAAR::life.table().
If the data has been prepared as above, it is easy to generate a life table with the command `life.table()`.

```{r, message=FALSE}
mortAAR::life.table(aiterhofen_prep)
Expand All @@ -49,7 +49,7 @@ nitra_lt

## Plotting the results

A complete set of all indices of the life table is generated with the command mortAAR::plot(). The lines of the groups (if specified) are displayed as line types (default) or with different colours.
A complete set of all indices of the life table is generated with the command `plot()`. The lines of the groups (if specified) are displayed as line types (default) or with different colours.

```{r, message=FALSE}
plot(nitra_lt, line_vis = "colour")
Expand All @@ -61,7 +61,7 @@ It is, of course, also possible to address the life tables individually to only
plot(nitra_lt$All, display = "dx")
```

If more control is desired, for example to create customized plots in ggplot2::ggplot(), this is also possible. The following takes the life tables from the Nitra example and creates a ggplot diagram with combinations of line types and colours. Please note how the x-axis is created with the column "a" from the life table which contains the length of each age class.
If more control is desired, for example to create customized plots in `ggplot2::ggplot()`, this is also possible. The following takes the life tables from the Nitra example and creates a ggplot diagram with combinations of line types and colours. Please note how the x-axis is created with the column `a` from the life table which contains the length of each age class.

```{r, message=FALSE}
library(ggplot2)
Expand All @@ -78,6 +78,6 @@ ggplot(nitra_lt$All, aes(x=c(0,cumsum(a)[-nrow(nitra_lt$All)]), y=dx)) +

## Going further

Hopefully, the above has succeeded in giving an overview how to use the basic functions of mortAAR. Two further worked examples can be found in the vignette("example_1") and vignette("example_2"). The former deals especially with data preparation while the latter also covers the use case to combine two life tables in a joined analysis.
Hopefully, the above has succeeded in giving an overview how to use the basic functions of mortAAR. Two further worked examples can be found in the `vignette("example_1")` and `vignette("example_2")`. The former deals especially with data preparation while the latter also covers the use case to combine two life tables in a joined analysis.

More advanced functions of mortAAR deal with testing the representativeness and the subsequent correction of life tables (explained in the vignette("lt_correction") as well as the computation of reproduction indices (vignette("reproduction")).
More advanced functions of mortAAR deal with testing the representativeness and the subsequent correction of life tables (explained in the `vignette("lt_correction")`) as well as the computation of reproduction indices (`vignette("reproduction")`).

0 comments on commit 1c6139b

Please sign in to comment.