I am relatively new to Shiny, and currently struggling at putting together a simple Shiny app that does the following job:
Have a table with 10 rows and 2 columns (x and y). The table is blank at initiation, and is completely user editable through using library(DT). All the data points are through user inputs. Let's restrict x and y to be only positive numbers.
Have a graph on the right side (or at bottom). Once user finishes inputting 20 values in the table (10 x values & 10 y values), click on an actionbutton, and the graph will ** draw a scatterplot ** using those 10 sets of value points, and fit a line through those points.
If the user wants to make any edits to the table, he/she edits the table directly, and click on the actionbutton again to re-draw a new scatterplot, and re-fit a line.
I am struggling at how to make the user inputs in the table into the inputs of that scatterplot and eventually fit a line through. This task is unlike my previous work, where I only have to build an interactive shiny app using data from an existing dataset (e.g. read a csv).
Much appreciation for your help!