R Shiny Tutorial | brushedPoints | interactive plots | remove outlier data points using brush(2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 10

  • @leizelmadueno919
    @leizelmadueno919 4 ปีที่แล้ว

    Hi, thank you for this post. It's helpful since I am new to Shiny. I followed the script you shared and it works, but i also want to create a new csv file or a new dataframe where the "Updated Dataset" goes to. How to do this? Thank you!

    • @abhinavagrawal6317
      @abhinavagrawal6317  4 ปีที่แล้ว +1

      Sure, let me get a working example for you.. Ty Abi

    • @leizelmadueno919
      @leizelmadueno919 4 ปีที่แล้ว

      @@abhinavagrawal6317 the mtcars dataset could work

  • @kshitijkolas
    @kshitijkolas 4 ปีที่แล้ว

    Can we delete points on a plot generated by plotly or ggplotly? I want the user to be able to select some points on the graph by box select, lasso select or click select and be able to delete those from the graph

    • @abhinavagrawal6317
      @abhinavagrawal6317  4 ปีที่แล้ว

      Yes, possible.

    • @abhinavagrawal6317
      @abhinavagrawal6317  4 ปีที่แล้ว

      Yes, possible

    • @kshitijkolas
      @kshitijkolas 4 ปีที่แล้ว

      @@abhinavagrawal6317 can you suggest me some ideas on how to do it?

    • @kshitijkolas
      @kshitijkolas 4 ปีที่แล้ว

      I tried using, plotly_brush. I am able to select the data and able to extract those selected points into a table. But not able to delete them.

    • @abhinavagrawal6317
      @abhinavagrawal6317  4 ปีที่แล้ว

      Not sure what could be the problem as without seeing the code very hard to advise. Below approach should help you..
      Use reactive events and assign the original dataset to it so that any changes on it reflects on data through out the app
      Use event data function along with plotly_selected & drag mode as lasso in the plotly to select the graph data point you want to remove. You can use any other form of events such as click, bd click, hover etc.... too
      Capture the meta data info from the selected points and use this to extract corresponding rows of data from the original dataset so you can remove it
      Delete the rows identified
      Result will be the selected data points will be removed from the dataset
      Let me know how it goes.