Last active
June 10, 2021 15:22
-
-
Save madilk/b5e1a2e8dce41f25208070de76314285 to your computer and use it in GitHub Desktop.
DataExplorer package in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pull data from GA API | |
library(googleAnalyticsR) | |
#change location of json service key | |
ga_auth(json_file = "C:\\folder-where-your-service-creds-JSON-is-located\\json-service-key.json") | |
account_list$viewId | |
#change view id of | |
viewID <- 12345678 | |
data <- google_analytics( | |
viewID, | |
date_range = c("2020-01-01","2021-06-09"), | |
dimensions = c("dayOfWeek", | |
"hour", | |
"channelGrouping", | |
"deviceCategory"), | |
metrics = c("sessions"), | |
anti_sample = TRUE | |
) | |
summary(data) | |
View(data) | |
### | |
#DataExplorer package | |
install.packages("DataExplorer") | |
library(DataExplorer) | |
library(tidyverse) | |
#check column types | |
glimpse(data) | |
#convert character columns to factors | |
data$dayOfWeek <- as.factor(data$dayOfWeek) | |
data$channelGrouping <- as.factor(data$channelGrouping) | |
data$hour <- as.factor(data$hour) | |
data$deviceCategory <- as.factor(data$deviceCategory) | |
glimpse(data) | |
data %>% | |
create_report( | |
output_file = "eda on analyticslog.com", | |
output_dir = "eda on analyticslog.com", | |
report_title = "eda on analyticslog.com" | |
) | |
#convert ms-dos application to html | |
#https://www.youtube.com/watch?v=Abgnyp8HDbc | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment