R Under development (unstable) (2025-02-23 r87804 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("R.utils") Loading required package: R.oo Loading required package: R.methodsS3 R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help. R.oo v1.27.0 (2024-11-01 18:00:02 UTC) successfully loaded. See ?R.oo for help. Attaching package: 'R.oo' The following object is masked from 'package:R.methodsS3': throw The following objects are masked from 'package:methods': getClasses, getMethods The following objects are masked from 'package:base': attach, detach, load, save R.utils v2.13.0 successfully loaded. See ?R.utils for help. Attaching package: 'R.utils' The following object is masked from 'package:utils': timestamp The following objects are masked from 'package:base': cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings > > # Set new default repositories for this test > orepos <- options(repos=c( + CRAN="http://cran.r-project.org", + EXAMPLE="http://example.org" + )) > > message("Current repositories:") Current repositories: > str(as.list(getOption("repos"))) List of 2 $ CRAN : chr "http://cran.r-project.org" $ EXAMPLE: chr "http://example.org" > > message("All current repositories:") All current repositories: > withRepos({ + str(as.list(getOption("repos"))) + }) List of 4 $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ BioCsoft: chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/bioc" $ BioCann : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/annotation" $ BioCexp : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/experiment" > > message("All current repositories (explicit):") All current repositories (explicit): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="[[current]]") List of 2 $ CRAN : chr "http://cran.r-project.org" $ EXAMPLE: chr "http://example.org" > > message("CRAN (only):") CRAN (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="CRAN") List of 1 $ CRAN: chr "https://bioconductor.statistik.tu-dortmund.de/cran" > > > message("braju.com (only):") braju.com (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="braju.com") List of 1 $ braju.com: chr "https://braju.com/R" > > message("CRAN and braju.com (only):") CRAN and braju.com (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos=c("CRAN", "braju.com")) List of 2 $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ braju.com: chr "https://braju.com/R" > > message("braju.com and CRAN (only):") braju.com and CRAN (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos=c("braju.com", "CRAN")) List of 2 $ braju.com: chr "https://braju.com/R" $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" > > > message("All CRAN replated repositories (only):") All CRAN replated repositories (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="[[CRAN]]") List of 1 $ CRAN: chr "https://bioconductor.statistik.tu-dortmund.de/cran" > > message("Mainstream (CRAN and BioC related) repositories (only):") Mainstream (CRAN and BioC related) repositories (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="[[mainstream]]") List of 4 $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ BioCsoft: chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/bioc" $ BioCann : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/annotation" $ BioCexp : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/experiment" > > message("braju.com and mainstream (only):") braju.com and mainstream (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="[[braju.com]]") List of 5 $ braju.com: chr "https://braju.com/R" $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ BioCsoft : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/bioc" $ BioCann : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/annotation" $ BioCexp : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/experiment" > > message("R-Forge and mainstream (only):") R-Forge and mainstream (only): > withRepos({ + str(as.list(getOption("repos"))) + }, repos="[[R-Forge]]") List of 4 $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ BioCsoft: chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/bioc" $ BioCann : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/annotation" $ BioCexp : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/experiment" > > message("An explicit repository URL:") An explicit repository URL: > withRepos({ + str(as.list(getOption("repos"))) + }, repos="http://r-forge.r-project.org") List of 1 $ : chr "http://r-forge.r-project.org" > > message("An explicit repository URL + mainstream:") An explicit repository URL + mainstream: > withRepos({ + str(as.list(getOption("repos"))) + }, repos=c("http://r-forge.r-project.org", "[[mainstream]]")) List of 5 $ : chr "http://r-forge.r-project.org" $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ BioCsoft: chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/bioc" $ BioCann : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/annotation" $ BioCexp : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/experiment" > > message("All known:") All known: > withRepos({ + str(as.list(getOption("repos"))) + }, repos="[[all]]") List of 6 $ CRAN : chr "https://bioconductor.statistik.tu-dortmund.de/cran" $ BioCsoft : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/bioc" $ BioCann : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/annotation" $ BioCexp : chr "https://bioconductor.statistik.tu-dortmund.de/packages/3.21/data/experiment" $ braju.com: chr "https://braju.com/R" $ EXAMPLE : chr "http://example.org" > > > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # Visibility > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > res <- withVisible({ + withRepos({ 1 }) + }) > str(res) List of 2 $ value : num 1 $ visible: logi TRUE > stopifnot(all.equal(res$value, 1)) > stopifnot(res$visible) > > x <- 0 > res <- withVisible({ + withRepos({ x <- 1 }) + }) > str(res) List of 2 $ value : num 1 $ visible: logi FALSE > stopifnot(all.equal(res$value, 1)) > stopifnot(!res$visible) > stopifnot(all.equal(x, 1)) > > > # Undo > options(orepos) > > proc.time() user system elapsed 0.20 0.07 0.26