diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index 840c431..0000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macos-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v3 - - - name: git config user.name - run: git config --global user.name "atime GitHub Actions" - - - name: git config user.email - run: git config --global user.email toby.hocking@r-project.org - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - name: Install R Package Build Dependencies on MacOS, from https://github.com/stan-dev/cmdstanr/pull/1072/files - if: ${{ runner.os == 'macOS' }} - uses: r-hub/actions/setup-r-sysreqs@v1 - with: - type: 'minimal' - - - name: install git2r - shell: bash - run: R -e 'install.packages("git2r",type="source",repos="http://cloud.r-project.org")' - - - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml deleted file mode 100644 index f184c43..0000000 --- a/.github/workflows/build-docs.yaml +++ /dev/null @@ -1,31 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -name: Build docs - -jobs: - litedown: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - - name: Install package - run: R CMD build . && R CMD INSTALL *.tar.gz - - name: Fuse site - run: R -e 'litedown::fuse_site("site")' - - name: netlify deploy - uses: animint/animint-actions/netlify-deploy-comment@main - with: - netlify_auth_token: ${{ secrets.NETLIFY_AUTH_TOKEN }} - netlify_site_id: ${{ secrets.NETLIFY_SITE_ID }} - pat_github_pr: ${{ secrets.PAT_GITHUB_PR }} - path: site - netlify_url: atime-docs.netlify.app diff --git a/.github/workflows/cml.yml b/.github/workflows/cml.yml new file mode 100644 index 0000000..cd05273 --- /dev/null +++ b/.github/workflows/cml.yml @@ -0,0 +1,22 @@ +name: update comment +on: [pull_request] +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: comment + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.number }} + run: | + ISSUES_API=https://api.github.com/repos/$GITHUB_REPOSITORY/issues + CURL='curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2026-03-10"' + PR_API=$ISSUES_API/$PR_NUMBER/comments + FIRST_COMMENT_ID=$($CURL $PR_API?per_page=1 | grep '"id"' | head -1 | sed s/[^0-9]//g) + if [ "$FIRST_COMMENT_ID" == "" ]; then CMD=$PR_API; else CMD=$ISSUES_API/comments/$FIRST_COMMENT_ID; fi; echo $CMD + IURL=$(curl -F "file=@README-figure.png" -F "visibility=unlisted" https://picrd.com/api/upload | sed 's/.*image_url":"//' | sed 's/",".*//') + echo "[![tests-preview-facet.png]($IURL)](https://github.com) is the first comment from json" > comment.md + MD=$(sed 's/"/\\"/g' comment.md | awk '$1=$1' ORS='\\n') + echo '{"body":"'$MD'"}' > pr-comment.json + $CURL -X PATCH -H "Authorization: Bearer $TOKEN" $CMD -d "@pr-comment.json" diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index a2720dd..0000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: test-coverage - -jobs: - test-coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - - - name: git config user.name # user name and email required for committing in git2r tests. - run: git config --global user.name "atime GitHub Actions" - - - name: git config user.email - run: git config --global user.email toby.hocking@r-project.org - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::covr - needs: coverage - - - name: Test coverage - run: | - covr::codecov( - quiet = FALSE, - clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") - ) - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index fdefbdb..7cc520e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,14 @@ Package: atime Type: Package Title: Asymptotic Timing -Version: 2026.5.29 +Version: 2026.5.30 Depends: R (>= 3.5.0) Authors@R: c( - person("Toby", "Hocking", - email="toby.hocking@r-project.org", - role=c("aut", "cre"))) + person("Toby", "Hocking", + email="toby.hocking@r-project.org", + role=c("aut", "cre"), + comment = c(ORCID="0000-0002-3146-0865")) + ) Description: Computing and visualizing comparative asymptotic timings of different algorithms and code versions. Also includes functionality for comparing empirical timings with @@ -17,7 +19,8 @@ Description: Computing and visualizing comparative License: GPL-3 URL: https://github.com/tdhock/atime, https://atime-docs.netlify.app BugReports: https://github.com/tdhock/atime/issues -Imports: data.table, bench, lattice, git2r, utils, stats, grDevices +Imports: data.table, bench, lattice, gert, utils, stats, grDevices +SystemRequirements: git command line program Suggests: directlabels, ggplot2, diff --git a/NEWS b/NEWS index c476c09..1ff759c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +Changes in version 2026.5.30 + +- switched from git2r to gert for running git from R. +- atime_pkg() now works with repos that have sub-modules, via system("git submodule update --init --recursive"). +- atime_pkg() now uses label "install" instead of "CRAN" when installed version does not match CRAN version. +- .ci/atime/tests.R can define base.ref="main" for repos where the default branch is not named master. +- .ci/atime/tests.R can define remove.units="kilobytes" for repos where memory benchmarking results should be hidden. +- atime_pkg_test_info() bugfix when pkg is not on CRAN. + Changes in version 2026.5.29 - atime_pkg() now uses only a common subset of columns of the measurements table from each test, so that each test can have different units to analyze. diff --git a/R/test.R b/R/test.R index 26eab73..d4ccb3f 100644 --- a/R/test.R +++ b/R/test.R @@ -35,6 +35,11 @@ atime_pkg_plot_files <- function(out.dir, test.info, pkg.results){ issue <- character() for(Test in names(pkg.results)){ atime.list <- pkg.results[[Test]] + if(is.character(test.info$remove.units)){ + keep <- !atime.list$unit.col.vec %in% test.info$remove.units + ## don't use setdiff() here because it drops names. + atime.list$unit.col.vec <- atime.list$unit.col.vec[keep] + } best.list <- atime::references_best(atime.list) ref.dt <- best.list$ref[each.sign.rank==1] sec.dt <- best.list$meas[unit=="seconds"] @@ -309,42 +314,49 @@ atime_pkg_test_info <- function(pkg.path=".", tests.dir=NULL){ pkg.DESC <- file.path(pkg.path, "DESCRIPTION") DESC.mat <- read.dcf(pkg.DESC) Package <- DESC.mat[,"Package"] - repo <- git2r::repository(pkg.path) - HEAD.commit <- git2r::revparse_single(repo, "HEAD") + HEAD.commit <- gert::git_commit_id("HEAD",pkg.path) sha.vec <- c() - HEAD.name <- paste0("HEAD=",git2r::repository_head(repo)$name) - sha.vec[[HEAD.name]] <- git2r::sha(HEAD.commit) - installed_version <- tryCatch(paste(packageVersion(Package)), error=function(e)NULL) - if(!is.null(installed_version)){ - CRAN.name <- paste0("CRAN=", installed_version) - sha.vec[[CRAN.name]] <- "" - }else{ + HEAD.name <- paste0("HEAD=", gert::git_branch(pkg.path)) + sha.vec[[HEAD.name]] <- HEAD.commit + installed_version <- tryCatch(paste(packageVersion(Package)), error=function(e)"(not installed)") + ap <- utils::available.packages() + installed_name <- "installed" + if(Package %in% rownames(ap)){ + CRAN_version <- ap[Package,"Version"] + if(identical(CRAN_version, installed_version)){ + installed_name <- "CRAN" + }else{ + warning(sprintf( + "CRAN version=%s but installed version=%s fix via install.packages('%s')", + CRAN_version, installed_version, Package)) + } + } + if(identical(installed_version, "(not installed)")){ CRAN.name <- NA_character_ + }else{ + CRAN.name <- paste0(installed_name, "=", installed_version) + sha.vec[[CRAN.name]] <- "" } - ap <- utils::available.packages() - CRAN_version <- ap[Package,"Version"] - if(!identical(CRAN_version, installed_version)){ - warning(sprintf( - "CRAN version=%s but installed version=%s fix via install.packages('%s')", - CRAN_version, installed_version, Package)) + if(is.null(test.env$base.ref)){ + test.env$base.ref <- Sys.getenv("GITHUB_BASE_REF", "master") } - base.ref <- Sys.getenv("GITHUB_BASE_REF", "master") base.commit <- tryCatch({ - git2r::revparse_single(repo, base.ref) + gert::git_commit_info(test.env$base.ref, pkg.path)$id }, error=function(e){ NULL }) - base.name <- paste0("base=",base.ref) - if(git2r::is_commit(base.commit)){ - add_if_new <- function(name, commit.obj){ - sha <- git2r::sha(commit.obj) - if(!sha %in% sha.vec){ - sha.vec[[name]] <<- sha + base.name <- paste0("base=", test.env$base.ref) + if(is.character(base.commit)){ + maybe.new.list <- list() + maybe.new.list[[base.name]] <- base.commit + maybe.new.list[["merge-base"]] <- gert::git_merge_find_base( + base.commit, "HEAD", pkg.path) + for(maybe.new.name in names(maybe.new.list)){ + maybe.new.sha <- maybe.new.list[[maybe.new.name]] + if(!maybe.new.sha %in% sha.vec){ + sha.vec[[maybe.new.name]] <- maybe.new.sha } } - add_if_new(base.name, base.commit) - mb.commit <- git2r::merge_base(HEAD.commit, base.commit) - add_if_new("merge-base", mb.commit) } abbrev2name <- c( HEAD=HEAD.name, diff --git a/R/versions.R b/R/versions.R index 9eeb7a4..070cc67 100644 --- a/R/versions.R +++ b/R/versions.R @@ -57,11 +57,10 @@ atime_versions_install <- function(Package, pkg.path, new.Package.vec, sha.vec, ## on GH actions windows tempfile() gives C:\Users\RUNNER~1\AppData\Local\Temp\Rtmpc9T5Us/working_dir\Rtmpu23suf\file5d41af35765 tdir <- normalizePath(tempfile(), mustWork=FALSE) dir.create(tdir) - ## pkg.path may be path/to/repo/pkg + ## pkg.path may be in a sub-dir of git repo: path/to/repo/pkg norm.pkg.path <- normalizePath(pkg.path) - orig.repo <- git2r::repository(norm.pkg.path) ## path/to/repo root without trailing /.git - orig.repo.path <- normalizePath(dirname(orig.repo$path)) + orig.repo.path <- normalizePath(gert::git_info(pkg.path)$path) ## /pkg pkg.suffix.in.repo <- sub(orig.repo.path, "", norm.pkg.path, fixed=TRUE) for(new.i in which(new.not.installed)){ @@ -78,14 +77,21 @@ atime_versions_install <- function(Package, pkg.path, new.Package.vec, sha.vec, }else{ new.repo.path <- file.path(tdir, new.Package) unlink(new.repo.path, recursive=TRUE, force=TRUE) - repo <- git2r::clone(orig.repo.path, new.repo.path, progress=FALSE) + gert::git_clone(orig.repo.path, new.repo.path) + gert::git_branch_create(#and checkout + "atime-versions-testing", sha, repo=new.repo.path) + if(TRUE){ + old.wd <- setwd(new.repo.path) + system("git submodule update --init --recursive") + setwd(old.wd) + }else{ + submodule_tib <- gert::git_submodule_list(new.repo.path) + for(sub.i in seq_along(submodule_tib$name)){ + gert::git_submodule_init( + submodule_tib$name[sub.i], overwrite=TRUE, repo=new.repo.path) + } + } new.pkg.path <- paste0(new.repo.path, pkg.suffix.in.repo) - tryCatch( - git2r::checkout(repo, branch=sha, force=TRUE), - error=function(e)stop( - e, " when trying to checkout ", sha)) - ## before editing and installing, make sure directory has sha - ## suffix, for windows checks. unlink(file.path(new.pkg.path, "src", "*.o")) pkg.edit.fun( old.Package=Package, diff --git a/man/atime_pkg.Rd b/man/atime_pkg.Rd index 7a55a8d..20bc37e 100644 --- a/man/atime_pkg.Rd +++ b/man/atime_pkg.Rd @@ -87,9 +87,8 @@ if(FALSE){ ## Clone binsegRcpp, and checkout a branch which has performance tests. tdir <- tempfile() dir.create(tdir) - git2r::clone("https://github.com/tdhock/binsegRcpp", tdir) - repo <- git2r::repository(tdir) - git2r::checkout(repo, "another-branch") + gert::git_clone("https://github.com/tdhock/binsegRcpp", tdir) + gert::git_branch_checkout("another-branch", repo=tdir) ## Run one test. info.env <- atime::atime_pkg_test_info(tdir) diff --git a/man/atime_versions.Rd b/man/atime_versions.Rd index 291eee1..62a1b68 100644 --- a/man/atime_versions.Rd +++ b/man/atime_versions.Rd @@ -53,7 +53,7 @@ atime_versions( Each version should be either \code{""} (to use currently installed version of package, or if missing, install most recent version from CRAN) or a SHA1 hash, which is passed as branch - arg to \code{git2r::checkout}; version names used to identify/interpret + to git checkout; version names used to identify/interpret the output/plots. } \value{list of class atime with elements \code{seconds.limit} (numeric @@ -72,7 +72,7 @@ if(FALSE){ tdir <- tempfile() dir.create(tdir) - git2r::clone("https://github.com/tdhock/binsegRcpp", tdir) + gert::git_clone("https://github.com/tdhock/binsegRcpp", tdir) atime.list <- atime::atime_versions( pkg.path=tdir, setup={ @@ -89,7 +89,7 @@ if(FALSE){ gdir <- tempfile() dir.create(gdir) - git2r::clone("https://github.com/tdhock/grates", gdir) + gert::git_clone("https://github.com/tdhock/grates", gdir) glist <- atime::atime_versions( file.path(gdir,"pkg"), current = "1aae646888dcedb128c9076d9bd53fcb4075dcda", diff --git a/man/atime_versions_exprs.Rd b/man/atime_versions_exprs.Rd index 1e223a1..f6f530a 100644 --- a/man/atime_versions_exprs.Rd +++ b/man/atime_versions_exprs.Rd @@ -38,7 +38,7 @@ Each version should be either \code{""} (to use currently installed version of package, or if missing, install most recent version from CRAN) or a SHA1 hash, which is passed as branch - arg to \code{git2r::checkout}; version names used to identify/interpret + arg to git checkout; version names used to identify/interpret the output/plots. Each version is installed as a separate package (to whatever R library is first on \code{.libPaths()}), @@ -63,7 +63,7 @@ if(FALSE){ if(requireNamespace("changepoint")){ tdir <- tempfile() dir.create(tdir) - git2r::clone("https://github.com/tdhock/binsegRcpp", tdir) + gert::git_clone("https://github.com/tdhock/binsegRcpp", tdir) expr.list <- atime::atime_versions_exprs( pkg.path=tdir, expr=binsegRcpp::binseg_normal(data.vec, max.segs), diff --git a/tests/testthat/test-versions.R b/tests/testthat/test-versions.R index 61289a9..c409756 100644 --- a/tests/testthat/test-versions.R +++ b/tests/testthat/test-versions.R @@ -2,7 +2,7 @@ library(data.table) library(testthat) tdir <- tempfile() dir.create(tdir) -git2r::clone("https://github.com/tdhock/binsegRcpp", tdir) +gert::git_clone("https://github.com/tdhock/binsegRcpp", tdir) test_that("error if no versions specified", { expect_error({ atime.list <- atime::atime_versions( @@ -30,11 +30,10 @@ test_that("atime_versions_exprs error when expr does not contain pkg:", { }) if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png and tests_preview_facet.png on atime-test-funs", { - repo <- git2r::repository(tdir) ## https://github.com/tdhock/binsegRcpp/tree/atime-test-funs atime.dir <- file.path(tdir, ".ci", "atime") unlink(file.path(atime.dir, "*")) - git2r::checkout(repo, branch="test-setup-HEAD", force=TRUE) + gert::git_branch_checkout("test-setup-HEAD", force=TRUE, repo=tdir) options(repos="http://cloud.r-project.org")#required to check CRAN version. plist <- atime::atime_pkg(tdir, ".ci") tests.RData <- file.path(atime.dir, "tests.RData") @@ -68,11 +67,10 @@ if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png }) if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png and tests_preview_facet.png on another-branch", { - repo <- git2r::repository(tdir) ## https://github.com/tdhock/binsegRcpp/tree/another-branch inst.atime <- file.path(tdir, "inst", "atime") unlink(file.path(inst.atime, "*")) - git2r::checkout(repo, branch="another-branch", force=TRUE) + gert::git_branch_checkout("another-branch", force=TRUE, repo=tdir) options(repos="http://cloud.r-project.org")#required to check CRAN version. plist <- atime::atime_pkg(tdir) tests_all_facet.png <- file.path(inst.atime, "tests_all_facet.png") @@ -86,10 +84,9 @@ if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png }) if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png and tests_preview_facet.png on master", { - repo <- git2r::repository(tdir) inst.atime <- file.path(tdir, ".ci", "atime") unlink(file.path(inst.atime, "*")) - git2r::checkout(repo, branch="master", force=TRUE) + gert::git_branch_checkout("master", force=TRUE, repo=tdir) options(repos="http://cloud.r-project.org")#required to check CRAN version. plist <- atime::atime_pkg(tdir) tests_all_facet.png <- file.path(inst.atime, "tests_all_facet.png") @@ -102,11 +99,10 @@ if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png }) if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png and tests_preview_facet.png on priority_queue", { - repo <- git2r::repository(tdir) ## https://github.com/tdhock/binsegRcpp/pull/23 inst.atime <- file.path(tdir, ".ci", "atime") unlink(file.path(inst.atime, "*")) - git2r::checkout(repo, branch="priority_queue", force=TRUE) + gert::git_branch_checkout("priority_queue", force=TRUE, repo=tdir) options(repos="http://cloud.r-project.org")#required to check CRAN version. plist <- atime::atime_pkg(tdir) tests_all_facet.png <- file.path(inst.atime, "tests_all_facet.png") @@ -126,12 +122,10 @@ test_that("pkg.edit.fun is a function", { file.copy(example_tests.R, tests.R) ci.dir <- dirname(tests.dir) pkg.dir <- dirname(ci.dir) - DESCRIPTION <- file.path(pkg.dir, "DESCRIPTION") - cat("Package: atime\nVersion: 1.0\n", file=DESCRIPTION) - git2r::init(pkg.dir) - repo <- git2r::repository(pkg.dir) - git2r::add(repo, DESCRIPTION) - git2r::commit(repo, "test commit") + cat("Package: atime\nVersion: 1.0\n", file=file.path(pkg.dir, "DESCRIPTION")) + gert::git_init(pkg.dir) + gert::git_add("DESCRIPTION", repo=pkg.dir) + gert::git_commit("test commit", repo=pkg.dir) options(repos="http://cloud.r-project.org")#required to check CRAN version. test.env <- atime::atime_pkg_test_info(pkg.dir) test_N_expr <- test.env$test.list$test_N_expr @@ -150,7 +144,7 @@ test_that("pkg.edit.fun is a function", { gdir <- tempfile() dir.create(gdir) -git2r::clone("https://github.com/tdhock/grates", gdir) +gert::git_clone("https://github.com/tdhock/grates", gdir) test_that("informative error when pkg.path is not a package", { expect_error({ @@ -177,10 +171,19 @@ test_that("atime_versions works with grates pkg in sub-dir of git repo", { test_that("atime_pkg_test_info() works for data.table, run one test case", { dt_dir <- tempfile() dir.create(dt_dir) - git2r::clone("https://github.com/Rdatatable/data.table", dt_dir) + gert::git_clone("https://github.com/Rdatatable/data.table", dt_dir) dt_info <- atime::atime_pkg_test_info(dt_dir) tname <- "melt improved in #5054" tcall <- dt_info$test.call[[tname]] dt_result <- eval(tcall) expect_is(dt_result, "atime") }) + +if(interactive())test_that("atime_pkg() works for poncatime", { + poncatime_dir <- tempfile() + dir.create(poncatime_dir) + gert::git_clone("https://github.com/poncateam/poncatime", poncatime_dir) + gert::git_branch_create("atime-version-test", "afe6f986836f3f37e743bda93a8d0746587aad1a", repo=poncatime_dir) + poncatime_info <- atime::atime_pkg(poncatime_dir) + expect_equal(nrow(poncatime_info$all), 2)#two test cases run. +}) diff --git a/vignettes/Custom_Plots.Rmd b/vignettes/Custom_Plots.Rmd index a8cc45f..7885d75 100644 --- a/vignettes/Custom_Plots.Rmd +++ b/vignettes/Custom_Plots.Rmd @@ -18,7 +18,7 @@ viz.data <- function(get.seg.means, data.per.seg=10, penalty=1){ start=integer(), end=integer(), changes=integer()) expr.list <- c( if(requireNamespace("changepoint"))atime::atime_grid( - "changepoint::cpt.mean"=changepoint::cpt.mean( + "changepoint::cpt.mean"=changepoint::cpt.mean( data.vec, method="PELT", penalty="Manual", pen.value=penalty)), if(requireNamespace("binsegRcpp"))atime::atime_grid( "binsegRcpp::binseg_normal"=binsegRcpp::binseg_normal(data.vec, N)), diff --git a/vignettes/Custom_References.Rmd b/vignettes/Custom_References.Rmd index 031fcb3..9d76375 100644 --- a/vignettes/Custom_References.Rmd +++ b/vignettes/Custom_References.Rmd @@ -18,7 +18,7 @@ The code below uses the following arguments: * `setup` is an R expression to create the data, * the other arguments have names to identify them in the results, and values which are R expressions to time, - + ```{r} library(data.table) seg.result <- atime::atime( diff --git a/vignettes/Custom_Units.Rmd b/vignettes/Custom_Units.Rmd index 3baa651..455a4e5 100644 --- a/vignettes/Custom_Units.Rmd +++ b/vignettes/Custom_Units.Rmd @@ -29,7 +29,7 @@ The output above shows that we can replace the `a` in `foobar` with either one or two dashes, and the output is a data frame with one row and two columns, including the numeric `nchar` column which we may want to visualize as a function of `N`. To do that in the code below, -we use that function inside a call to `atime` +we use that function inside a call to `atime` (default saves any results which are 1 row data frames). ```{r}