-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
55 lines (39 loc) · 1.55 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
---
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%"
)
```
# marc21r
<!-- badges: start -->
<!-- badges: end -->
{marc21r} is an R package for examining and analyzing [MARC21](https://www.loc.gov/marc/) files, a set of standards used to describe library materials such as books and journals. Currently, {marc21r} reads only MARC21 XML.
## Installation
You can install the development version of marc21r from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("dojobo/marc21r")
```
## Example
The basic use case is to load a MARC XML file as a tibble. Each tag (001, 245, etc.) becomes a column whose name starts with `t`, e.g., `t001`, `t245`. Once so loaded, the dataset can be manipulated and analyzed using standard tidyverse tools.
```{r example}
library(marc21r)
library(dplyr)
collection <- read_marcxml("collection.xml")
collection %>%
select(t245, t260, t500)
```
For better readability, `tag_names()` can be applied to a MARC dataframe:
```{r}
collection %>%
select(t245, t260, t500) %>%
tag_names(style = "short")
```
## Current status
This project is alpha/experimental. It "works" as a proof of concept with one or two example files, but I expect there are gaps. Post problems you encounter or feature requests on the [Issues](https://github.com/dojobo/marc21r/issues) page. I am also happy to accept pull requests!