GithubHelp home page GithubHelp logo

backports's People

Contributors

dmurdoch avatar hughparsonage avatar krlmlr avatar mllg avatar rossellhayes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backports's Issues

Problem with Backports 1.1.7

Hi, I am trying to install Bbplot (plotting with the format of the BBC plots) but run into an error related to Backports. I have tried to remove backports, remove the 00LOCK-backports, installing the binary version and using the install type=source command but keep on getting this message.

  • installing source package 'backports' ...
    ** package 'backports' successfully unpacked and MD5 sums checked
    ERROR: cannot remove earlier installation, is it in use?
  • removing 'C:/Users/pepes/Documents/R/win-library/4.0/backports'
  • restoring previous 'C:/Users/pepes/Documents/R/win-library/4.0/backports'
    Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
    (converted from warning) problem copying C:\Users\pepes\Documents\R\win-library\4.0\00LOCK-backports\backports\libs\x64\backports.dll to C:\Users\pepes\Documents\R\win-library\4.0\backports\libs\x64\backports.dll: Permission denied
  • removing 'C:/Users/pepes/Documents/R/win-library/4.0/backports'
  • restoring previous 'C:/Users/pepes/Documents/R/win-library/4.0/backports'
    Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
    (converted from warning) problem copying C:\Users\pepes\Documents\R\win-library\4.0\00LOCK-backports\backports\libs\x64\backports.dll to C:\Users\pepes\Documents\R\win-library\4.0\backports\libs\x64\backports.dll: Permission denied
    Execution halted
    Error: Failed to install 'bbplot' from GitHub:
    (converted from warning) installation of package ‘backports’ had non-zero exit status

LHS of `&&` longer than 1 in `tests/test_dotsLength.R`

Hello,

running tests/test_dotlibPaths.R on R version 4.3.0 or greater fail with the following error:

.libPaths(save, include.site = length(.Library.site) && .Library.site %in% save)
Error in length(.Library.site) && .Library.site %in% save : 
  'length = 4' in coercion to 'logical(1)'

Best,

Charles Plessy (Debian Med packaging team)

Provide compat for isTRUE()

TIL that !isTRUE(structure(TRUE, bla = "blub")) on older versions of R: ropensci/tic#183 . Do we overwrite isTRUE() in this case?

isTRUE(structure(TRUE, bla = "blub"))
#> [1] FALSE

Created on 2019-10-01 by the reprex package (v0.3.0)

Session info
sessionInfo()
#> R version 3.3.3 (2017-03-06)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 16.04.6 LTS
#> 
#> locale:
#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] magrittr_1.5    tools_3.3.3     htmltools_0.3.6 yaml_2.2.0     
#>  [5] Rcpp_1.0.2      stringi_1.4.3   rmarkdown_1.15  highr_0.8      
#>  [9] knitr_1.25      stringr_1.4.0   xfun_0.9        digest_0.6.21  
#> [13] evaluate_0.14

Error: install of package 'backports' failed

Greetings -

I seem to have gotten tripped up trying to install the tidyverse package in R. The process stops at 'backports', which is a dependency of course that I am not familiar with. I have copied the output below. Any help in getting this to install is appreciated. I've used these packages before and never had any type of issue.

Thanks in advance!

Adam

IDE: RStudiov1.3.959
Rv4.0.2

Installing evaluate [0.14] ...
OK (linked cache)
Installing backports [1.1.8] ...
FAILED
Error installing package 'backports':

  • installing source package 'backports' ...
    ** package 'backports' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    Warning in system(paste(cmd, "shlib-clean")) : 'make' not found
    Warning in system(cmd) : 'make' not found
    ERROR: compilation failed for package 'backports'
  • removing 'C:/Users/Adam/DOCUME1/CLUE_R1/OPTION~2/renv/staging/1/backports'
    Error: install of package 'backports' failed
    Traceback (most recent calls last):
    16: sourceWithProgress(script = "C:/Users/Adam/AppData/Local/Temp/7dd9-20c1-1e36-bfd9",
    encoding = "UTF-8", con = stdout(), importRdata = NULL, exportRdata = NULL)
    15: eval(statements[[idx]], envir = sourceEnv)
    14: eval(statements[[idx]], envir = sourceEnv)
    13: renv::install("isoband")
    12: renv_install(records, library)
    11: renv_install_staged(records, library)
    10: renv_install_default(records, library)
    9: handler(package, renv_install_impl(record))
    8: renv_install_impl(record)
    7: withCallingHandlers(renv_install_package_local(record), error = function(e) {
    vwritef("\tFAILED")
    writef(e$output)
    })
    6: renv_install_package_local(record)
    5: renv_install_package_local_impl(package, path, library)
    4: r_cmd_install(package, path, library)
    3: r_exec(package, args, "install")
    2: r_exec_error(package, output, label)
    1: stop(error)
    Execution halted

