To install the latest version from CRAN:
The latest development version of the package will always be on GitHub. Instructions for installing the package from Github are provided below.
# install.packages('devtools') # nolint
devtools::install_github("soodoku/tubern", build_vignettes = TRUE)Next, load the package:
To get going, get the application id and password from Google
Developer Console (see https://developers.google.com/youtube/reporting/).
Enable YouTube APIs. Then set the application id and password via the
yt_oauth function. For more information about YouTube
OAuth, see YouTube
OAuth Guide.
## Waiting for authentication in browser...
## Press Esc/Ctrl + C to abort
## Authentication complete.get_report(
ids = "channel==MINE", metrics = "views",
start_date = "2010-04-01", end_date = "2017-04-01"
)## $kind
## [1] "youtubeAnalytics#resultTable"
## $columnHeaders
## $columnHeaders[[1]]
## $columnHeaders[[1]]$name
## [1] "views"
## $columnHeaders[[1]]$columnType
## [1] "METRIC"
## $columnHeaders[[1]]$dataType
## [1] "INTEGER"
## $rows
## $rows[[1]]
## $rows[[1]][[1]]
## [1] 6