Skip to contents

List Autobahn warnings

Usage

autobahn_warnings(road_id, flatten = FALSE, flatten_mode = "json")

Arguments

road_id

Road identifier.

flatten

Logical; if TRUE, simplify nested list columns according to flatten_mode. Default FALSE keeps list columns as-is.

flatten_mode

How to handle list columns when flatten = TRUE:

"drop"

Remove list columns entirely. Use when nested data is not needed.

"json"

Convert each list element to a JSON string. Preserves all data in a text-queryable format. This is the default.

"unnest"

Expand list columns into multiple rows via tidyr::unnest_longer(). Warning: this can significantly increase the number of rows.

Value

A tibble with one row per warning entry:

road_id

Road identifier (character).

identifier

Entry identifier (character).

title

Title (character).

subtitle

Subtitle (character).

display_type

Display type (character).

icon

Icon identifier (character).

is_blocked

Whether the road is blocked (logical).

future

Whether the entry is future-dated (logical).

start_timestamp

Start timestamp string (character).

start_time

Parsed start time (POSIXct).

point

Point coordinate string (character).

extent

Extent coordinate string (character).

coordinate_lat

Latitude (character).

coordinate_long

Longitude (character).

description

Description text (character).

footer

Footer text (character).

route_recommendation

Route recommendations (list-column).

lorry_parking_feature_icons

Lorry parking feature icons (list-column).

With flatten = TRUE, the two list-columns are transformed according to flatten_mode.

Details

Returns current warnings for a specific Autobahn road id. API documentation: https://autobahn.api.bund.dev.

Examples

if (FALSE) { # \dontrun{
roads <- autobahn_roads()
autobahn_warnings(roads$road_id[[1]], flatten = TRUE)
} # }