Can we apply GPLv3 license to source codes which utilize backports?

We are currently developing an application using R language and in that application, we use OSS libraries under GPLv3 (e.g. Matrix, tidyselect).
During the development, we noticed that some of OSS libraries depends on backports.
Is it possible to apply GPLv3 to our application?
I found that rprojroot which imports backports is published under GPLv3.

install error arch - i386 with R 4.0.0

Sorry to bother. I am running R 4.0.0 with no other packages installed. I tried to install devtools but I received the error below. Any idea what the below error means?

install.packages("backports")

installing the source package ‘backports’

trying URL 'https://cloud.r-project.org/src/contrib/backports_1.1.7.tar.gz'
Content type 'application/x-gzip' length 17676 bytes (17 KB)
downloaded 17 KB

  • installing source package 'backports' ...
    ** package 'backports' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs

*** arch - i386
"c:/rtools40/mingw32/bin/"gcc -I"C:/PROGRA1/R/R-401.0/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsElt.c -o dotsElt.o
sh: c:/rtools40/mingw32/bin/gcc: No such file or directory
make: *** [C:/PROGRA1/R/R-401.0/etc/i386/Makeconf:222: dotsElt.o] Error 127
ERROR: compilation failed for package 'backports'

  • removing 'C:/Users/X/Documents/R/win-library/4.0/backports'

The downloaded source packages are in
‘C:\Users\X\AppData\Local\Temp\RtmpcHvAt5\downloaded_packages’
Warning message:
In install.packages("backports") :
installation of package ‘backports’ had non-zero exit status

Exports are determined at install time

Which is not ideal if somebody has multiple R versions and leads to hard to debug problems.

If backports could export the functions at load time somehow, that would be great.

apparent conflict with gamlss

Hi, I just tried to install gamlass into my miniconda library using conda and got the following error message. I don't understand what the problem is. I've installed many r packages without problem.

Please advise.

Thank you!

$ conda install --channel https://conda.anaconda.org/bioconda r-gamlss
Fetching package metadata ...........
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:

  • r-backports
  • r-gamlss -> r 3.3.1* -> r-base 3.3.1
    Use "conda info " to see the dependencies for each package.

R version for "lengths" is incorrect

I have this

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

lengths is already included, now backports shadows it

Install new version of backports on Mac Catalina with R 4.01

Here's the error message

install.packages("backports")

There is a binary version available but the source version is later:
binary source needs_compilation
backports 1.1.7 1.1.8 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y
installing the source package ‘backports’

trying URL 'https://cran.rstudio.com/src/contrib/backports_1.1.8.tar.gz'
Content type 'application/x-gzip' length 18047 bytes (17 KB)

downloaded 17 KB

  • installing source package ‘backports’ ...
    ** package ‘backports’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    /usr/local/gfortran//bin/gcc -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/gfortran//include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c dotsElt.c -o dotsElt.o
    In file included from /Library/Frameworks/R.framework/Resources/include/R.h:55,
    from dotsElt.c:1:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:62:10: fatal error: sys/cdefs.h: No such file or directory
    #include <sys/cdefs.h>
    ^~~~~~~~~~~~~
    compilation terminated.
    make: *** [dotsElt.o] Error 1
    ERROR: compilation failed for package ‘backports’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/backports’
  • restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/backports’
    Warning in install.packages :
    installation of package ‘backports’ had non-zero exit status

sort(method = "radix") and order(method = "radix")

only available for R >= 3.3.0, with caveats:

  • character vectors are sorted in C locale
  • stable, so fallback should use method = "shell"
  • method = "radix" was available for sort() under certain conditions in R < 3.3.0

Install issue with version 1.1.8

I have tried several ways to install the package but all fail in the same way with Error 127.

packageurl <- "https://cran.r-project.org/src/contrib/backports_1.1.8.tar.gz"
install.packages(packageurl, repos=NULL, dependencies=TRUE, verbose=TRUE, type="source")
trying URL 'https://cran.r-project.org/src/contrib/backports_1.1.8.tar.gz'
Content type 'application/x-gzip' length 18047 bytes (17 KB)
downloaded 17 KB

system (cmd0): C:/Users/APRMIL1/DOCUME1/R/R-40~1.2/bin/x64/R CMD INSTALL

  • installing source package 'backports' ...
    ** package 'backports' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs

