From f88592a60c0ad68a4b4047a84bbe5d640c78bdd8 Mon Sep 17 00:00:00 2001 From: Markus Graf Date: Mon, 25 Oct 2021 21:41:41 +0200 Subject: [PATCH] Only show the last two days --- data_analysis/report.Rmd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data_analysis/report.Rmd b/data_analysis/report.Rmd index 2cd52d7..4a8282f 100644 --- a/data_analysis/report.Rmd +++ b/data_analysis/report.Rmd @@ -6,13 +6,20 @@ 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) + +now <- Sys.time() +cut_off <- now - (2*60*60*24) +df <- subset(df, date > cut_off) ``` ```{r echo=FALSE} -Sys.time() +now +cut_off ``` ## Humidity