commit | 2f478e6ffec67e61981fb418a0494f64d38974ae | [log] [tgz] |
---|---|---|
author | Marc Kupietz <kupietz@ids-mannheim.de> | Tue Dec 15 16:33:52 2020 +0100 |
committer | Marc Kupietz <kupietz@ids-mannheim.de> | Tue Dec 15 16:42:28 2020 +0100 |
tree | d9c9035e735b1a918f7e77faf94f2cde94729f57 | |
parent | 9d8e339ca5800fd6b33b3a4bfc26299d1efd0ab5 [diff] |
Add section on Installation Prerequisites to Readme.md Thanks to Roman! Change-Id: I02023c6f0bf7e200baeeaa838312eff0b2e51b28
The package provides client access to the web service API of the web analytics platform Matomo.
matomor
.matomor
uses some R packages with system dependencies you might need to install first:
#### Debian / Ubuntu sudo apt install r-base-dev libcurl4-gnutls-dev libxml2-dev libsodium-dev libgit2-dev #### Fedora / CentOS >= 8 / RHEL >= 8 sudo dnf install R-devel libcurl-devel openssl-devel libxml2-devel libsodium-devel libgit2-devel #### CentOS < 8 / RHEL < 8 sudo yum install R-devel libcurl-devel openssl-devel libxml2-devel libsodium-devel libgit2-devel #### Arch Linux pacman -S base-devel gcc-fortran libsodium curl libgit2
library(devtools) install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/matomor")
See matomo Reporting API Reference for details.
NOTE: Currently, the date
column in the data frame results refers to the first day of the respective period.
getVisitsSummary( matomoUrl, siteId, period = "month", date = "last16", filter_limit = 100, removeFirst = FALSE, removeLast = FALSE, accessToken = getAccessToken(matomoUrl) )
Argument | Description |
---|---|
matomoUrl | base URL of your matomo instance |
siteId | matomo site id or vector of site ids |
period | day, week, month or year |
date | date range (see matomo API reference) |
filter_limit | defines the maximum number of rows to be returned |
removeFirst | logical that determines whether the first row of each site should be removed (to account for incomplete periods) |
removeLast | logical that determines whether the last row of each site should be removed (to account for incomplete periods) |
accessToken | API Authentication Token - you can get this in your matomo interface under Settings -> Personal -> Settings -> API Authentication Token and pass it here, or you can make it persistent with persistAccessToken. |
library(matomor) library(tidyverse) library(idsThemeR) # persistAccessToken("https://stats.xxx.org/", "ad7609a669179c4ebca7c995342f7e09") getVisitsSummary("https://stats.xxx.org/", siteId = c(8,14), period="day", date="last60") %>% mutate(service = case_when(site_id == 8 ~ "A", site_id == 14 ~ "B")) %>% ggplot(aes(date, nb_visits, color=service)) + scale_color_ids() + theme_ids() + geom_smooth(span=.3, se=FALSE)
library(matomor) library(tidyverse) library(highcharter) library(idsThemeR) # persistAccessToken("https://stats.xxx.org/", "ad7609a669179c4ebca7c995342f7e09") getVisitsSummary("https://stats.xxx.org/", siteId = c(13,14), period="month", date="last16") %>% mutate(service = case_when(site_id == 13 ~ "A", site_id == 14 ~ "B")) %>% hchart("spline", hcaes(date, nb_actions, group=service)) %>% hc_add_theme(hc_theme_ids_light())
Authors: Marc Kupietz
Copyright (c) 2020, Leibniz Institute for the German Language, Mannheim, Germany
This package is developed as part of the KorAP Corpus Analysis Platform at the Leibniz Institute for German Language (IDS).
It is published under the BSD-2 License.
Contributions are very welcome!
Your contributions should ideally be committed via our Gerrit server to facilitate reviewing (see Gerrit Code Review - A Quick Introduction if you are not familiar with Gerrit). However, we are also happy to accept comments and pull requests via GitHub.
Please note that unless you explicitly state otherwise any contribution intentionally submitted for inclusion into this software shall – as this software itself – be under the BSD-2 License.