extract_function_name {assertHE}R Documentation

Extract function name from a string

Description

Extract function name from a long string. This works by identifying "function(" in the string and then finding the operand before and splitting on that before keeping the character there.

Usage

extract_function_name(string)

Arguments

string

A string containing a function definition, this must contain the word 'function'

Value

A string containing the function name

Examples

extract_function_name("better_name <- function(x){\n more code} asfdas <- function(x){}")
extract_function_name("better_name <- function(x){\n more code}")


[Package assertHE version 1.0.0 Index]