Skip to content

Instantly share code, notes, and snippets.

@hadley
Last active Jun 23, 2020
Embed
What would you like to do?
# need + validate -----------------------------------------------------------
validate(
need(
mzfinder::check_mzr_object(ms_object$mzr_connection),
"Wasn't able to connect to MS file"
)
)
validate(
need(!is.null(input$ppm_input), "ppm_input must not be null"),
need(input$ppm_input > 0L, "ppm_input must be > 0")
)
# if + validate -----------------------------------------------------------
if (!mzfinder::check_mzr_object(ms_object$mzr_connection)) {
validate("Wasn't able to connect to MS file")
}
if (is.null(input$ppm_input)) {
validate("ppm_input must not be null")
} else if (input$ppm_input <= 0L) {
validate("ppm_input must be > 0")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment