It supports csv and json by default and lets users provide custom handlers if other file formats are used.
to_json(input, as_data_frame, read_fun, ...)
A character string; the path to the input file.
TRUE or FALSE; whether the data are loaded as a data-frame.
A function to load the input file. Default settings are provided for CSV files and JSON files. The function has to load a data file into an object that can be handled by `jsonlite::toJSON`. Possible choices include `utils::read_delim`, `readr::read_csv2`, etc.
Extra arguments to be passed to `read_fun`.