ianmcook
ianmcook

Reputation: 733

R function to detect unused function arguments

I'm looking for an R function that detects all the functions in an R package that have formal arguments that are not used in the body of the function. Does something like this exist?

Upvotes: 1

Views: 130

Answers (1)

user11599
user11599

Reputation: 326

I think the checkUsagePackage("packagename", all=TRUE) in the codetools package should check this. It (among other things) tests "warnings about unused formal parameters". The devtools::check() function might automatically invoke checkUsagePackage().

Upvotes: 3

Related Questions