Description Usage Arguments See Also Examples
Prints out the type hint restrictions for a function in the R console, based on the type hint comments within the function' body.
1 | show_typehints(fun, color = "#bd0245")
|
fun |
The function of which the type hint checks will be shown. |
color |
Color of the output in standard hex RGB format, default is |
Other typehint:
check_types()
,
typehint
1 2 3 4 5 6 7 8 9 | celsius_to_fahrenheit <- function(degrees_celsius) {
#| degrees_celsius numeric dim(1) not(NA, NULL)
if(check_types()) return(degrees_celsius * 9/5 + 32)
else return(NA)
}
show_typehints(celsius_to_fahrenheit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.