funcMapper

R package designed to visualise all user-defined functions in a given R script, along with any other user-defined functions they depend on. This tool helps users understand how functions are interconnected within a codebase.

https://github.com/antoniof1704/funcmapper

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.9%) to scientific vocabulary

Keywords

dependencies-graph funcmapper mapping package r user-functions
Last synced: 6 months ago · JSON representation

Repository

R package designed to visualise all user-defined functions in a given R script, along with any other user-defined functions they depend on. This tool helps users understand how functions are interconnected within a codebase.

Basic Info
  • Host: GitHub
  • Owner: antoniof1704
  • License: other
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 131 KB
Statistics
  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
dependencies-graph funcmapper mapping package r user-functions
Created 8 months ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.md

funcMapper

CRAN version R-CMD-check CRAN Downloads License: MIT

Overview

funcMapper is an R package designed to visualise all user-defined functions in a given R script, along with any other user-defined functions they depend on. This tool helps users understand how functions are interconnected within a codebase.

It is especially useful for: - Developers new to a codebase who want to quickly understand how functions are used. - Teams working collaboratively, to track how newly added functions are being utilised. - Developers handing over a project, to provide a clear overview of function dependencies.

Installation

Install the latest version of funcMapper from CRAN with:

r install.packages("funcMapper")

How to Use funcMapper

funcMapper(scriptpath, outputname, outputpath, source = FALSE, cleanuptemp_file = TRUE)

Arguments:

script_path: File path of the R script to analyse (must end with.R).

output_name: Name of the output HTML file (no need to include .html).

output_path: Directory where the HTML file will be saved (do not include a trailing /).

source: Whether to run the script to load functions into the global environment (default is FALSE; set to TRUE if needed). If set to TRUE, the function will fail if the underlying script encounters any errors during execution.

cleanuptempfile: Whether to delete the temporary script file used during mapping (default is TRUE; set to FALSE to retain it).

The function generates an interactive HTML file containing the function map, saved to the specified output_path.

Example Output

Below is an example of the output generated by funcMapper. The map is saved as an HTML file and can be viewed in any browser.

In this example, the script ‘main_script.R’ is used as the entry point and is highlighted in red. The map shows how user-defined functions are interconnected. For instance, the function funcG is called by both funcC and funcD.

Note: You can run funcMapper on any script, not just the main script of a project. However, the script will be wrapped in a function during processing. If the script is already a function, it will be wrapped again.

More Information

  • funcMapper is available on CRAN

  • An introduction to funcMapper is available in the vignette

  • Please report bugs or other issues here.

Owner

  • Name: Antonio Fratamico
  • Login: antoniof1704
  • Kind: user
  • Location: London

Sharing useful code from some of my data science/software engineering projects.

GitHub Events

Total
  • Watch event: 1
  • Push event: 35
Last Year
  • Watch event: 1
  • Push event: 35

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 64
  • Total Committers: 1
  • Avg Commits per committer: 64.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 64
  • Committers: 1
  • Avg Commits per committer: 64.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Antonio Fratamico f****a@o****m 64

Issues and Pull Requests

Last synced: 6 months ago

Packages

  • Total packages: 1
  • Total downloads:
    • cran 362 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: funcMapper

Map User-Created Functions

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 362 Last month
Rankings
Dependent packages count: 25.8%
Dependent repos count: 31.7%
Average: 47.7%
Downloads: 85.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • functiondepends * imports
  • glue * imports
  • htmlwidgets * imports
  • magrittr * imports
  • visNetwork * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests
.devcontainer/Dockerfile docker
  • mcr.microsoft.com/devcontainers/base ubuntu build