dl_trips_data: Download historical bike trips data in Norway

Description Usage Arguments Value Examples

View source: R/dl_trips_data.R

Description

dl_trips_data downloads a file of anonymized historical bike trips data in Norway for the city of Oslo, Bergen, and Trondheim.

The data is provided according to the Norwegian License for Open Government Data 2.0 NLOD 2.0.

The data is downloaded from:

Usage

1
dl_trips_data(year, month, city, filetype = "CSV")

Arguments

year

A number. The year that you want to download data for.

month

A number. The month that you want to download data for.

city

A string. The city that you want to download data for. The options are "Oslo", "Bergen", and "Trondheim".

filetype

A string. The filetype that you want to download data for. The options are "CSV" (default) and "JSON".

Value

The function downloads a CSV-file to your current working directory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

# Download bike trip data for the month of January, 2019, in Bergen
# as CSV or JSON
dl_trips_data(year = 2019, month = 01, city = "Bergen", filetype = "CSV)

dl_trips_data(year = 2019, month = 01, city = "Bergen", filetype = "JSON)

# Download bike trips data for the month of October, 2018, in Trondheim
dl_trips_data(2018, 10, "Trondheim")

# Use "lapply()" to download bike trips data for several months in Oslo
lapply(06:08, dl_trips_data, year = 2018, city = "Oslo")


## End(Not run)

bysykkel documentation built on April 19, 2020, 4:18 p.m.