Plot error messages to let user know his or her data format is wrong.
A non-negative integer vector
A positive integer, indicating Number of lesions
sum(h) > NL, then an error message will appear.
The reason why the author uses the
plot for error messages instead
of such as
is to preserve GUIs in Shiny.
So, this error message is shown in
some plot plane in the Graphical User Interface of Shiny in which
cat() cannot use.
Plot of an error message by the generic function
plot() for Shiny GUI.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#======================================================================================== # If number of hits > number of lesion, then an error message appears. #======================================================================================== # Make an example such that sum(h) > NL, that is, the sum of the number of hits is # greater than the number of lesion, then, it launches an error message. h <- c(50,30,20) NL <- 3 error_message(h,NL) # Then, in an imaging device, an error message appears, because sum(h) = 100 > 3 = NL. # In Shiny, even if plot cannot be done causing some error, Graphical User Interface # can not change (now,... I can but.), so I have to use the graphical user interface. # Thus. in such case, I use this function rather than the message() or cat(). # Who read this? My heart will be more empty when I wrote this mannual. # This function is made in 2019 July, 6. # Doc is reviesed in 2020 Feb
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.