-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
56 lines (41 loc) · 2.05 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
---
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 -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/c14)](https://CRAN.R-project.org/package=c14)
[![R-CMD-check](https://github.com/joeroe/c14/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/joeroe/c14/actions/workflows/R-CMD-check.yaml)
[![Test coverage](https://codecov.io/gh/joeroe/c14/graph/badge.svg)](https://app.codecov.io/gh/joeroe/c14)
<!-- badges: end -->
**c14** provides basic classes and functions for radiocarbon data in R.
It makes it easier to combine methods from several existing packages (e.g. rcarbon, Bchron, oxcAAR, c14bazAAR, ArchaeoPhases, stratigraphr) together and work with them in a tidy data workflow.
It was forked from [stratigraphr](https://github.com/joeroe/stratigraphr) v0.3.0.
## Installation
You can install the development version of c14 from GitHub with the [remotes](https://remotes.r-lib.org) package:
```r
# install.packages("remotes")
remotes::install_github(c("joeroe/controller", "joeroe/c14"))
```
Note that the dependency [controller](https://github.com/joeroe/controller) is also not yet available on CRAN.
## 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.