ramon vazquez
ramon vazquez

Reputation: 5

identify and remove unused functions in a big project

I am trying to clean the workspace in an R project because it is getting quite big in terms of funtions produced

I have checked that this can be done with the package 'mvbutils' and the function 'foodweb()', but when trying to use it I get the following errors

>library(mvbutils)
>result <- foodweb(plotting=FALSE)
>res <- sapply(rownames(result$funmat), function(n) length(callers.of(n)))
Error in fw %is.a% "foodweb" : 
  argument "fw" is absent, no omission value
>callers.of('function_name')
Error in fw %is.a% "foodweb" : 
  argument "fw" is absent, no omission value

any help?

thanks a lot in advance, Ramón

Upvotes: 0

Views: 63

Answers (1)

Nir Graham
Nir Graham

Reputation: 5167

library(mvbutils)
result <- foodweb(plotting=FALSE)
res <- sapply(rownames(result$funmat), function(n) length(callers.of(n,result)))

Upvotes: 0

Related Questions