Crash | R Documentation |
The function is used to download the crash data in Taiwan for the specific month or year.
Crash(access_token, crash, county, time, dtype="text", out=F)
access_token |
Your access token given by TDX platform. This can be derived from the function |
crash |
Please fill in the crash type, including |
county |
Please fill in the English county name. Checking out the appropriate county name in dataframe |
time |
The time (year-month) of the data. The format of time should be |
dtype |
The class of data, including |
out |
If the result should be exported to the local, please fill in the directory. The default value is FALSE, which does not export the data. Note that the directory does not need to contain ".shp", ".csv", or ".txt". Note that if |
The result would be a list containing crash data (T1) and person data (T2). Please use $T1
to retrieve crash data, and use $T2
to retrieve person data. Note that crash with death over 24 days (A30) only retrieves T2 data.
Columns and coding definition can be found by using $DEF
.
Maintainer: Chia Jung, Yeh chia-jung.yeh@sydney.edu.au
#---download death-involved crash data of Taipei---#
crash_taipei=Crash(access_token, crash="A1", county="Taipei", time="2020-05", dtype="sf")
# retrieve crash data
crash_taipei$T1
# retrieve person data
crash_taipei$T2
# retrieve coding definition
crash_taipei$DEF
#---download injury-only crash data of Yilan---#
crash_yilan=Crash(access_token, crash="A2", county="YilanCounty", time="2021-06", dtype="sf", out="./crash_yilan")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.