Map Functions and Scripts in an R Package
checkPkg_map_functions_and_scripts.RdThis function analyzes R scripts within two directories: a function directory (e.g., `R` folder for an R package) and an optional code directory (e.g., `inst/scripts` folder). It maps the relationships between functions and scripts, visualizing the connections in a network diagram and providing a data frame of function calls.
Value
A list with two elements:
vis_plotAn interactive network plot showing the relationships between functions and scripts.
df_to_fromA data frame mapping function-to-function and function-to-script relationships.
Details
The function performs the following steps: 1. Scans the `function_directory` to identify R scripts and extracts all defined functions. 2. Optionally scans the `code_directory` for additional scripts. 3. Maps function calls within and across scripts, creating a data frame of relationships. 4. Visualizes the relationships in an interactive network plot using visNetwork.
The function can be used to understand code dependencies, identify potential redundancies, and visualize how functions and scripts interact within a project.