is_bounded | R Documentation |

Check whether a value within a certain interval

is_bounded( x, lower_bound = -Inf, lower_closed = FALSE, upper_bound = Inf, upper_closed = FALSE )

`x` |
A value to be tested |

`lower_bound` |
The lower bound |

`lower_closed` |
Whether the lower bound is closed |

`upper_bound` |
The upper bound |

`upper_closed` |
Whether the upper bound is closed |

## Not run: library(assertthat) assert_that(is_bounded(10)) # TRUE assert_that(is_bounded(10:30)) # TRUE assert_that(is_bounded(Inf)) # Error: Inf is not bounded by (-Inf,Inf) assert_that(is_bounded(10, lower_bound = 20)) # Error: 10 is not bounded by (20,Inf) assert_that(is_bounded( 10, lower_bound = 20, lower_closed = TRUE, upper_bound = 30, upper_closed = FALSE )) # Error: 10 is not bounded by [20,30) ## End(Not run)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.