Added data analysis

This commit is contained in:
2021-10-22 16:34:56 +02:00
parent 51409be6e8
commit 3f7f31992e
4 changed files with 43 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
+25
View File
@@ -0,0 +1,25 @@
---
title: "Report"
output: html_document
---
```{r setup, include=FALSE}
library(ggplot2)
knitr::opts_chunk$set(echo = TRUE)
df <- read.csv("../data.csv", header = F)
colnames(df) <- c("date", "name", "topic", "humidity", "temperature", "presure", "battery", "voltage", "linkquality")
df$date <- as.POSIXct(df$date)
```
## Humidity
```{r}
p_humidity <- ggplot(df, aes(x=date, y=humidity, group=name, color=name)) + geom_line()
p_humidity
```
## Temperature
```{r}
p_temperature <- ggplot(df, aes(x=date, y=temperature, group=name, color=name)) + geom_line()
p_temperature
```
+3
View File
@@ -0,0 +1,3 @@
# Compiles the markdown report into an html file
# run for the first time install.packages("rmarkdown")
Rscript -e 'library(rmarkdown); rmarkdown::render("report.Rmd", "html_document")'