Skip to contents

Save a paper as a JSON file.

Usage

paper_write(paper, file_name = NULL, save_path, schema_version = NULL)

Arguments

paper

a paper object

file_name

the name of the file (if NULL, defaults to the paper_id)

save_path

the directory to save the JSON file in; there is no default, because CRAN does not allow writing into the working directory unless you ask for it

schema_version

NULL (the default) saves the paper object as is; "12.0" saves a bibr export schema 12.0 file, for a paper read from a bibr 12.0 export or converted with grobid_to_bibr(schema_version = "12.0"). The file keeps the paper's extraction block (a bibr export keeps bibr as its producer and the time bibr extracted it) and names metacheck as the converter.

Value

the path to the JSON file

Examples

paper <- demopaper()
paper$info$title <- "New title"
json <- paper_write(paper, "new_paper", tempdir())
read(json)$info$title
#> [1] "New title"