R/code.R

Defines functions code_lines

Documented in code_lines

code_lines <- function(path = ".", comment = "#") {
  f <- list.files(path = path)
  f <- unlist(lapply(f, readLines))
  f <- gsub(" ", "", f, fixed = TRUE)
  f <- f[substr(f, 1, nchar(comment)) != comment]
  f <- f[f != ""]
  length(f)
}

Try the jss package in your browser

Any scripts or data that you put into this service are public.

jss documentation built on Sept. 9, 2022, 3:09 p.m.