Flag invalid points in time-series data table from plot in R Shiny
I am trying to build a Shiny App that will do the following:
- Read a time-series data set from a database (e.g. DateTime, Value, Status), where Status flags whether a point is valid and be plotted
- Create a time-series plot of that data (with only Status = Valid points showing).
- Create a data table in the interface showing the data that are being plotted
- Allow for the user to review the data in the plot and then "flag out" points by setting the Status in the table to invalid
Steps 1-3 above I understand how to do, but I'm looking for suggestions on how to implement the 4th step. Can Shiny have an interactive table where if a user sets the stats flag, it will react and redraw the plot?
The idea here is to make an interactive data cleaning tool for time-series data recorded from an instrument that often will have bad data points in it.
Thanks
r shiny
add a comment |
I am trying to build a Shiny App that will do the following:
- Read a time-series data set from a database (e.g. DateTime, Value, Status), where Status flags whether a point is valid and be plotted
- Create a time-series plot of that data (with only Status = Valid points showing).
- Create a data table in the interface showing the data that are being plotted
- Allow for the user to review the data in the plot and then "flag out" points by setting the Status in the table to invalid
Steps 1-3 above I understand how to do, but I'm looking for suggestions on how to implement the 4th step. Can Shiny have an interactive table where if a user sets the stats flag, it will react and redraw the plot?
The idea here is to make an interactive data cleaning tool for time-series data recorded from an instrument that often will have bad data points in it.
Thanks
r shiny
Your post structure and content are great but a small working example that focuses on the 4th point will help you get answers.
– Shree
Nov 14 '18 at 22:22
add a comment |
I am trying to build a Shiny App that will do the following:
- Read a time-series data set from a database (e.g. DateTime, Value, Status), where Status flags whether a point is valid and be plotted
- Create a time-series plot of that data (with only Status = Valid points showing).
- Create a data table in the interface showing the data that are being plotted
- Allow for the user to review the data in the plot and then "flag out" points by setting the Status in the table to invalid
Steps 1-3 above I understand how to do, but I'm looking for suggestions on how to implement the 4th step. Can Shiny have an interactive table where if a user sets the stats flag, it will react and redraw the plot?
The idea here is to make an interactive data cleaning tool for time-series data recorded from an instrument that often will have bad data points in it.
Thanks
r shiny
I am trying to build a Shiny App that will do the following:
- Read a time-series data set from a database (e.g. DateTime, Value, Status), where Status flags whether a point is valid and be plotted
- Create a time-series plot of that data (with only Status = Valid points showing).
- Create a data table in the interface showing the data that are being plotted
- Allow for the user to review the data in the plot and then "flag out" points by setting the Status in the table to invalid
Steps 1-3 above I understand how to do, but I'm looking for suggestions on how to implement the 4th step. Can Shiny have an interactive table where if a user sets the stats flag, it will react and redraw the plot?
The idea here is to make an interactive data cleaning tool for time-series data recorded from an instrument that often will have bad data points in it.
Thanks
r shiny
r shiny
asked Nov 14 '18 at 22:17
DarwinsBeardDarwinsBeard
2116
2116
Your post structure and content are great but a small working example that focuses on the 4th point will help you get answers.
– Shree
Nov 14 '18 at 22:22
add a comment |
Your post structure and content are great but a small working example that focuses on the 4th point will help you get answers.
– Shree
Nov 14 '18 at 22:22
Your post structure and content are great but a small working example that focuses on the 4th point will help you get answers.
– Shree
Nov 14 '18 at 22:22
Your post structure and content are great but a small working example that focuses on the 4th point will help you get answers.
– Shree
Nov 14 '18 at 22:22
add a comment |
1 Answer
1
active
oldest
votes
Here is a solution using library(DT)
.
Type '0' in the 'plot'-column to remove the datapoint from the plot.
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(DTOutput('myTable'),
plotOutput("myPlot")),
server = function(input, output)
output$tbl = renderDT(iris,
options = list(lengthChange = FALSE),
editable = TRUE)
myData = data.frame(y = 1:10, plot = 1)
output$myTable = renderDT(myData, selection = 'none', editable = TRUE)
proxy = dataTableProxy('myTable')
observeEvent(input$myTable_cell_edit,
info = input$myTable_cell_edit
str(info)
i = info$row
j = info$col
v = info$value
myData[i, j] <<- DT::coerceValue(v, myData[i, j])
replaceData(proxy, myData, resetPaging = FALSE) # important
)
output$myPlot <- renderPlot(
input$myTable_cell_edit
plot(myData$y[myData$plot > 0], myData$y[myData$plot > 0])
)
)
For further information see this.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309570%2fflag-invalid-points-in-time-series-data-table-from-plot-in-r-shiny%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is a solution using library(DT)
.
Type '0' in the 'plot'-column to remove the datapoint from the plot.
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(DTOutput('myTable'),
plotOutput("myPlot")),
server = function(input, output)
output$tbl = renderDT(iris,
options = list(lengthChange = FALSE),
editable = TRUE)
myData = data.frame(y = 1:10, plot = 1)
output$myTable = renderDT(myData, selection = 'none', editable = TRUE)
proxy = dataTableProxy('myTable')
observeEvent(input$myTable_cell_edit,
info = input$myTable_cell_edit
str(info)
i = info$row
j = info$col
v = info$value
myData[i, j] <<- DT::coerceValue(v, myData[i, j])
replaceData(proxy, myData, resetPaging = FALSE) # important
)
output$myPlot <- renderPlot(
input$myTable_cell_edit
plot(myData$y[myData$plot > 0], myData$y[myData$plot > 0])
)
)
For further information see this.
add a comment |
Here is a solution using library(DT)
.
Type '0' in the 'plot'-column to remove the datapoint from the plot.
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(DTOutput('myTable'),
plotOutput("myPlot")),
server = function(input, output)
output$tbl = renderDT(iris,
options = list(lengthChange = FALSE),
editable = TRUE)
myData = data.frame(y = 1:10, plot = 1)
output$myTable = renderDT(myData, selection = 'none', editable = TRUE)
proxy = dataTableProxy('myTable')
observeEvent(input$myTable_cell_edit,
info = input$myTable_cell_edit
str(info)
i = info$row
j = info$col
v = info$value
myData[i, j] <<- DT::coerceValue(v, myData[i, j])
replaceData(proxy, myData, resetPaging = FALSE) # important
)
output$myPlot <- renderPlot(
input$myTable_cell_edit
plot(myData$y[myData$plot > 0], myData$y[myData$plot > 0])
)
)
For further information see this.
add a comment |
Here is a solution using library(DT)
.
Type '0' in the 'plot'-column to remove the datapoint from the plot.
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(DTOutput('myTable'),
plotOutput("myPlot")),
server = function(input, output)
output$tbl = renderDT(iris,
options = list(lengthChange = FALSE),
editable = TRUE)
myData = data.frame(y = 1:10, plot = 1)
output$myTable = renderDT(myData, selection = 'none', editable = TRUE)
proxy = dataTableProxy('myTable')
observeEvent(input$myTable_cell_edit,
info = input$myTable_cell_edit
str(info)
i = info$row
j = info$col
v = info$value
myData[i, j] <<- DT::coerceValue(v, myData[i, j])
replaceData(proxy, myData, resetPaging = FALSE) # important
)
output$myPlot <- renderPlot(
input$myTable_cell_edit
plot(myData$y[myData$plot > 0], myData$y[myData$plot > 0])
)
)
For further information see this.
Here is a solution using library(DT)
.
Type '0' in the 'plot'-column to remove the datapoint from the plot.
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(DTOutput('myTable'),
plotOutput("myPlot")),
server = function(input, output)
output$tbl = renderDT(iris,
options = list(lengthChange = FALSE),
editable = TRUE)
myData = data.frame(y = 1:10, plot = 1)
output$myTable = renderDT(myData, selection = 'none', editable = TRUE)
proxy = dataTableProxy('myTable')
observeEvent(input$myTable_cell_edit,
info = input$myTable_cell_edit
str(info)
i = info$row
j = info$col
v = info$value
myData[i, j] <<- DT::coerceValue(v, myData[i, j])
replaceData(proxy, myData, resetPaging = FALSE) # important
)
output$myPlot <- renderPlot(
input$myTable_cell_edit
plot(myData$y[myData$plot > 0], myData$y[myData$plot > 0])
)
)
For further information see this.
edited Nov 14 '18 at 23:42
answered Nov 14 '18 at 23:32
ismirsehregalismirsehregal
1,7601212
1,7601212
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309570%2fflag-invalid-points-in-time-series-data-table-from-plot-in-r-shiny%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your post structure and content are great but a small working example that focuses on the 4th point will help you get answers.
– Shree
Nov 14 '18 at 22:22