---
title: "Repository records"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Repository records}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

A repository is an archive (such as a library) containing source documents. Adding repositories to a tidyged object can be achieved with the `add_repo()` function. The `repo_address` argument is an `address()` object defining the address of the repository. Up to 3 local address lines, phone numbers, emails, faxes, and web pages can be defined.

```{r}
library(tidyged)

gedcom(subm("Me")) |> 
  add_repo(name = "A library",
           repo_address = address(local_address_lines = c("123 Library Road", "Turin Village"),
                                  city = "Manchester",
                                  state = "New Hampshire",
                                  postal_code = "123456",
                                  country = "United States of America",
                                  phone_number = c("645-618-6578", "645-618-6570", "645-618-6577"),
                                  email = c("enquiries@alibrary.com", "enquiries2@alibrary.com"),
                                  fax = "0947393",
                                  web_page = "www.alibrary.com")) |> 
  dplyr::filter(record == "@R1@") |> 
  knitr::kable()
```

As with other records, various types of user-defined references can be defined (`user_reference_numbers`), as well as links to notes.

<p style="text-align: right;"><a href="https://jl5000.github.io/tidyged/articles/source_records.html">Next article: Source records ></a></p>
