Commit 3ac188cf authored by jlopez's avatar jlopez
Browse files

add changepoint temperature

parent 0e8e3143
......@@ -10,6 +10,7 @@ library(broman)
library(randomcoloR)
library(openxlsx)
library(Rcpp)
library(changepoint.np)
source("../tools.R")
sourceCpp("../exstract.cpp")
......
......@@ -14,6 +14,8 @@ tabHome = fluidPage(align="left",
plotOutput("temperature", height = "600px"),
plotOutput("changePointTemperature", height = "600px"),
plotOutput("accX", height = "800px"),
plotOutput("accY", height = "800px"),
......
......@@ -35,12 +35,12 @@ observeEvent(input$runButton, {
if("1" %in% typeD) {
path_temperature <- paste0(root_path, "/logLoRaTemp.csv")
preTraitementTemperature(root_path, path_temperature, mandrill_uuid, timeS, timeE)
mandrill_temperature <- readCSVTemperature(paste0(root_path, "/temperature.csv"))
output$temperature <- renderPlot({
path_temperature <- paste0(root_path, "/logLoRaTemp.csv")
preTraitementTemperature(root_path, path_temperature, mandrill_uuid, timeS, timeE)
mandrill_temperature <- readCSVTemperature(paste0(root_path, "/temperature.csv"))
pathTemperature <- paste0(root_path, "/temperature_ext.xlsx")
if(!file.exists(pathTemperature)) {
......@@ -86,8 +86,20 @@ observeEvent(input$runButton, {
})
output$changePointTemperature <- renderPlot({
v1 = mandrill_temperature$temperature
v1.man=cpt.var(v1,method='PELT',penalty='Manual',pen.value='2*log(n)')
cpts(v1.man)
param.est(v1.man)
p <- plot(v1.man,cpt.width=3)
p
})
} else {
output$temperature <- renderPlot({ plot.new()})
output$changePointTemperature <- renderPlot({ plot.new()})
}
if("2" %in% typeD || "3" %in% typeD || "4" %in% typeD) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment