View source: R/data_transformation.R
| yt_to_dataframe | R Documentation |
Transforms YouTube Analytics API response into a clean data.frame with proper column names and types.
yt_to_dataframe(api_response, clean_names = TRUE, parse_dates = TRUE)
api_response |
List returned from get_report() or other API functions |
clean_names |
Logical. Clean column names by removing special characters (default: TRUE) |
parse_dates |
Logical. Parse date columns to Date objects (default: TRUE) |
data.frame with transformed data, or NULL if no data available
## Not run:
# Get data and convert to data.frame
report <- get_channel_overview("last_30_days")
df <- yt_to_dataframe(report)
# Keep original column names
df <- yt_to_dataframe(report, clean_names = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.