data frame not available outside observe event

Thanks for sharing your code, but it would be much easier to help you if you constructed a small reproducible example (reprex) that contains only the part of the code that is causing your problem.

In terms of your described problem, try creating a small Shiny app using a built-in data set like mtcars and a minimal set of inputs and transformations to reproduce the problem you've encountered.