jpinfect_read_confirmed: Read Confirmed Case Reports from File or Directory

View source: R/jpinfect_read_confirmed.R

jpinfect_read_confirmedR Documentation

Read Confirmed Case Reports from File or Directory

Description

This function processes case reports either from a single file or from multiple files within a directory. The function is capable of handling data by "sex" or "place" types, and processes data accordingly based on file patterns.

Usage

jpinfect_read_confirmed(path, type = NULL, ..., skip_size_check = FALSE)

Arguments

path

A character string specifying the path to a single file or directory containing multiple files.

type

A character string specifying the type of data to import. Must be either "sex" or "place".

...

Additional arguments passed to internal functions for further customization.

skip_size_check

A logical value indicating whether to skip the file size check. Defaults to FALSE.

Details

The function detects whether the path is a single file or a directory. If it is a single file, it processes the data using .jpinfect_read_excel. If it is a directory, it processes multiple files using .jpinfect_read_excels.

Supported file patterns:

"sex"

Files with names containing "11.xls" or "Syu_01_1.xls".

"place"

Files with names containing "Syu_02_1.xls".

Value

A data frame containing processed case reports for all rows and columns in the files.

Examples


# Process a single file
data_file <- system.file("extdata", "1999_Syu_11.xls", package = "jpinfect")
data_single <- jpinfect_read_confirmed(data_file, skip_size_check = TRUE)

# Process all files in a directory
data_dir <- system.file("extdata", package = "jpinfect")
data_multiple <- jpinfect_read_confirmed(data_dir, type = "place", skip_size_check = TRUE)



jpinfect documentation built on Feb. 24, 2026, 1:07 a.m.