-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
118 lines (84 loc) · 4.77 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
output: github_document
bibliography: vignettes/bibliography.bib
nocite: '@*'
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = NULL
)
Sys.setenv(LANGUAGE = "en") # Force locale
```
# kairos <img width=120px src="man/figures/logo.png" align="right" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/tesselle/kairos/workflows/R-CMD-check/badge.svg)](https://github.com/tesselle/kairos/actions)
[![codecov](https://codecov.io/gh/tesselle/kairos/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tesselle/kairos)
[![CodeFactor](https://www.codefactor.io/repository/github/tesselle/kairos/badge)](https://www.codefactor.io/repository/github/tesselle/kairos)
[![Dependencies](https://tinyverse.netlify.app/badge/kairos)](https://cran.r-project.org/package=kairos)
[![r-universe](https://tesselle.r-universe.dev/badges/kairos)](https://tesselle.r-universe.dev/kairos){.pkgdown-devel}
[![CRAN Version](https://www.r-pkg.org/badges/version/kairos)](https://cran.r-project.org/package=kairos){.pkgdown-release}
[![CRAN checks](https://badges.cranchecks.info/worst/kairos.svg)](https://cran.r-project.org/web/checks/check_results_kairos.html){.pkgdown-release}
[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/kairos)](https://cran.r-project.org/package=kairos){.pkgdown-release}
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5653896.svg)](https://doi.org/10.5281/zenodo.5653896)
<!-- badges: end -->
## Overview
A toolkit for relative and absolute dating and analysis of chronological patterns. This package includes functions for chronological modeling and dating of archaeological assemblages from count data. It provides methods for matrix seriation. It also allows to compute time point estimates and density estimates of the occupation and duration of an archaeological site. **kairos** provides methods for:
* Matrix seriation: `seriate_rank()` and `seriate_average()`.
* Testing matrix seriation results [@porcic2013; @peeples2012]: `assess()` and `refine()`.
* Mean ceramic date estimation [@south1977]: `mcd()`.
* Event and accumulation date estimation [@bellanger2012]: `event()`.
* Aoristic analysis [@ratcliffe2000]: `aoristic()`.
* Chronological apportioning [@roberts2012]: `apportion()`.
[**tabula**](https://packages.tesselle.org/tabula/) is a companion package to **kairos** that provides functions for visualization and analysis of archaeological count data.
---
```{r citation, echo=FALSE, comment='', results='asis'}
cite <- utils::citation("kairos")
print(cite, bibtex = FALSE)
```
## Installation
You can install the released version of **kairos** from [CRAN](https://CRAN.R-project.org) with:
```{r cran-installation, eval=FALSE}
install.packages("kairos")
```
And the development version from [GitHub](https://github.com/) with:
```{r gh-installation, eval=FALSE}
# install.packages("remotes")
remotes::install_github("tesselle/kairos")
```
## Usage
```{r packages-load}
## Load packages
library(kairos)
```
**kairos** uses [**aion**](https://packages.tesselle.org/aion/) for internal date representation. Look at `vignette("aion", package = "aion")` before you start.
*It assumes that you keep your data tidy*: each variable (type/taxa) must be saved in its own column and each observation (sample/case) must be saved in its own row.
```{r aoristic, fig.width=7, fig.height=6}
## Data from Husi 2022
data("loire", package = "folio")
keep <- c("Anjou", "Blésois", "Orléanais", "Haut-Poitou", "Touraine")
loire <- subset(loire, area %in% keep)
## Get time range
loire_range <- loire[, c("lower", "upper")]
## Calculate aoristic sum (weights) by group
ao <- aoristic(loire_range, step = 50, weight = TRUE, groups = loire$area)
## Plot
plot(ao, col = "grey")
## Rate of change by group
set.seed(12345) # Set seed for reproductibility
ro <- roc(ao, n = 30)
plot(ro)
```
## Translation
This package provides translations of user-facing communications, like messages, warnings and errors, and graphical elements (axis labels). The preferred language is by default taken from the locale. This can be overridden by setting of the environment variable `LANGUAGE` (you only need to do this once per session):
``` r
Sys.setenv(LANGUAGE = "<language code>")
```
Languages currently available are English (`en`) and French (`fr`).
## Contributing
Please note that the **kairos** project is released with a [Contributor Code of Conduct](https://www.tesselle.org/conduct.html). By contributing to this project, you agree to abide by its terms.
## References