forked from bachmannpatrick/R-Test-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LE4_RMarkdown_Render.Rmd
56 lines (41 loc) · 1.18 KB
/
LE4_RMarkdown_Render.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: "Export Report to Word"
author: "Patrick Bachmann"
date: "February 6th,2017"
output:
word_document: default
html_notebook: default
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Description
This documentation gives an overview of your transactions during the last year.
# Data overview
```{r data overview, include=FALSE}
library(data.table)
library(lubridate)
library(ggplot2)
myData <- fread("transactions.csv")
myData[, TransDate:=dmy(TransDate, tz="UTC")]
max(myData$TransDate)
myData <- myData[TransDate >= "2012-01-01",]
```
```{r, echo = FALSE}
library(pander)
pander(summary(myData), caption = "Summary statistics", split.table = Inf, split.cells = c(6,8,5,7,7,9,6))
```
# Number of transactions
Here we can see the ditribution of number of transactions per month over the last year.
```{r plot, include = FALSE}
myData[,month := as.numeric(format(TransDate, format = "%m"))]
myData[,month:=month.abb[month]]
```
```{r, echo = FALSE}
ggplot(myData, aes(x=month)) + geom_bar() +
labs(x="", y="Transactions", title="Transactions per Month") +
scale_x_discrete(labels=month.abb)
```
# Literature