Add Readme.md
Change-Id: Ide3a0d9d76675c03e5c2f13f145aff0a56973c48
diff --git a/Readme.md b/Readme.md
new file mode 100644
index 0000000..ba06caf
--- /dev/null
+++ b/Readme.md
@@ -0,0 +1,101 @@
+# R client library to access the Matomo web service API
+---
+
+## Description
+The package provides client access to the web service API of the web analytics platform [Matomo](https://matomo.org/).
+
+## Installation
+```R
+library(devtools)
+install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/matomor")
+```
+
+## Documentation
+
+See matomo [Reporting API Reference](https://developer.matomo.org/api-reference/reporting-api) for details.
+
+### Usage
+```R
+getVisitsSummary(
+ matomoUrl,
+ siteId,
+ period = "month",
+ date = "last16",
+ filter_limit = 100,
+ removeFirst = FALSE,
+ removeLast = FALSE,
+ accessToken = getAccessToken(matomoUrl)
+)
+```
+### Arguments
+
+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](https://developer.matomo.org/api-reference/reporting-api))
+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) and pass it here, or you can make it persistent with persistAccessToken.|
+accessToken | API Authentication Token - you can get this in your matomo interface under Settings -> Personal -> Settings -> API Authentication Token
+
+## Examples
+
+### ggplot
+```R
+library(matomor)
+library(tidyverse)
+
+# persistAccessToken("https://stats.xxx.org/", "ad7609a669179c4ebca7c995342f7e09")
+
+getVisitsSummary("https://stats.xxx.org/", siteId = c(13,14), period="day", date="last60") %>%
+ mutate(service = case_when(site_id == 13 ~ "A", site_id == 14 ~ "B")) %>%
+ ggplot(aes(date, nb_actions, color=service)) +
+ scale_color_discrete() +
+ geom_smooth(span=.25, se=FALSE)
+```
+![](./man/figures/Readme-Example-1.png)<!-- -->
+
+### highcharter
+```R
+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())
+```
+![](./man/figures/Readme-Example-2.png)<!-- -->
+
+## Development and License
+
+**Authors**: [Marc Kupietz](http://www1.ids-mannheim.de/zfo/personal/kupietz/)
+
+Copyright (c) 2020, [Leibniz Institute for the German Language](http://www.ids-mannheim.de/), Mannheim, Germany
+
+This package is developed as part of the [KorAP](http://korap.ids-mannheim.de/)
+Corpus Analysis Platform at the Leibniz Institute for German Language
+([IDS](http://www.ids-mannheim.de/)).
+
+It is published under the
+[BSD-2 License](LICENSE.md).
+
+
+## Contributions
+
+Contributions are very welcome!
+
+Your contributions should ideally be committed via our [Gerrit server](https://korap.ids-mannheim.de/gerrit/)
+to facilitate reviewing (see [Gerrit Code Review - A Quick Introduction](https://korap.ids-mannheim.de/gerrit/Documentation/intro-quick.html)
+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](LICENSE.md).
diff --git a/man/figures/Readme-Example-1.png b/man/figures/Readme-Example-1.png
new file mode 100644
index 0000000..20d4bdf
--- /dev/null
+++ b/man/figures/Readme-Example-1.png
Binary files differ
diff --git a/man/figures/Readme-Example-2.png b/man/figures/Readme-Example-2.png
new file mode 100644
index 0000000..c01a8c3
--- /dev/null
+++ b/man/figures/Readme-Example-2.png
Binary files differ