3482
правки
Изменения
м
→Примечания
{{r-code|code=<nowiki>> as.character(profiles[profiles$id == id, "timezone"])
[1] "Europe/Moscow"</nowiki>}}
== Анализ источников трафика ==
{{r-code|code=<nowiki>> ga.data <- ga$getData(id, start.date = ga$getFirstDate(id), end.date = Sys.Date(),
+ metrics = "ga:sessions", dimensions = "ga:medium", sort = "-ga:sessions")
> ga.data[ga.data$medium == "(none)", "medium"] <- "direct"
> ga.data$percent <- round(prop.table(ga.data$sessions) * 100, 1)
> qplot(data = ga.data, x = factor(0), y = sessions, fill = medium, xlab = "", ylab = "") +
+ geom_bar(width = 1, stat = "identity") + coord_polar(theta = "y") + theme_bw() +
+ theme(axis.ticks = element_blank(), axis.text.x = element_blank(), axis.text.y = element_blank()) +
+ scale_fill_discrete(name = "source")</nowiki>}}
== Примечания ==
<references />