Learn R Programming

nascaR.data (version 3.1.0)

export_series: Export NASCAR Series Data

Description

Downloads or loads the specified NASCAR series data and writes it to a file in either CSV or Parquet format.

Usage

export_series(series = c("cup", "nxs", "truck"), path, format = NULL, ...)

Value

Invisibly returns the exported data.

Arguments

series

Character. The series to export. One of "cup", "nxs", or "truck".

path

Character. Path to the output file (including extension).

format

Character. Output format: "csv", "parquet", or NULL. If NULL (default), the format is guessed from the file extension of path.

...

Additional arguments passed to utils::write.csv() (for CSV) or arrow::write_parquet() (for Parquet).

Examples

Run this code
if (FALSE) {
# Export Cup Series data to CSV
export_series("cup", "cup_data.csv")

# Export Truck Series data to Parquet
export_series("truck", "truck_data.parquet")
}

Run the code above in your browser using DataLab