Downloads a dataset file from Kaggle using the Kaggle CLI and reads it into
a tidylearn_data object. Requires the Kaggle CLI to be installed and
configured (pip install kaggle).
Arguments
- source
A Kaggle dataset slug (e.g.,
"user/dataset-name") or a Kaggle URL. A URL may point at any tab of the dataset or competition page (/data,/code,/versions/2) and may carry a query; a competition URL is read as a competition withouttypebeing set.- file
The specific file to read from the dataset, as a path within it; a file the CLI saved under its base name is found too. If
NULL, the download is searched for files these readers handle (CSV, TSV, Excel, Parquet and JSON, with compressed CSV/TSV and.ndjson); with several, the newest is read and a message names it.- dest
Directory to keep the download in. The default is a fresh per-dataset directory under
tempdir(). A supplieddestreceives this download's files, replacing files of the same name; nothing else in it is read, unpacked or changed.- type
Either
"dataset"(default) or"competition". Left unset, a competition URL insourcesets it.- ...
Additional arguments passed to the format-specific reader.
Examples
if (FALSE) { # \dontrun{
# Needs the Kaggle CLI and Kaggle credentials
tl_read_kaggle("zillow/zecon", file = "Zip_time_series.csv")
tl_read_kaggle("titanic", file = "train.csv", type = "competition")
tl_read_kaggle("https://www.kaggle.com/competitions/titanic/data",
file = "train.csv")
} # }
