tidycode (version 0.1.0)

unnest_calls: Unnest R calls

Description

Unnest R calls

Usage

unnest_calls(.data, input, drop = TRUE)

Arguments

.data

A data frame

input

Input column that contains an R call or list of R calls to be split into individual functions

drop

logical. Whether the original input column should be dropped.

Value

The original data frame with an additional three columns:

  • line: the line number of the call

  • func: the name of the function called

  • args: a list of arguments

Examples

Run this code
# NOT RUN {
d <- read_rfiles(tidycode_example("example_plot.R"))

# Unnest a model call
d %>%
  unnest_calls(expr)

# Unnest a model call and keep the call itself using the drop parameter
d %>%
  unnest_calls(expr, drop = FALSE)
# }

Run the code above in your browser using DataLab