analyse: Analyse the Parse Tree of an R Script

View source: R/analyse.R

analyseR Documentation

Analyse the Parse Tree of an R Script

Description

Analyse the Parse Tree of an R Script

Usage

analyse(x, path = "")

Arguments

x

parse tree as returned by parse

path

for internal use only (when this function is called recursively)

Value

list representing type information on the nodes in the parse tree

Examples

# Parse an R script file (here, a file from kwb.utils)
x <- parse("https://raw.githubusercontent.com/KWB-R/kwb.utils/master/R/log.R")

# Analyse the parse tree (This may take some time!)
result <- kwb.code::analyse(x)

# Show the structure of the result list (only 3 levels!)
str(result, 3)

KWB-R/kwb.code documentation built on July 28, 2023, 5:57 p.m.