Utility function to convert existing RDS databases to JSON format. Can convert
a single file or batch convert all RDS files in a directory.
Usage
boilerplate_rds_to_json(
input_path,
output_path = NULL,
pretty = TRUE,
quiet = FALSE
)
Arguments
- input_path
Path to RDS file or directory containing RDS files
- output_path
Path to save JSON files. If NULL, saves in same location
as input with .json extension.
- pretty
Pretty print JSON for readability? Default is TRUE.
- quiet
Suppress messages? Default is FALSE.
Value
Invisible TRUE on success
Details
This function is useful for migrating existing RDS-based databases to the
more portable JSON format. JSON files are human-readable, work well with
version control, and can be used across different programming languages.
Examples
if (FALSE) { # \dontrun{
# Convert single file
boilerplate_rds_to_json("methods_db.rds")
# Convert all RDS files in directory
boilerplate_rds_to_json("boilerplate/data/")
# Convert to different location
boilerplate_rds_to_json("old_data/", output_path = "new_data/")
} # }