Downloads dataset from kaggle and creates a dataframe with input columns

download_data(dataset, columns)

Arguments

dataset

kaggle dataset name to download

columns

list of columns to create a dataframe

Value

A dataframe with the given column names

Examples

dataset <- "geomack/spotifyclassification"
df <- download_data(dataset, c("song_title", "artist"))
#> New names:
#> * `` -> ...1
#> Rows: 1969 Columns: 17
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (2): song_title, artist
#> dbl (15): ...1, acousticness, danceability, duration_ms, energy, instrumenta...
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
df
#> # A tibble: 1,969 × 2
#>    song_title        artist          
#>    <chr>             <chr>           
#>  1 Mask Off          Future          
#>  2 Redbone           Childish Gambino
#>  3 Xanny Family      Future          
#>  4 Master Of None    Beach House     
#>  5 Parallel Lines    Junior Boys     
#>  6 Sneakin’          Drake           
#>  7 Childs Play       Drake           
#>  8 Gyöngyhajú lány   Omega           
#>  9 I've Seen Footage Death Grips     
#> 10 Digital Animal    Honey Claws     
#> # … with 1,959 more rows