Action Button to Add Data to Dataframe -- Warning: Error in data.frame: arguments imply differing number of rows: 0, 1

I was thinking to try and help you by debugging, but I'm afraid you've made it very awkward by how you have provided your set up. Put simply you've left it to us to figure what libraries you are dependent on

library(shiny)
library(shinycssloaders)
library(tidyverse)
library(plotly)

Then I tried to run the app. I have to add the shiny boiler plate shinyApp(ui, server)
ok not so bad, lets get into the app.

the app immediately errors

Warning: Error in : 'Data/Source Data/Attendance.csv' does not exist in current working directory ('C:/Users/NirGraham/Documents/R')

ok. this app assumes all sorts of things about paths on my local machine , I give up.

Here is a general Shiny debugging and reprex guide you might benefit from, and my advice is
a) use shiny::devmode() before running your app, as it often improved the error messages shiny gives you.
b) your error relates to data.frame construction so identify where in your code a data.frame might be being constructed, and use print()'s or browser()'s to snoop on the objects involved in the data.frame creation, they might be malformed / not what you expect.
Often in shiny an input isnt set and should be skipped with a silent failure by use of req() to avoid the bad cases.

Good luck !

1 Like