Only show the last two days
This commit is contained in:
@@ -6,13 +6,20 @@ output: html_document
|
|||||||
```{r setup, include=FALSE}
|
```{r setup, include=FALSE}
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
knitr::opts_chunk$set(echo = TRUE)
|
knitr::opts_chunk$set(echo = TRUE)
|
||||||
|
|
||||||
df <- read.csv("../data.csv", header = F)
|
df <- read.csv("../data.csv", header = F)
|
||||||
colnames(df) <- c("date", "name", "topic", "humidity", "temperature", "presure", "battery", "voltage", "linkquality")
|
colnames(df) <- c("date", "name", "topic", "humidity", "temperature", "presure", "battery", "voltage", "linkquality")
|
||||||
|
|
||||||
df$date <- as.POSIXct(df$date)
|
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}
|
```{r echo=FALSE}
|
||||||
Sys.time()
|
now
|
||||||
|
cut_off
|
||||||
```
|
```
|
||||||
|
|
||||||
## Humidity
|
## Humidity
|
||||||
|
|||||||
Reference in New Issue
Block a user