merge_files: merge json files (or any kind of text files) from a directory

Description Usage Arguments Details Examples

View source: R/utils.R

Description

merge json files (or any kind of text files) from a directory

Usage

1
2
merge_files(INPUT_FOLDER, OUTPUT_FILE, CONCAT_DELIMITER = "\n",
  verbose = FALSE)

Arguments

INPUT_FOLDER

a character string specifying a path to the input folder

OUTPUT_FILE

a character string specifying a path to the output file

CONCAT_DELIMITER

a character string specifying the delimiter to use when merging the files

verbose

either TRUE or FALSE. If TRUE then information will be printed in the console.

Details

This function is meant for json files but it can be applied to any kind of text files. It takes an input folder (INPUT_FOLDER) and an output file (OUTPUT_FILE) and merges all files from the INPUT_FOLDER to a single OUTPUT_FILE using the concatenation delimiter (CONCAT_DELIMITER).

Examples

1
2
3
4
5
6
## Not run: 
library(geojsonR)

merge_files(INPUT_FOLDER = "/my_folder/", OUTPUT_FILE = "output_file.json")

## End(Not run)

geojsonR documentation built on July 23, 2018, 1:03 a.m.