knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  cache = TRUE
)
library(kaggler)
options(width = 100)
options(tibble.print_min = 5)
options(tibble.print_max = 5)

kaggler

🏁 An R client for accessing Kaggle's API

R-CMD-check

Installation

You can install the dev version of {kaggler} from CRAN with:

## install kaggler package from github
devtools::install_github("koderkow/kaggler")

API Authorization

All users must be authenticated to interact with Kaggle’s APIs. To setup your API key refer to the Get Started guide.

Interacting with the API

These will be functions the user can call to have custom control over the returns and interactions with the Kaggle API.

Browse or search for Kaggle competitions.

## look through all competitions (paginated)
comps1 <- kgl_competitions_list()
comps1

## search by keyword for competitions
imagecomps <- kgl_competitions_list(search = "image")
imagecomps

You can look up the datalist for a given Kaggle competition using the API.

## data list for a given competition
c1_datalist <- kgl_competitions_data_list("titanic")
c1_datalist

For a more in-depth walkthrough visit the Kaggle API page.

Kaggle Flow

This is an experimental and opinionated reproducible workflow for working with Kaggle competitions.

library(kaggler)

kgl_flow("titanic")

#> • These files will be downloaded:
#>   - 'gender_submission'
#>   - 'test'
#>   - 'train'.
#> • Downloading 'gender_submission.csv'...
#> • Downloading 'test.csv'...
#> • Downloading 'train.csv'...

For a more in-depth walkthrough visit the Kaggle Flow page.

Note(s)



KoderKow/kaggler documentation built on Aug. 26, 2023, 11:27 a.m.