package <- "TestPackage" dir.create(file.path(package, "R"), recursive = TRUE) cat(file = file.path(package, "DESCRIPTION"), " Package: TestPackage Version: 0.0-0 License: GPL (>= 2) Description: A (one paragraph) description of what the package does and why it may be useful. Title: My First Collection of Functions Author: First Last [aut, cre] Maintainer: First Last Imports: Matrix, methods ") cat(file = file.path(package, "NAMESPACE"), " export(zzz) importFrom(methods, setClass) importClassesFrom(Matrix, dgCMatrix, CsparseMatrix) ") cat(file = file.path(package, "R", paste0(package, ".R")), " zzz <- function() double(3L) #setClass(\"whatever\", contains = \"dgCMatrix\") ") tools:::Rcmd(c("build", package)) tools:::Rcmd(c("INSTALL", Sys.glob(paste0(package, "_*.tar.gz")))) ## unlink(Sys.glob(paste0(package, "*")), recursive = TRUE)