Skip to content

Latest commit

 

History

History
105 lines (70 loc) · 2.77 KB

README.md

File metadata and controls

105 lines (70 loc) · 2.77 KB

papisr

R-CMD-check codecov GitHub code size in bytes

Bundle of convenience functions for papis workflows in R.

Provides some convenience functions for papis workflows in R. Papis is a 'powerful and highly extensible command-line based document and bibliography manager'. The package does not actually require papis to be installed in order for its functions to work.

Installation

## Installs and loads papisr
devtools::install_github("stasvlasov/papisr")
library("papisr")

Usage

Suppose you have a papis library located in testdata/papis that includes 4 simple bibliographic records (see below for the content of files). This example papis library is provided with the package and accessible with system.file()

Now, for example, if you want to tabulate year and url fields and number of tags for each record that is not tagged as 'classics' you can do it with the following simple script:

system.file("testdata", "papis", package = "papisr") |>
    papisr::collect_papis_records(!("classics" %in% info$tags)) |>
    papisr::tabulate_papis_records(`Year` = info$year
                                 , `URL` = info$url
                                 , `No. of tags` = length(info$tags))

The script returns the following data.frame:

Year URL No. of tags
2022 example.com 2
1985 uvt.nl 2
2222   1

Here 3 out of 4 records were tabulated because the one records with tag "classics" was filtered out.

Test records in papis format

testdata/papis/a/info.yml

tags:
  - data
  - research
url: example.com
year: 2022

testdata/papis/b/info.yml

tags:
  - research
  - phd
url: uvt.nl
year: 1985

testdata/papis/c/INFO.YML

tags: data
year: 2222

testdata/papis/d/info.yaml

tags: classics
year: 2000