This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
79 lines (51 loc) · 2.41 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
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![Travis-CI Build Status](https://travis-ci.org/ropensci/opencontext.png?branch=master)](https://travis-ci.org/ropensci/opencontext)
## opencontext: An R API client for the Open Context archaeological data repository
This packages enables browsing and downloading data from [Open Context](http://opencontext.org/) using R. Open Context reviews, edits, and publishes archaeological research data and archives data with university-backed repositories, including the California Digital Library.
## Installation
Install `opencontext`
```{r eval=FALSE}
install.packages("devtools")
devtools::install_github("ropensci/opencontext")
```
```{r}
library("opencontext")
```
## Browse countries
To browse the countries that Open Context has data on:
```{r}
countries <- oc_browse("countries")
```
The result is a data frame that include the names of the countries in `countries$label`. URLs that we can use to get more information about what projects, etc. are available for each country in `countries$id`
## Browse locations
To browse the locations for one country, for example, Turkey:
```{r}
library("dplyr", warn.conflicts = FALSE)
locations <- oc_browse(type = "countries") %>%
filter(label == "Turkey") %>%
oc_get_countries(type = "location")
```
To browse the names of locations that have archaeological data in Turkey, run `locations$label`. We can see that the first location in this example is Çatalhöyük.
## Browse projects
To inspect the projects available for a location in a country, for example, for Çatalhöyük in Turkey:
```{r}
projects_at_Çatalhöyük_Turkey <- oc_get_locations("Turkey", "Çatalhöyük")
```
Once again, the `label` column has the names of the projects: `projects_at_Çatalhöyük_Turkey$label`.
With a little further effort we can browse excavation/survey areas within the project, and get datasets of measurements of objects collected from these areas (along with chronological and spatial data for these objects).
## Get data from a specific project
Now that we've identified a specific project, we can ingest data from that project into our R session.
---
[![ropensci_footer](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org)