Skip to content

Instantly share code, notes, and snippets.

@gu-mi
Created May 12, 2014 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gu-mi/d0301a259ebe926f3bdd to your computer and use it in GitHub Desktop.
Save gu-mi/d0301a259ebe926f3bdd to your computer and use it in GitHub Desktop.
replace @S3method with @export
# http://trinkerrstuff.wordpress.com/2014/05/12/handling-s3methods-death-in-roxygen-4-0-0/
pth <- "C:/Users/trinker/qdap/R"
fls <- file.path(pth, dir(pth))
FUN <- function(x) {
cont <- readLines(x)
cont[grepl("#' @S3", cont)] <- "#' @export"
cont[length(cont) + 1] <- ""
cat(paste(cont, collapse="\n"), file=x)
}
lapply(fls, FUN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment