Transform API response from list to data frame
pa2_df.RdTransform API response from list to data frame
Arguments
- response_l
A list based on a Plausible API v2 response, typically retrieved with
pa2_get().- long
Logical, defaults to FALSE. If FALSE, the default, the value for each metric is returned in its own column. If TRUE, the data frame is returned in the long format.
Examples
if (FALSE) { # \dontrun{
pa2_get(
date_range = "7d",
metrics = c("visits", "pageviews"),
dimensions = c("time:day"),
pagination = list(limit = 10)
) |>
pa2_df(long = TRUE)
pa2_get(
date_range = "7d",
metrics = c("visits", "pageviews"),
dimensions = c("time:day"),
pagination = list(limit = 10)
) |>
pa2_df(long = FALSE)
} # }