*** arch - i386
"c:/rtools40/mingw32/bin/"gcc -I"C:/Users/APRMIL1/DOCUME1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsElt.c -o dotsElt.o
c:/rtools40/mingw32/bin/gcc: not found
make: *** [dotsElt.o] Error 127
ERROR: compilation failed for package 'backports'

  • removing 'C:/Users/aprmiller/Documents/R/R-4.0.2/library/backports'
    Warning in install.packages :
    installation of package ‘C:/Users/APRMIL~1/AppData/Local/Temp/1/RtmpqC25J1/downloaded_packages/backports_1.1.8.tar.gz’ had non-zero exit status

Move `master` branch to `main`

The master branch of this repository will soon be renamed to main, as part of a coordinated change across several GitHub organizations (including, but not limited to: tidyverse, r-lib, tidymodels, and sol-eng). We anticipate this will happen by the end of September 2021.

That will be preceded by a release of the usethis package, which will gain some functionality around detecting and adapting to a renamed default branch. There will also be a blog post at the time of this master --> main change.

The purpose of this issue is to:

  • Help us firm up the list of targetted repositories
  • Make sure all maintainers are aware of what's coming
  • Give us an issue to close when the job is done
  • Give us a place to put advice for collaborators re: how to adapt

message id: euphoric_snowdog

Native Pipe Backport

Hi,

Thanks so much for your work on this package. Its a really great idea!

Don't know if its possible, but I'd love to use the native pipe |> (introduced in R 4.1) in my packages without forcing everyone on less recent version to update.

Is this possible / in scope for backports

If not, do you have any ideas for alternative solutions?

asplit() added in R 3.6.0

A new base::asplit function was added in 3.6.0 which would bump up Depends: R (>=3.6.0).

The new function asplit() allow splitting an array or matrix by its margins.

It is defined as follows:

function (x, MARGIN) 
{
    dl <- length(dim(x))
    if (!dl) 
        stop("dim(x) must have a positive length")
    if (is.object(x)) 
        x <- if (dl == 2L) 
            as.matrix(x)
        else as.array(x)
    d <- dim(x)
    dn <- dimnames(x)
    ds <- seq_len(dl)
    if (is.character(MARGIN)) {
        if (is.null(dnn <- names(dn))) 
            stop("'x' must have named dimnames")
        MARGIN <- match(MARGIN, dnn)
        if (anyNA(MARGIN)) 
            stop("not all elements of 'MARGIN' are names of dimensions")
    }
    s.call <- ds[-MARGIN]
    s.ans <- ds[MARGIN]
    d.call <- d[-MARGIN]
    d.ans <- d[MARGIN]
    dn.call <- dn[-MARGIN]
    dn.ans <- dn[MARGIN]
    d2 <- prod(d.ans)
    newx <- aperm(x, c(s.call, s.ans))
    dim(newx) <- c(prod(d.call), d2)
    ans <- vector("list", d2)
    for (i in seq_len(d2)) {
        ans[[i]] <- array(newx[, i], d.call, dn.call)
    }
    array(ans, d.ans, dn.ans)
}

CI tests fail in R 3.3

The CI tests need pak, but it is not found in R 3.3. Should those tests be removed (i.e. give up on R 3.3), or should the CI code be fixed?

Unable to install 1.1.9 from cran (windows)

Hi, windows builds on my CI server are unable to resolve a dependency on v1.1.9 of this package today - I get a 404 when trying to download binary version from cran:

Installing backports (1.1.9) ... 

Error in download.file(url, destfile, method, mode = "wb", ...) : 

  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/backports_1.1.9.zip'

Is this deliberate? I can't see a newer version on this cran, and this was working for me last week. I notice that some other cran repos do provide a 1.1.9 of this package (e.g.).

backports installs on CentOS but cannot be loaded

I can install backports from CRAN without any problems (except Rd warning), but when I try to load it I get following:

install.packages("backports")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
Warning in install.packages("backports") :
  'lib = "/usr/lib64/R/library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) y
trying URL 'https://cloud.r-project.org/src/contrib/backports_1.1.5.tar.gz'
Content type 'application/x-gzip' length 14798 bytes (14 KB)
==================================================
downloaded 14 KB

* installing *source* package ‘backports’ ...
** package ‘backports’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c dotsElt.c -o dotsElt.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c dotsLength.c -o dotsLength.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c init.c -o init.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o backports.so dotsElt.o dotsLength.o init.o -L/usr/lib64/R/lib -lR
installing to /home/jovetale/R/x86_64-redhat-linux-gnu-library/3.6/00LOCK-backports/00new/backports/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘backports’
    finding HTML links ... done
    URLencode                               html
    anyNA                                   html
    backports-package                       html
    capture.output                          html
    dir.exists                              html
    dotsElt                                 html
    dotsLength                              html
    endsWith                                html
    file.info                               html
    file.size                               html
    get0                                    html
    hasName                                 html
    import                                  html
