Skip to contents

detects variables names in code

Usage

detect_variable(codeintext)

Arguments

codeintext

a string vector to look for variables

Value

a vector with strings

Examples

string_to_check <- c(
  "ki_age> 1",
  "noo==\"mar\"",
  "sum(var1, var2, na.rm = T)",
  "oks != \"mar2\"",
  "oknospace!=\"mar2\""
)
detect_variable(string_to_check)
#> [1] "ki_age"    "noo"       "var2,"     "oks"       "oknospace"