Learn R Programming

searchAnalyzeR (version 0.1.0)

calc_temporal_coverage: Calculate Temporal Coverage Metrics

Description

Calculate Temporal Coverage Metrics

Usage

calc_temporal_coverage(search_results, target_date_range = NULL)

Value

List containing temporal coverage statistics

Arguments

search_results

Data frame with search results including date column

target_date_range

Vector of two dates defining the target time period

Details

Analyzes the temporal distribution of search results:

  • coverage_by_year: Number of articles by publication year

  • target_period_coverage: Proportion of results in target date range

  • temporal_gaps: Years with no results in the target period

  • peak_years: Years with highest number of results

Examples

Run this code
# Create sample data
search_results <- data.frame(
  id = paste0("art", 1:20),
  date = seq(as.Date("2010-01-01"), as.Date("2023-12-31"), length.out = 20)
)
target_range <- c(as.Date("2015-01-01"), as.Date("2020-12-31"))

temporal_metrics <- calc_temporal_coverage(search_results, target_range)
print(temporal_metrics$target_period_coverage)

Run the code above in your browser using DataLab