findFunctionCode: Find rows which, taken together, are a function

View source: R/rstudio-toggle_subsections.R

findFunctionCodeR Documentation

Find rows which, taken together, are a function

Description

Find rows which, taken together, are a function

Usage

findFunctionCode(documentText, row)

Arguments

documentText
row

Examples

documentText <- c(
  "fun1<- function(",
  "a,",
  "b = 1) {a^2}",
  "# blabla",
  "fun2 <- function(",
  "a,",
  "b = 1,",
  "d = c(a,",
  "b)) {
 a + b
 }",
  "1+2",
  "fun3 = function(",
  "a,",
  "b = 1) {a^2}",
  "# blabla"
)
row <- 12
lapply(1:length(documentText), function(i) findFunctionCode(documentText, i))

dlill/conveniencefunctions documentation built on Sept. 30, 2022, 4:40 a.m.