This function saves deduplicated citations as a CSV file for further analysis and/or reporting. Metadata can be separated into one column per source, label or string, which facilitates analysis. Note that existing files are overwritten without warning.
Usage
export_csv(
unique_citations,
filename,
fields = "full",
separate = NULL,
trim_abstracts = 32000,
manual_dedup_complete = FALSE
)Arguments
- unique_citations
Dataframe with unique citations, resulting from
dedup_citations()- filename
Name (and path) of file, should end in .csv
- fields
Controls which columns are included. Use
"full"(default) to export all columns (required for reimport into CiteSource viareimport_csv());"standard"to export core bibliographic fields pluscite_source,cite_label, andcite_string(suitable for import into RELApp or other screening tools); or a character vector of column names for a custom selection. Note that exports other than"full"cannot be reimported into CiteSource.- separate
Character vector indicating which (if any) of cite_source, cite_string and cite_label should be split into separate columns to facilitate further analysis.
- trim_abstracts
Some databases may return full-text that is misidentified as an abstract. This inflates file size and may lead to issues with Excel, which cannot deal with more than 32,000 characters per field. Therefore, the default is to trim very long abstracts to 32,000 characters. Set a lower number to reduce file size, or NULL to retain abstracts as they are.
- manual_dedup_complete
Logical. Records, in a
manual_dedup_completecolumn, whether manual deduplication has been completed for this set (defaultFALSE). SetTRUEafter confirming manual pairs withdedup_citations_add_manual(). This flag is read back byreimport_csv()and lets later steps know whether candidate pairs still need review. Only written whenfields = "full".
Value
No return value, called for side effects. Saves the deduplicated citations as a 'CSV' file to the specified location.
Examples
if (interactive()) {
# Load example data from the package
examplecitations_path <- system.file("extdata", "examplecitations.rds", package = "CiteSource")
examplecitations <- readRDS(examplecitations_path)
dedup_results <- dedup_citations(examplecitations, merge_citations = TRUE)
export_csv(dedup_results, tempfile(fileext = ".csv"), separate = "cite_source")
# Standard export for RELApp / screening tools (not reimportable into CiteSource):
export_csv(dedup_results, tempfile(fileext = ".csv"), fields = "standard")
}