crtahlin / medplot

Functions for drawing graphs in R visualizing medical information.
4 stars 2 forks source link

Add catching of errors so they print appropriately #26

Open crtahlin opened 10 years ago

crtahlin commented 10 years ago

Add catching of errors so that:

crtahlin commented 10 years ago

Added if clauses to all tabs that prevent loading of elements, when no data is yet loaded. The "ifs" are very basic and should perhaps be expanded: If a function uses multiple inputs, the ifs should probably be based on all of them - at the moment they are based only on the apparently most "important" input. But this takes relatively a lot of time for little added functionality, so I will delay it. If it is at all needed, since the basic scenario is covered, I guess.

There is another thing, however, that seems to cause errors to be raised. When data is loaded, another set of error messages arises on the GUI, but just for a moment - while R seems to be calculating in the background. I.e, an error "undefined columns selected" on the Timeline tab, after I select "Demo" data. After a second, the error disappears and the plot is drawn. It seems it takes a while for the changes to propagate through the reactive "network". I am not sure how to solve these - perhaps some extra "if" clauses might help, perhaps the "try()" function...

Lowering priority for now, as basic stuff is implemented and the rest can wait after everything else works as it should.