## ----dir-tree-----------------------------------------------------------------
library (srr)
d <- srr_stats_pkg_skeleton (pkg_name = "package")
fs::dir_tree (d)

## ----test-file-dummy, eval = FALSE--------------------------------------------
# readLines (file.path (d, "R", "test.R"))

## ----test-file, echo = FALSE--------------------------------------------------
print (readLines (file.path (d, "R", "test.R")), width = 20)

## ----skeleton-output1-compile, eval = TRUE, echo = FALSE, message = FALSE, results = "hide"----
# need to run once to compile /src so compile output does not appear on 2nd time
pkgbuild::compile_dll (d)

## ----skeleton-output-dummy, eval = FALSE, echo = TRUE, collapse = TRUE--------
# roxygen2::roxygenise (d)

## ----skeleton-output, eval = TRUE, echo = FALSE, message = TRUE, collapse = TRUE----
roxygen2::roxygenise (d)

## ----roxygen, eval = FALSE----------------------------------------------------
# Roxygen: list (markdown = TRUE, roclets = c ("namespace", "rd", "srr::srr_stats_roclet"))

## -----------------------------------------------------------------------------
   #' @srrstats {G1.0} as well as {G1.1}.

## -----------------------------------------------------------------------------
#' @srrstats {G1.0} as well as
#' @srrstats {G1.1}

## ----doc-ex-with-fn-----------------------------------------------------------
#' @srrstats G1.0 This standard belongs here
#' @noRd
myfunction <- function (...) {
    # ...
}

## ----doc-ex-with-null, eval = FALSE-------------------------------------------
# #' @srrstats G1.0 This standard belongs here
# #' @noRd
# NULL

## ----tests-ex-dummy, eval = FALSE---------------------------------------------
# readLines (file.path (d, "tests", "testthat", "test-a.R"))

## ----tests-ex, echo = FALSE---------------------------------------------------
print (readLines (file.path (d, "tests", "testthat", "test-a.R")),
       width = 20)

## ----src-ex-dummy, eval = FALSE-----------------------------------------------
# readLines (file.path (d, "src", "cpptest.cpp"))

## ----src-ex, echo = FALSE-----------------------------------------------------
print (readLines (file.path (d, "src", "cpptest.cpp")), width = 20)

## ----readme-ex----------------------------------------------------------------
readLines (file.path (d, "README.Rmd"))

## ----na-block, eval = FALSE---------------------------------------------------
# #' NA_standards
# #'
# #' @srrstatsNA {S3.3} is not applicable
# #' @noRd
# NULL

## ----dl-stds-fakey, echo = TRUE, eval = FALSE---------------------------------
# srr_stats_roxygen (category = "regression", # for example
#                    filename = file.path (d, "R", "srr-stats-standards.R"),
#                    overwrite = TRUE)

## ----dl-stds, echo = FALSE, eval = TRUE, collapse = TRUE----------------------
srr_stats_roxygen (category = "regression", # for example
                   filename = file.path (d, "R", "srr-stats-standards.R"),
                   overwrite = TRUE)

## ----mixed-tags-fakey, echo = TRUE, eval = FALSE------------------------------
# roxygen2::roxygenise (d)

## ----mixed-tags, echo = FALSE, eval = TRUE, error = TRUE, collapse = TRUE-----
try({
roxygen2::roxygenise (d)
})

