Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/MangoTheCat/functionMap

Draw the functions map for a R package
https://github.com/MangoTheCat/functionMap

Last synced: 9 days ago
JSON representation

Draw the functions map for a R package

Awesome Lists containing this project

README

        

# functionMap

> Function Map of an R Package

[![Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip)
[![Linux Build Status](https://travis-ci.org/MangoTheCat/functionMap.svg?branch=master)](https://travis-ci.org/MangoTheCat/functionMap)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/github/MangoTheCat/functionMap?svg=true)](https://ci.appveyor.com/project/gaborcsardi/functionMap)
[![](http://www.r-pkg.org/badges/version/functionMap)](http://www.r-pkg.org/pkg/functionMap)
[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/functionMap)](http://www.r-pkg.org/pkg/functionMap)
[![Coverage Status](https://img.shields.io/codecov/c/github/MangoTheCat/functionMap/master.svg)](https://codecov.io/github/MangoTheCat/functionMap?branch=master)

Extract all function calls from an R package, or a set of R
scripts. Create a network of functions that can be then visualized.
Can also extract the places of the function definitions and function
calls and export them in a 'JSON' file.

## Installation

```r
source("https://raw.githubusercontent.com/MangoTheCat/remotes/master/install-github.R")$value("mangothecat/functionMap")
```

## Usage

```r
library(functionMap)
```

Use the `map_r_script` to map a single R script, `map_r_folder` to
recursively map a folder of R files, or `map_r_package` to map an
R package.

All three functions return a `function_map` object, that can be
printed, exported and visualized.

### Pretty printing

The default `function_map` `print` method lists the function calls
in a nice form. For packages, exported functions are marked with a
star, and calls to other packages are highlighted with a different
color.

## License

GPL 2 © [Mango Solutions](https://github.com/mangothecat)