Record counts function Calculate and combine counts of distinct records and imported records for each database
Source:R/count.R
record_counts.Rd
This function calculates the counts of distinct records and records imported for each database source. It combines these counts into one dataframe and calculates the total for each count type.
Value
A dataframe with counts of distinct records and imported records for each source, including total counts.
Examples
# Create synthetic data for example
unique_citations <- data.frame(
title = paste("Article", 1:10),
db_source = sample(c("Database 1", "Database 2", "Database 3"), 10, replace = TRUE),
stringsAsFactors = FALSE
)
citations <- data.frame(
title = paste("Article", 1:20),
db_source = sample(c("Database 1", "Database 2", "Database 3"), 20, replace = TRUE),
stringsAsFactors = FALSE
)
# Use the synthetic data with the function
result <- record_counts(unique_citations, citations, "db_source")
result
#> Source Records Imported Distinct Records
#> 1 Database 1 9 4
#> 2 Database 2 8 3
#> 3 Database 3 3 3
#> 4 Total 20 10