This package allows you to parse your R scripts and to calculate some staticstics on your code.
Install the package from Github:
#install.packages("remotes")
remotes::install_github("kwb-r/kwb.code")
If you have a lot of R scripts and you want to know what different packages are loaded from within your scripts, you may use the function get_names_of_used_packages
:
# Set path to directory in which to look recursively for R scripts
root_dir <- "~/Desktop/R-Development"
# Get the names of used packages
packages <- kwb.code::get_names_of_used_packages(root_dir)
# Show the names of the packages
packages
Release: https://kwb-r.github.io/kwb.code
Development: https://kwb-r.github.io/kwb.code/dev