-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
78 lines (55 loc) · 1.93 KB
/
README.Rmd
File metadata and controls
78 lines (55 loc) · 1.93 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
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%"
)
```
# nva
<!-- badges: start -->
[](https://github.com/capro-uio/nva/actions/workflows/R-CMD-check.yaml)
[](https://lifecycle.r-lib.org/articles/stages.html)
[](https://github.com/capro-uio/nva/actions/workflows/test-coverage.yaml)
<!-- badges: end -->
{nva} provides an R interface to the [Nasjonalt Vitenarkiv (NVA)](https://nva.sikt.no) API,
the Norwegian national research archive maintained by [Sikt](https://sikt.no).
## Installation
Install the development version from GitHub:
```r
# install.packages("pak")
pak::pak("capro-uio/nva")
```
## Setup
Most read and search endpoints work without authentication.
For authenticated access (required for write operations and to avoid throttling),
request API credentials at <https://nettskjema.no/a/nva-api-tilgang> and set:
```r
Sys.setenv(
NVA_CLIENT_ID = "your-client-id",
NVA_CLIENT_SECRET = "your-client-secret"
)
```
We recommend adding these to your `.Renviron` file.
Run `nva_sitrep()` to verify your setup.
## Usage
```{r example, eval = FALSE}
library(nva)
nva_search(query = "machine learning", institution = "uio")
nva_publication("01907b24c6da-065e37af-5849-4602-b77c-d4d0d4e0ef31")
nva_person("12345")
nva_organizations(query = "Universitetet i Oslo")
```
To use the test/sandbox environment:
```r
Sys.setenv(NVA_API_ENV = "test")
```
## Diagnostics
```{r sitrep, eval = FALSE}
nva_sitrep()
```
This checks your credentials, API connectivity, and package configuration.