Description Usage Arguments Details Value See Also Examples
View source: R/error_message.R
Plot error messages to let user know his or her data format is wrong.
1 | error_message(h, NL)
|
h |
A non-negative integer vector |
NL |
A positive integer, indicating Number of lesions |
If sum(h) > NL
, then an error message will appear.
The reason why the author uses the
generic funtion plot
for error messages instead
of such as message()
or cat()
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 message()
or 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.