Skip to contents

A generic function to check whether specific special functions have been used special functions include if, for, while, repeat, break, next, return, function, quote, switch, {, (. Check here for the updated list of special function names.

Usage

check_for_special_functions(filename, func_vector)

Arguments

filename

a character string which is a file name

func_vector

a character vector of special functions. It is best if this is just one or two functions, especially for and while

Value

a numeric count of violations for the specified functions

Examples

example_script("generic_script") |>
  check_for_special_functions(func_vector = "for")
#> [1] 0