Rd warning: /tmp/RtmplnHXa3/R.INSTALLf1a2542f7681/backports/man/import.Rd:47: file link ‘.onLoad’ in package ‘base’ does not exist and so has been treated as a topic
    isFALSE                                 html
    isTRUE                                  html
    lengths                                 html
    startsWith                              html
    strrep                                  html
    trimws                                  html
    valid.factor                            html
    warningCondition                        html
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (backports)

The downloaded source packages are in
        ‘/tmp/RtmpH7Ng8V/downloaded_packages’
library(backports)
Error in library(backports) : there is no package called ‘backports’

SessionInfo:

R version 3.6.0 (2019-04-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0

Tried both with latest version in CRAN and one earlier version, both have the same issue. Any idea what is going on?

trimws implementation differs from that of R.

e.g. in R 3.4.0 base::trimws is defined as

function (x, which = c("both", "left", "right"))
{
    which <- match.arg(which)
    mysub <- function(re, x) sub(re, "", x, perl = TRUE)
    if (which == "left")
        return(mysub("^[ \t\r\n]+", x))
    if (which == "right")
        return(mysub("[ \t\r\n]+$", x))
    mysub("[ \t\r\n]+$", mysub("^[ \t\r\n]+", x))
}

backports:::trimws

function (x, which = c("both", "left", "right"))
{
    which = match.arg(which)
    if (which %in% c("left", "both"))
        x = gsub("^[[:space:]]", "", x)
    if (which %in% c("right", "both"))
        x = gsub("[[:space:]]$", "", x)
    return(x)
}

While we could debate which implementation is better (I actually prefer the backports one), I don't think it is appropriate for this package to change the implementations unnecessarily.

A package using backports will change behavior if it is installed on a newer R that does define trimws.

base::trimws("a\v")
#> [1] "a\v"

backports:::trimws("a\v")
#> [1] "a"

Missing backport: deparse1

deparse1 (from R 4.0.0) is basically a simple wrapper of paste(deparse(...), collapse = ' '), the benefit being the output is guaranteed length-1.

backports not installing correctly?

Hello. I import backports in my R package cobalt (CRAN link). I require the latest version (1.1.7). However, I've had several users complain that they see the error

Error in deparse1(substitute(x)) : could not find function "deparse1"

I have the following line in my package code:

.onLoad <- function(libname, pkgname) {
  backports::import(pkgname)
}

I feel that when users install cobalt, backports isn't being installed or updated to the latest version. I've told my users to manually install backports or update their version of R. Do you know what's going on? Thanks.

Small inconsistency with empty names in backports of `...names()`

Dear developers, I was working on a bug in one of my packages and I noticed a small inconsistency in the ...names() function implemented in backports vs the function included in R v4.2.1.

For example:

test1 <- function(...) {
  ...names()
}
test1("ABC")
#> [1] NA

while

bp_...names = getFromNamespace("...names", "backports")
test2 <- function(...) {
  bp_...names()
}
test2("ABC")
#> NULL

Created on 2022-02-06 by the reprex package (v2.0.1)

Missing backport for str2lang?

I feel like I'm missing something, but it seems like str2lang() should be part of this list here:

backports/R/import.R

Lines 64 to 76 in 45e4675

FUNS = list(
"4.1.0" = c("...names"),
"4.0.1" = c("paste", "paste0"),
"4.0.0" = c("R_user_dir", "deparse1", "list2DF", "suppressWarnings", "suppressMessages", "stopifnot"),
"3.6.0" = c("warningCondition", "errorCondition", "vignetteInfo", "dQuote", "sQuote", "removeSource", "asplit"),
"3.5.0" = c("...length", "...elt", "isFALSE", "isTRUE"),
"3.4.0" = c("hasName"),
"3.3.0" = c("startsWith", "endsWith", "strrep", "trimws", "capture.output"),
"3.2.0" = c("anyNA", "dir.exists", "file.size", "file.mode", "file.mtime", "lengths", "file.info", "URLencode", "isNamespaceLoaded"),
"3.1.0" = character(),
"3.0.0" = character(),
"0.0.0" = character()
)

Am I missing something about how to depend on str2lang() in versions prior to 3.6.0?

How about `grDevices` (e.g., `palette()`, `palette.colors()`)

See ?grDevices::palette (below). These functions are 'base' R 4.* functions, but not part of the base package. Should the backports package also incorporate these?


Set or View the Graphics Palette

Description

View or manipulate the color palette which is used when col= has a numeric index and supporting functions.

Usage

palette(value)
palette.pals()
palette.colors(n = NULL, palette = "Okabe-Ito", alpha, recycle = FALSE)

...

tools::R_user_dir() of R (>= 4.0.0)

From https://github.com/wch/r-source/blob/4cedccad7bbf4b5a6a0d1d803ebd09553f0bdbf5/src/library/tools/R/userdir.R#L19-L71:

R_user_dir <-
function(package, which = c("data", "config", "cache"))
{
    stopifnot(is.character(package), length(package) == 1L)


    which <- match.arg(which)


    home <- normalizePath("~")


    path <-
        switch(which,
               data = {
                   if(nzchar(p <- Sys.getenv("R_USER_DATA_DIR")))
                       p
                   else if(nzchar(p <- Sys.getenv("XDG_DATA_HOME")))
                       p
                   else if(.Platform$OS.type == "windows")
                       file.path(Sys.getenv("APPDATA"), "R", "data")
                   else if(Sys.info()["sysname"] == "Darwin")
                       file.path(home, "Library", "Application Support",
                                 "org.R-project.R") 
                   else
                       file.path(home, ".local", "share")
               },
               config = {
                   if(nzchar(p <- Sys.getenv("R_USER_CONFIG_DIR")))
                       p
                   else if(nzchar(p <- Sys.getenv("XDG_CONFIG_HOME")))
                       p
                   else if(.Platform$OS.type == "windows")
                       file.path(Sys.getenv("APPDATA"), "R", "config")
                   else if(Sys.info()["sysname"] == "Darwin")
                       file.path(home, "Library", "Preferences",
                                 "org.R-project.R")
                   else
                       file.path(home, ".config")
               },
               cache = {
                   if(nzchar(p <- Sys.getenv("R_USER_CACHE_DIR")))
                       p
                   else if(nzchar(p <- Sys.getenv("XDG_CACHE_HOME")))
                       p
                   else if(.Platform$OS.type == "windows")
                       file.path(Sys.getenv("LOCALAPPDATA"), "R", "cache")
                   else if(Sys.info()["sysname"] == "Darwin")
                       file.path(home, "Library", "Caches",
                                 "org.R-project.R")
                   else
                       file.path(home, ".cache")
               })
        
    file.path(path, "R", package)
}

Add isNamespaceLoaded added in 3.2.0

The isNamespaceLoaded() function was only introduced in R 3.2.0 (just checked because we want our package to support any R version since 3.0.0).

Per the documentation of ns-load:

requireNamespace is a wrapper for loadNamespace analogous to require that returns a logical value.

loadedNamespaces returns a character vector of the names of the loaded name spaces.

isNamespaceLoaded(pkg) is equivalent to but more efficient than pkg %in% loadedNamespaces().

So I think it's just:

isNamespaceLoaded <- function(pkg) {
  pkg %in% loadedNamespaces()
}

backports doesn't export `str2expression`?

It came to my attention that backports does not export all functions from previous R releases, including str2expression (and the related str2lang). If this was deliberate, is there a reason for it? Thanks.

Add .traceback()

Hi,
I wanted to point out that .traceback() was introduced in R 3.3.0 (April 2016) and could be added to backports. From the release notes:

New function .traceback() returns the stack trace which traceback() prints.

Best,
Florent

add paste & paste0 from R 4.0.1

from the release notes

CHANGES IN R 4.0.1
NEW FEATURES

  • paste() and paste0() gain a new optional argument recycle0. When set to true, zero-length arguments are recycled leading to character(0) after the sep-concatenation, i.e., to the empty string "" if collapse is a string and to the zero-length value character(0) when collapse = NULL.
    A package whose code uses this should depend on R (>= 4.0.1).

capture.output with `type=` parameter

A type parameter was added to capture.output() for R 3.2.1-patched which passes type and split down to the internal sink() call. wch/r-source@d00b404.

It would be handy to add a backport so capture.output(type = "message") could be used on e.g. R 3.1.

backports not built for Windows release and oldrel after 1.1.7

I'm not sure if this is actually consequential or how much control you have over it, but it looks like CRAN can't build the newer versions of backports for r-release and r-oldrel for Windows, which is causing packages (e.g., mine, cobalt) that import it to also fail to be built for those versions. I'm worried the CRAN team is going to come knocking at my door to tell me to fix these issues or they'll take my package down.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.