Skip to contents

File format is detected from the extension. Supported extensions: .csv, .tsv, .xlsx / .xls, .parquet / .pq, .json / .jsonl.

Usage

morie_dataset_load(path, encoding = "UTF-8", ...)

Arguments

path

Character; file path.

encoding

Character; encoding for text formats (default "UTF-8").

...

Forwarded to the underlying reader (utils::read.csv, readxl::read_excel, etc.).

Value

A data.frame.

Examples

tmp <- tempfile(fileext = ".csv")
write.csv(data.frame(a = 1:3, b = c("x", "y", "z")), tmp, row.names = FALSE)
df <- morie_dataset_load(tmp)
head(df)
#>   a b
#> 1 1 x
#> 2 2 y
#> 3 3 z
unlink(tmp)