Hi,
Here is an attempt of mine using regex. I'm sure there will be glitches in this, especially with the tidyverse and the way it creates variables, but at least it's a start I guess. I had a lot of fun coding it 
scriptToExamine.R
library(stringr)
library(dplyr)
checkScriptVars = function(script){
myScript = readLines(script)
#Remove Quoted text with "" or ''
myScript = str_remove_all(myScript, "[\\\\]+\\\"")
myScript = str_remove_all(myScript, "\"[^\"]+\"")
myScript = str_remove_all(myScript, "[\\\\]+\'")
myScript = str_remove_all(myScript, "'[^']+'")
# Remove comment lines
myScript = str_remove_all(myScript, "#.*")
#Merge script into one long string
myScript = paste(myScript, collapse = " ")
#Get the variable names
vars = str_extract_all(myScript, '.\\s*[\\w\\.]+\\s*(<-|=)\\s*[^\\s\\(]+') %>% unlist()
vars = vars[!str_detect(vars, "^,")]
vars = str_match(vars, "([^\\s\\(]+)\\s*(<-|=)\\s*([^\\(]+)") %>% as.data.frame()
vars = vars %>% filter(V4 != "function") %>% pull(V2) %>% unique()
#Get the argument names from custom functions
args = str_match_all(myScript, "function\\(([^\\)]+)\\)")[[1]][,2]
args = str_match_all(args, "(^\\s*|\\s*,\\s*)([^\\s,]+)")
args = sapply(args, function( arg ) arg[,3]) %>% unlist() %>% as.character() %>% unique()
return(data.frame(name = c(vars, args), type = c(rep("var", length(vars)), rep("arg", length(args)))))
}
script = "scriptToExamine.R"
checkScriptVars(script)
In this example, I go meta and examine the script itself on variables and custom function arguments. The output looks like this:
name type
1 myScript var
2 vars var
3 args var
4 name var
5 script var
6 script arg
7 arg arg
Argument here defines only arguments from custom functions. I also made sure to remove all comments and quoted text, because they can have text that looks like a variable assignment, but would not count towards your coding standards.
Let me know what you think 
PJ