EPM_write_to_file: Write PubMed Records to Local Files.

View source: R/epm_all_fx.R

EPM_write_to_fileR Documentation

Write PubMed Records to Local Files.

Description

Write a list of PubMed records to a local file. If already existing, the destination file will be over-written. Original formatting of the PubMed records should be declared and will be preserved in the output file. Format conversion is NOT supported.

Usage

EPM_write_to_file(x, to, format, addon = NULL, verbose = FALSE)

Arguments

x

List including raw PubMed records.

to

Path to the destination file on the local disc.

format

String, format of the raw PubMed records that will be saved to the destination file (e.g., 'xml').

addon

String, optional chunk of text in XML format to be written to the destination file (header). This argument is only used when ‘format' is set to ’xml'. It can be NULL.

verbose

Logical, shall details about the progress of the operation be printed to console.

Value

integer in the range c(0, 1). A result of 0 indicates that an error occurred while writing the file. A result of 1 indicates that the operation was completed successfully.

Author(s)

Damiano Fantini, damiano.fantini@gmail.com

References

https://www.data-pulse.com/dev_site/easypubmed/

Examples

test <- list('Record #1', 'Record #2')
outfile = './test_file.txt'
file.exists(outfile)
easyPubMed:::EPM_write_to_file(x = test, to = './test_file.txt', format = 'xml')
file.exists(outfile)
readLines(outfile)
unlink(outfile)



dami82/easyPubMed documentation built on Jan. 4, 2024, 6:21 a.m.