fread_trips_data {bysykkel} | R Documentation |
Fast read historical bike trips data in Norway to R
Description
fread_trips_data()
imports anonymized historical bike trips data for
the city of Oslo, Bergen, and Trondheim, in Norway, directly to R.
fread_trips_data()
utilizes the
fread()
function from the data.table
package to fast read the CSV-files. Hence, it is much faster than
read_trips_data
. fread_trips_data()
requires that you
have the data.table
package installed.
The data is provided according to the Norwegian License for Open Government Data 2.0 (NLOD 2.0).
The data is read from:
Usage
fread_trips_data(year, month, city)
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 you want to download data from. The options are "Oslo", "Bergen", and "Trondheim". |
Value
The function reads in bike trips data for the specified year, month, and city to R as a tibble.
Examples
## Not run:
# Fast read bike trips data for the month of January 2019 in Bergen
bergen_trips <- fread_trips_data(year = 2019, month = 1, city = "Bergen")
# Fast read bike trips data for the month of October 2018 in Trondheim
trondheim_trips <- fread_trips_data(2018, 10, "Trondheim")
## End(Not run)