Repository navigation
Expand file tree
/
Copy pathREADME.Rmd
More file actions
63 lines (46 loc) · 2.63 KB
/
Copy pathREADME.Rmd
File metadata and controls
63 lines (46 loc) · 2.63 KB
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
---
output: github_document
---
<!-- 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 = "100%"
)
```
# c14
<!-- badges: start -->
[](https://www.repostatus.org/#active)
[](https://CRAN.R-project.org/package=c14)
[](https://github.com/joeroe/c14/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/joeroe/c14)
[](https://doi.org/10.5281/zenodo.21361370)
<!-- badges: end -->
**c14** makes it easy and intuitive to incorporate radiocarbon dating into tidy data analysis workflows in R.
It provides classes and functions for radiocarbon data that fit nicely in tables and work well with pipes and dplyr verbs.
These include direct support for the most common tasks when working with radiocarbon data—calibrating, summarising, aggregating and plotting radiocarbon dates—as well as conversion methods for combining specialised methods provided by other packages (e.g. [rcarbon](https://cran.r-project.org/package=rcarbon), [BChron](https://andrewcparnell.github.io/Bchron/), [oxcAAR](https://cran.r-project.org/package=oxcAAR)) in the same analysis.
It was forked from [stratigraphr](https://github.com/joeroe/stratigraphr) v0.3.0.
## Installation
You can install the latest release of c14 [from CRAN](https://cran.r-project.org/package=c14) with:
```{r install, eval=FALSE}
install.packages("c14")
```
Or the development version from GitHub using the [remotes](https://remotes.r-lib.org/) package:
```{r install-dev, eval=FALSE}
# install.packages("remotes")
remotes::install_github("joeroe/c14")
```
## Usage
The main aim of c14 is to make it easier to work with radiocarbon data within a tidy workflow.
For example, we can combine `dplyr::filter()` with `c14_calibrate()` to only calibrate dates from a specific site:
```{r eg-calibrate, message=FALSE}
library("c14")
library("dplyr", warn.conflicts = FALSE)
ppnd |>
filter(site == "Ganj Dareh") |>
select(lab_id, cra, error) |>
mutate(cal = c14_calibrate(cra, error))
```
The resulting `cal`-class vector can be assigned to a new column, allowing us to keep working with the data in the context of the original data frame or tibble.