powered by
Given a character vector of R expressions, break the vector up into groups of lines, where each group of lines is a valid R expression.
extract_expressions(text_expr)
A character vector.
A list of character vectors, each of which can be evaluated as a valid R expression.
# NOT RUN { text_expr <- c("a <- 1", "fx <- function(x) {", " x + 1", "} # this comment will disappear") extract_expressions(text_expr) # }
Run the code above in your browser using DataLab