[R-pkg-devel] R CMD check for a package which depends on not installed other package
Hi I am working on two packages, where one (EnergyBalance) contains general functions and the second package (EnergyBalancePaper) contains the data and the analysis of this specific day=ta using the general functions ion the package EnergyBalance. Now I am trying to clean the packages and I am running --8<---cut here---start->8--- R CMD build ./PACKAGE && R CMD check PACKAGE_0.0.1.tar.gz --8<---cut here---end--->8--- where everything works fine for EnergyBalance, but EnergyBalancePaper depends on EnergyBalance, and I get obviously the following error: , | Package required but not available: ‘EnergyBalance’ ` As they are both still under heavy development, I do not want to install them in my main library of R. Is there a way of telling R to use ./../library as a library as well in the command, or should I define a .Rprofile in the current diractory? What is the best approach in such a situation? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: PGP signature __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] R CMD check for a package which depends on not installed other package
Uwe Ligges writes: > On 26.08.2015 12:23, Rainer M Krug wrote: >> Hi >> >> I am working on two packages, where one (EnergyBalance) contains >> general functions and the second package (EnergyBalancePaper) contains >> the data and the analysis of this specific day=ta using the general >> functions ion the package EnergyBalance. >> >> Now I am trying to clean the packages and I am running >> >> --8<---cut here---start->8--- >> R CMD build ./PACKAGE && R CMD check PACKAGE_0.0.1.tar.gz >> --8<---cut here---end--->8--- >> >> where everything works fine for EnergyBalance, but EnergyBalancePaper >> depends on EnergyBalance, and I get obviously the following error: >> >> , >> | Package required but not available: ‘EnergyBalance’ >> ` >> >> As they are both still under heavy development, I do not want to install >> them in my main library of R. >> >> Is there a way of telling R to use ./../library as a library as well in >> the command, or should I define a .Rprofile in the current diractory? >> >> What is the best approach in such a situation? > > Install into that other library and temporarily set R_LIBS_USER that > points to that additional library. Nice - that even works with --vanilla Thanks, Rainer > > Best, > Uwe Ligges > > >> >> Thanks, >> >> Rainer >> >> >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: PGP signature __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Build fails on Mavericks
Duncan Murdoch writes: > On 19/11/2015 9:05 AM, Daniel Marcelino wrote: >> Hi, I'm having this error when building C functions from a package: >> >> clang: error: no such file or directory: '/usr/local/lib/libreadline.a' >> >> Apparently, it's a path issue caused by xcode/gfortran, but I couldn't >> figure out how to solve it. >> "which gcc" points to "/usr/bin/gcc" >> Does someone have any idea on how on this? > > You didn't say what system you're on, but the message is coming from > clang, not gcc, so it looks like OSX, and "which gcc" is irrelevant. > If so, you probably want to ask on the R-sig-mac group. If not, give > more details. Also: did you use the official R installer or installed it using homebrew? The path looks very much like homebrew. If yes, try installing readline From homebrew. Cheers, Rainer > > Duncan Murdoch > > __________ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: PGP signature __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] install from github
Berry Boessenkool writes: > Hi, > > is someone aware of a way to easily install a package hosted on github > without using devtools::install_github? > Does anyone else ever need to avoid devtools? Hi, Check out drat [https://github.com/eddelbuettel/drat] and for a description check out [http://eddelbuettel.github.io/drat/DratForPackageAuthors.html]. Be aware that I have never used it - but I should... Cheers, Rainer > Would something doing that be worth a package on CRAN? > Optional if no,yes,yes: Is my basic idea below any good at all? > > Thanks ahead, > Berry, Potsdam, Germany > > Details: > > devtools has so many dependencies that it takes quite some time to install on > old computers or with slow internet. Not suitable for a quick demo in the R > course I'm teaching, which I found out the hard way (thinking R had hung up, > I terminated it, crashing Rstudio in the proces...). > Not finding anything and happy to postpone actual work, I wrote some (very!) > basic code. I doubt it works across platforms and situations. I guess I'm > doing useless stuff, but I had fun and learned a few new things... > > > instgithub <- function( >pk, # "user/package" >cleanup=TRUE, # remove downloaded zipfile and folder with source code >...) # Further arguments passed to install.packages, untested so far > { > pkn <- strsplit(pk, "/")[[1]][2] # package name part > download.file(url=paste0("https://github.com/",pk,"/archive/master.zip";), > destfile=paste0(pkn,".zip")) > unzip(paste0(pkn,".zip")) > file.rename(paste0(pkn,"-master"), pkn) > # Dependencies - really not elegant at all! > deps <- read.dcf(paste0(pkn, "/DESCRIPTION"), fields="Imports") > deps <- strsplit(deps, ", ")[[1]] > deps <- sapply(strsplit(deps, " ", fixed=T), "[", 1) # remove version > restrictions > deps <- deps[!deps %in% rownames(installed.packages())] # install only new > packages > # install dependencies > dummy <- lapply(na.omit(deps), install.packages, ...) > # actually install the package itself: > install.packages(pkn, repos=NULL, type="source", ...) > # clean up: > if(cleanup) > { > unlink(pkn, recursive=TRUE) > unlink(paste0(pkn,".zip")) > } > } > > # example test cases, work fine on windows 7 with current R3.2.2 + write > permission at getwd: > if(FALSE){ > instgithub(pk="brry/extremeStat") > library(extremeStat) > instgithub("talgalili/installr") > instgithub("hadley/readxl") > } > > > > > [[alternative HTML version deleted]] > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: PGP signature __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Adding non-exported functions in an extra environment in new S4 object
Hi I have a package named asm which contains many non-exported functions which are all starting with "for.eq.". I also have an S4 class ASM which, when a new object asm of class ASM is created by using the function newASM() (in the package asm) contains among other slots one sot with an environment called "equations" (including the definition of the function"equations" and "equations<-"). Now in this function newASM() I want to copy all functions starting with "for.eq." into this environment. I have the following code: --8<---cut here---start->8--- ASM@equations <- new.env() funs <- apropos("^for\\.eq\\.", mode="function") for (fun in funs) { assign( gsub("for.eq.", "", fun), get(fun), ASM@equations ) } --8<---cut here---end--->8--- outside the package I call it as follow: --8<---cut here---start->8--- asm <- newASM() --8<---cut here---end--->8--- This worked fine when the functions "for.eq.*" were exported, but does not work anymore now that I don't export them anymore. This is a bit surprising to me, as the function newASM() is in the package and I assumed that inside of a package, all exported and non-exported functions are seen. My question: how can I add all functions starting with "for.eq." into the environment, irrespective if they are exported or not? Why I want to do this: I want to be able to have the functions encapsulated in the environment of the object asm as they are used in a simulation executed by the sim() function, which attaches the equations environment at the beginning and detaches it at the end. This enables me to have different simulation objects with different functions. Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D):+49 - (0)3 21 21 25 22 44 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: PGP signature __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Adding non-exported functions in an extra environment in new S4 object
Rainer M Krug writes: > Hi > > I have a package named asm which contains many non-exported functions > which are all starting with "for.eq.". > > I also have an S4 class ASM which, when a new object asm of class ASM is > created by using the function newASM() (in the package asm) contains > among other slots one sot with an environment called "equations" > (including the definition of the function"equations" and "equations<-"). > > Now in this function newASM() I want to copy all functions starting with > "for.eq." into this environment. > > I have the following code: > > ASM@equations <- new.env() > funs <- apropos("^for\\.eq\\.", mode="function") > for (fun in funs) { > assign( > gsub("for.eq.", "", fun), > get(fun), > ASM@equations > ) > } > > outside the package I call it as follow: > > asm <- newASM() > > This worked fine when the functions "for.eq.*" were exported, but does > not work anymore now that I don't export them anymore. > > This is a bit surprising to me, as the function newASM() is in the > package and I assumed that inside of a package, all exported and > non-exported functions are seen. > > My question: > > how can I add all functions starting with "for.eq." into the > environment, irrespective if they are exported or not? I found a solution: --8<---cut here---start->8--- funs <- grep( pattern = "for.eq.*", x = ls( getNamespace("asm"), all.names=TRUE ), value = TRUE ) for (fun in funs) { assign( gsub("for.eq.", "", fun), get(fun, getNamespace("asm")), ASM@equations ) } --8<---cut here---end--->8--- It adds all objects starting with "for.eq." but this is fine with me. Thanks, Rainer > > Why I want to do this: I want to be able to have the functions > encapsulated in the environment of the object asm as they are used in a > simulation executed by the sim() function, which attaches the equations > environment at the beginning and detaches it at the end. > > This enables me to have different simulation objects with different > functions. > > Thanks, > > Rainer -- Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 signature.asc Description: PGP signature __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Pre-test check fails with "non-standard things in check directory" on one platform
Hi I submitted an update of the dmdScheme package and got the response back from the pre-submission check that it failed on one platform with the Note: * checking for non-standard things in the check directory ... NOTE Found the following files/directories: ‘emeScheme’ (Links to the logs are here: package dmdScheme_1.2.7.tar.gz does not pass the incoming checks automatically, please see the following pre-tests: Windows: <https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Windows/00check.log> Status: OK Debian: <https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Debian/00check.log> Status: 1 NOTE ) This only occurs on the CRAN server and I can not reproduce it with rhub or locally on my Mac with 4.1.1. I can currently not check the level version, as it seems to be not compiling for Mac. Could somebody give any guidance, how to fix this? Which one is the “check directory"? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Pre-test check fails with "non-standard things in check directory" on one platform
> On 2 Sep 2021, at 14:02, Duncan Murdoch wrote: > > On 02/09/2021 6:29 a.m., Rainer M Krug wrote: >> Hi >> I submitted an update of the dmdScheme package and got the response back >> from the pre-submission check that it failed on one platform with the Note: >> * checking for non-standard things in the check directory ... NOTE >> Found the following files/directories: >> ‘emeScheme’ >> (Links to the logs are here: >> package dmdScheme_1.2.7.tar.gz does not pass the incoming checks >> automatically, please see the following pre-tests: >> Windows: >> <https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Windows/00check.log> >> Status: OK >> Debian: >> <https://win-builder.r-project.org/incoming_pretest/dmdScheme_1.2.7_20210901_161445/Debian/00check.log> >> Status: 1 NOTE >> ) >> This only occurs on the CRAN server and I can not reproduce it with rhub or >> locally on my Mac with 4.1.1. >> I can currently not check the level version, as it seems to be not compiling >> for Mac. >> Could somebody give any guidance, how to fix this? Which one is the “check >> directory"? > > That's the one reported at the start of the log as the "log directory". > > Fixing it is a little harder without more info. That looks like a name that > you would have created, given the name of your package. You should look at > your package source to figure out if there's an example or test that created > it but didn't delete it. > Thanks Duncan. I will look at it and come back when I have further questions. Rainer > Duncan Murdoch -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Detritus reported by r-hub builder check_for_cran
Hi I want to re-submit an archived package to CRAN, and I get, when checking on hub builder, the following Note: * checking for detritus in the temp directory ... NOTE Found the following files/directories: 'lastMiKTeXException' See https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-b5319e2e45f14b43b997198525243159 Any suggestions how this can be fixed? Thanks. I also get from the following, * checking for non-standard things in the check directory ... NOTE Found the following files/directories: ‘Formula’ ‘Hmisc’ ‘WikidataQueryServiceR’ ‘WikidataR’ ‘WikipediR’ ‘XML’ ‘ape’ ‘assertthat’ ‘backports’ ‘bit’ ‘bit64’ ‘bold’ ‘checkmate’ ‘clipr’ ‘conditionz’ ‘crul’ ‘data.table’ ‘emeScheme’ ‘fastmatch’ ‘foreach’ ‘ggplot2’ ‘gridExtra’ ‘gtable’ ‘htmlTable’ ‘htmlwidgets’ ‘httpcode’ ‘igraph’ ‘isoband’ ‘iterators’ ‘jpeg’ ‘latticeExtra’ ‘natserv’ ‘pbapply’ ‘phangorn’ ‘plyr’ ‘png’ ‘quadprog’ ‘ratelimitr’ ‘readr’ ‘rentrez’ ‘reshape’ ‘ritis’ ‘rncl’ ‘rotl’ ‘rredlist’ ‘solrium’ ‘taxize’ ‘triebeard’ ‘tzdb’ ‘urltools’ ‘viridis’ ‘vroom’ ‘wikitaxa’ ‘worrms’ ‘zoo’ ( https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-396cbbe5d27d4707add4317628dd6cf8 ) but I assume that is not relevant. — Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell:+41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 Rainer M. Krug Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell:+41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell:+41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich Office: +41 (0)44 635 47 64 Cell:+41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich R.M Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich R.M.Ke Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich R.M.Keug@ Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich R.M.Keug@gmail. Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich r.m.k...@gmail.com Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich r.m.k...@gmail.com Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich r.m.k...@gmail.com Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich r.m.k...@gmail.com --- Rainer M. Krug Department of Evolutionary Biology and Environmental Studies University of Zürich r.m.k...@gmail.com [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Detritus reported by r-hub builder check_for_cran
Thanks Uwe, I’ll try submission to CRAN beginning of next week. Rainer On 15 Jan 2022 at 00:40:00, Uwe Ligges wrote: > > > On 14.01.2022 15:14, Rainer M Krug wrote: > > Hi > > > I want to re-submit an archived package to CRAN, and I get, when checking > > on hub builder, the following Note: > > > * checking for detritus in the temp directory ... NOTE > > Found the following files/directories: > >'lastMiKTeXException' > > > If it is not part of your package it may be related due to failing > MikTeX when building, e.g., the manual or vignettes? > If hat worked otherwise I'd ignore it unless it also happens on CRAN. > > Best, > Uwe Ligges > > > > See > > > https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-b5319e2e45f14b43b997198525243159 > > > > Any suggestions how this can be fixed? > > > Thanks. > > > I also get from the following, > > > * checking for non-standard things in the check directory ... NOTE > > Found the following files/directories: > >‘Formula’ ‘Hmisc’ ‘WikidataQueryServiceR’ ‘WikidataR’ ‘WikipediR’ > >‘XML’ ‘ape’ ‘assertthat’ ‘backports’ ‘bit’ ‘bit64’ ‘bold’ ‘checkmate’ > >‘clipr’ ‘conditionz’ ‘crul’ ‘data.table’ ‘emeScheme’ ‘fastmatch’ > >‘foreach’ ‘ggplot2’ ‘gridExtra’ ‘gtable’ ‘htmlTable’ ‘htmlwidgets’ > >‘httpcode’ ‘igraph’ ‘isoband’ ‘iterators’ ‘jpeg’ ‘latticeExtra’ > >‘natserv’ ‘pbapply’ ‘phangorn’ ‘plyr’ ‘png’ ‘quadprog’ ‘ratelimitr’ > >‘readr’ ‘rentrez’ ‘reshape’ ‘ritis’ ‘rncl’ ‘rotl’ ‘rredlist’ > >‘solrium’ ‘taxize’ ‘triebeard’ ‘tzdb’ ‘urltools’ ‘viridis’ ‘vroom’ > >‘wikitaxa’ ‘worrms’ ‘zoo’ > > > > ( > > > https://builder.r-hub.io/status/dmdScheme_1.2.7.tar.gz-396cbbe5d27d4707add4317628dd6cf8 > > ) > > but I assume that is not relevant. > > — > > > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, > > UCT), Dipl. Phys. (Germany) > > > Orcid ID: -0002-7490-0066 > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > Office Y34-J-74 > > Winterthurerstrasse 190 > > 8075 Zürich > > Switzerland > > > Office: +41 (0)44 635 47 64 > > Cell:+41 (0)78 630 66 57 > > email: rainer.k...@uzh.ch > > rai...@krugs.de > > Skype: RMkrug > > > PGP: 0x0F52F982 > > > > > Rainer M. Krug > > > Orcid ID: 0000-0002-7490-0066 > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > Office Y34-J-74 > > Winterthurerstrasse 190 > > 8075 Zürich > > Switzerland > > > Office: +41 (0)44 635 47 64 > > Cell:+41 (0)78 630 66 57 > > email: rainer.k...@uzh.ch > > rai...@krugs.de > > Skype: RMkrug > > > PGP: 0x0F52F982 > > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > Office Y34-J-74 > > Winterthurerstrasse 190 > > 8075 Zürich > > Switzerland > > > Office: +41 (0)44 635 47 64 > > Cell:+41 (0)78 630 66 57 > > email: rainer.k...@uzh.ch > > rai...@krugs.de > > Skype: RMkrug > > > PGP: 0x0F52F982 > > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > Office: +41 (0)44 635 47 64 > > Cell:+41 (0)78 630 66 57 > > email: rainer.k...@uzh.ch > > rai...@krugs.de > > Skype: RMkrug > > > PGP: 0x0F52F982 > > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > R.M > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > R.M.Ke > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > R.M.Keug@ > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > R.M.Keug@gmail. > > > > Rainer M. Krug > > > Department of Evolutionary Biology and Environmental Studies > > University of Zürich > > > > r.m.k...@gmail.com > > > > Rainer M. Krug &
Re: [R-pkg-devel] plot graph (png, svg, eps, pdf, vdx, ok tikz) to device
Hi Stefan, > On 15 May 2018, at 13:31, Stefan McKinnon Høj-Edwards wrote: > > Hi Rainer, > > You are currently using a java library to create the plot. Your package is > basically a wrapper around the java file. Correct - that why I am limited to using the specified output formats. > The only way to make it more "R-like" would be to re-implement the rendering > in R (or Rcpp or using the grid package). Yes - I want to render the generated graphs in a graphics device in R, as if I would use a plot(1,1) command. > > To get a vector based image, your code suggests you can use the SVG format. > But again, that does not have anything to do with R. As vector I have sag, eps, and tikz formats - and the R part is: can I render these in an R device. I am not interested in R-like coded in the package, I am simply looking for a way to display this in an R device. Cheers, Rainer > > Kindly, > Stefan McKinnon Høj-Edwards > > Stefan McKinnon Høj-Edwards > ph.d. Genetics > +44 (0)776 231 2464 > +45 2888 6598 > Skype: stefan_edwards > > 2018-05-15 13:22 GMT+02:00 Rainer Krug <mailto:rai...@krugs.de>>: > Hi > > I asked the question at stack exchange yesterday ( > https://stackoverflow.com/q/50325139/632423 > <https://stackoverflow.com/q/50325139/632423> ) and did not get a response so > far, so I repost it here: > > > > I have the following situation: I use an external command (plantuml - > http://plantuml.com/ <http://plantuml.com/> ) to create a graph. This is done > via R by using a (my) package ( https://github.com/rkrug/plantuml > <https://github.com/rkrug/plantuml> ). The resulting graph can be a file > (png, svg, eps, pdf, vdx or LaTeX/Tikz with or without preamble) or I can > send the image to stdout, using the same formats. > > Now I want to plot this graph as R-like as possible, i.e. in a graphic > device. At the moment I am using a temporary file, which I display using > readPNG() and grid::grid.raster() which works, but I am not that happy with > this approach as > > • I have to use a temporary file which I would like to avoid, and > • it is a raster format and I would prefer a vector format. > > My question is therefore: > > • Is there a way to display any of the vector formats in a graphics > device in R? > • Can I pipe stdout (the result from the call to plantuml) directly > into the device (or through any function) without having to create an > intermediate file? > > > > Thanks for any [pointers, > > Rainer > > > -- > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, > UCT), Dipl. Phys. (Germany) > > University of Zürich > > Cell: +41 (0)78 630 66 57 > email: rai...@krugs.de <mailto:rai...@krugs.de> > Skype: RMkrug > > PGP: 0x0F52F982 > > > > > __ > R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing > list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > <https://stat.ethz.ch/mailman/listinfo/r-package-devel> > > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) University of Zürich Cell: +41 (0)78 630 66 57 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: Message signed with OpenPGP __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] plot graph (png, svg, eps, pdf, vdx, ok tikz) to device
Von meinem iPhone gesendet > Am 15.05.2018 um 13:54 schrieb Johannes Ranke : > > Hi, > > have a look at the grImport package. It can import eps, so at least you get a > vector based graph. Sounds interesting- I’ll check it out tomorrow and report back if it works well. > > Alternatively, you may want to check grImport2 which imports svg. > > Kind regards, > > Johannes > > Am Dienstag, 15. Mai 2018, 13:22:16 CEST schrieb Rainer Krug: >> Hi >> >> I asked the question at stack exchange yesterday ( >> https://stackoverflow.com/q/50325139/632423 ) and did not get a response so >> far, so I repost it here: >> >> >> >> I have the following situation: I use an external command (plantuml - >> http://plantuml.com/ ) to create a graph. This is done via R by using a >> (my) package ( https://github.com/rkrug/plantuml ). The resulting graph can >> be a file (png, svg, eps, pdf, vdx or LaTeX/Tikz with or without preamble) >> or I can send the image to stdout, using the same formats. >> >> Now I want to plot this graph as R-like as possible, i.e. in a graphic >> device. At the moment I am using a temporary file, which I display using >> readPNG() and grid::grid.raster() which works, but I am not that happy with >> this approach as >> >>• I have to use a temporary file which I would like to avoid, and >>• it is a raster format and I would prefer a vector format. >> >> My question is therefore: >> >>• Is there a way to display any of the vector formats in a graphics device >> in R? • Can I pipe stdout (the result from the call to plantuml) directly >> into the device (or through any function) without having to create an >> intermediate file? >> >> >> >> Thanks for any [pointers, >> >> Rainer >> >> >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> >> University of Zürich >> >> Cell: +41 (0)78 630 66 57 >> email: rai...@krugs.de >> Skype: RMkrug >> >> PGP: 0x0F52F982 > > > -- > Johannes Ranke > Wissenschaftlicher Berater > https://jrwb.de/contact __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Building my R package: issue when importing two functions with the same name
Probably discussed already, but what is the difference between using “::” and “ImportFrom”? I usually use ImportFrom and “::” just to make clear, where the function is coming from - is this a problem? Rainer > On 7 Aug 2018, at 11:14, Uwe Ligges wrote: > > ... and even if you are importing from several packages, you should import > selective via importFrom directoves. > > If you need two functions with identical names, import at most one of them > and rather use pkg::foo syntax to access them. > > Best, > Uwe Ligges > > > > > > On 07.08.2018 10:14, Iñaki Úcar wrote: >> El mar., 7 ago. 2018 a las 9:32, Gianmarco Alberti >> () escribió: >>> >>> I am building a R package, and I am facing an issue caused (as far as I >>> understand) by the fact that some functions out of my package rely on two >>> fuctions having the same name and coming from 2 different packages: >>> >>> pROC::roc >>> spatstat::roc >>> >>> When checking the package via devtools::check(), I get the following >>> warning: >>> >>> Warning: replacing previous import ‘spatstat::roc’ by ‘pROC::roc’ when >>> loading ‘GmAMisc’ >>> >>> Note that both packages are listed among the Imports in my package's >>> DESCRIPTION file, and that (within my functions) I have actually used >>> spatstat::roc and pROC::roc where needed. >> I see: >> Depends: R (>= 3.4.0), ggplot2, ggrepel, rgdal, rgeos, raster, sp, >> spatstat, maptools, spatialEco, dismo, pROC, kimisc, corrplot, >> InPosition, lsr, gridExtra, caTools, plyr, classInt, coin, DescTools, >> rWind, shape, rworldmap, cluster, RcmdrMisc, gdistance, Hmisc >> In general, it is not a good idea to depend on so many packages, >> because what "Depends" do is to load and attach packages. Among other >> issues, there is one that you are already experimenting: "roc" is >> exported both by "spatstat" and "pROC", so one masks the other. >> The solution is to list them under "Imports" instead of "Depends". In >> fact, my advice is to put as many packages as possible under >> "Imports". Keep in "Depends" only those you would load and attach >> anyway when working with your package, because you need all the >> functions along with the ones your package exports. For the rest of >> them, just use them as package::function to avoid this kind of >> problem, and reexport functions selectively if needed. >> Iñaki >> PS: I'm taking a look at other packages and I see that you always use >> "Depends" and never "Imports". My general advice is against this >> practice. Moreover, from the "Writing R Extensions" manual: >> "Field ‘Depends’ should nowadays be used rarely, only for packages >> which are intended to be put on the search path to make their >> facilities available to the end user (and not to the package itself): >> for example it makes sense that a user of package 'latticeExtra' would >> want the functions of package 'lattice' made available." >>> >>> I have done some web-search but I could not locate any workaround that >>> actually fixes my issue. >>> >>> Do you have any suggestion on the matter? >>> >>> ** >>> Dr Gianmarco Alberti (PhD) >>> (currently) >>> Research Support Officer II >>> Department of Classics and Archaeology >>> Faculty of Arts >>> University of Malta >>> >>> (starting from 3rd September 2018) >>> Lecturer in Spatial Forensics >>> Department of Criminology >>> Faculty for Social Wellbeing >>> University of Malta >>> https://www.researchgate.net/profile/Gianmarco_Alberti4 >>> http://cainarchaeology.weebly.com/ >>> ** >>> >>> >>> [[alternative HTML version deleted]] >>> >>> __ >>> R-package-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) University of Zürich Cell: +41 (0)78 630 66 57 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: Message signed with OpenPGP __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Building my R package: issue when importing two functions with the same name
This is very useful - didn’t know that. Thanks Rainer > On 7 Aug 2018, at 13:11, Duncan Murdoch wrote: > > On 05/08/2018 4:21 PM, Gianmarco Alberti wrote: >> I am building a R package, and I am facing an issue caused (as far as I >> understand) by the fact that some functions out of my package rely on two >> fuctions having the same name and coming from 2 different packages: >> pROC::roc >> spatstat::roc > > As Iñaki pointed out, the main issue is that you should be using Import > rather than Depends. But I didn't see mentioned the fact that the NAMESPACE > file can rename a function when you import it, e.g. > > importFrom(pROC, pROCroc = roc) > importFrom(spatstat, spatstatroc = roc) > > Now in your own functions you can use pROCroc() or spatstatroc() and they > won't conflict. > > (I was going to point you to the documentation for this, but I am not sure it > is properly documented anywhere.) > > Duncan Murdoch > >> When checking the package via devtools::check(), I get the following warning: >> Warning: replacing previous import ‘spatstat::roc’ by ‘pROC::roc’ when >> loading ‘GmAMisc’ >> Note that both packages are listed among the Imports in my package's >> DESCRIPTION file, and that (within my functions) I have actually used >> spatstat::roc and pROC::roc where needed. >> I have done some web-search but I could not locate any workaround that >> actually fixes my issue. >> Do you have any suggestion on the matter? >> ** >> Dr Gianmarco Alberti (PhD) >> (currently) >> Research Support Officer II >> Department of Classics and Archaeology >> Faculty of Arts >> University of Malta >> (starting from 3rd September 2018) >> Lecturer in Spatial Forensics >> Department of Criminology >> Faculty for Social Wellbeing >> University of Malta >> https://www.researchgate.net/profile/Gianmarco_Alberti4 >> http://cainarchaeology.weebly.com/ >> ** >> [[alternative HTML version deleted]] >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) University of Zürich Cell: +41 (0)78 630 66 57 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: Message signed with OpenPGP __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)
OK - thanks. I will than disable the checks for CRAN. Thanks, Rainer > On 5 Sep 2018, at 15:37, Uwe Ligges wrote: > > You should not run on CRAN. Note that the checks are done almost daily oin > several platforms, hence the API key is used for about 10 check runs a day. > > Best, > Uwe Ligges > > > > On 05.09.2018 09:28, Rainer Krug wrote: >> Hi >> I have a package at GitHub (https://github.com/rkrug/ROriginStamp) which I >> am pre[paring for CRAN. >> It creates a trusted timestamp using the API fro OriginStamp >> (https://originstamp.org/home) which requires an API key. Now this API >> should not be made public, as to much traffic through one API key will lead >> to it’s blocking. >> I have stored the key encrypted in the travis.yml, and the package passes >> all tests. >> But if I send it to CRAN, it would fail the tests, as the api key is not in >> the package itself. >> I could disable all tests for CRAN which need the API key, but I think it >> would be better tu run the tests there as well (as an additional check to >> travis). >> My question: >> Is there a way of storing the API key encrypted, so that only the CRAN test >> servers can decrypt it, or is there another way can steal with this? >> Thanks, >> Rainer >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> University of Zürich >> Cell: +41 (0)78 630 66 57 >> email: rai...@krugs.de >> Skype: RMkrug >> PGP: 0x0F52F982 >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) University of Zürich Cell: +41 (0)78 630 66 57 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: Message signed with OpenPGP __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)
> On 5 Sep 2018, at 20:20, Henrik Bengtsson <mailto:henrik.bengts...@gmail.com>> wrote: > > I take a complementary approach; I condition on, my home-made, > R_TEST_ALL variable. Effectively, I do: > > if (as.logical(Sys.getenv("R_TEST_ALL", "FALSE"))) { > ... > } > > and set R_TEST_ALL=TRUE when I want to run that part of the test. You > can also imagine refined versions of this, e.g. R_TEST_SETS=foo,bar > and test scripts with: > > if ("foo" %in% strsplit(Sys.getenv("R_TEST_SETS"), split="[, ]+")[[1]]) { > ...makes no assumption > } > > That avoids making assumptions on where the tests are submitted/run, > may it be CRAN, Bioconductor, Travis CI, … Thanks Henrik - that sounds like a good idea. At the moment, I am checking for the name of my machine, which is obviously not to robust. I will implement this before submission to CRAN. Thanks, Rainer > > /Henrik > > On Wed, Sep 5, 2018 at 11:08 AM Spencer Graves > <mailto:spencer.gra...@effectivedefense.org>> wrote: >> >> >> >> On 2018-09-05 12:52, Gábor Csárdi wrote: >>> On Wed, Sep 5, 2018 at 6:34 PM Spencer Graves >>> >> <mailto:spencer.gra...@effectivedefense.org>> wrote: >>>> The fda package disables some tests on CRAN using: >>>> >>>> >>>> if(!fda::CRAN()){ >>>> test you don't want run on CRAN >>>> } >>> Seemingly this just checks for a couple of (5 by default) environment >>> variables that match "^_R_": >>> https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14 >>> >>> <https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14> >>> >>> I am not sure if this is a good indication of the machine being a CRAN >>> machine, I do set some of these >>> occasionally on my machine. It would be great if CRAN machines could >>> set a specific environment >>> variable globally, e.g. ON_CRAN, or _R_ON_CRAN_, so people could skip >>> these tests and examples >>> easily. >> >> >> Agreed. Before I wrote that function, I asked this list for >> suggestions. The suggestion I got was, "Don't do it." I felt that was >> not acceptable so wrote what I did. I think we need a better solution. >> Spencer >>> >>> Gabor >>> >>>> >>>>I've used this in other contexts with tests that are too long to >>>> run on CRAN but that I want to run otherwise during "R CMD check". >>>> >>>> >>>>Spencer Graves >>>> >>>> >>>> On 2018-09-05 12:13, Peter Meissner wrote: >>>>> Hey, >>>>> >>>>> Maybe webmockr (or something alike) can help: >>>>> https://cran.r-project.org/web/packages/webmockr/index.html >>>>> <https://cran.r-project.org/web/packages/webmockr/index.html> >>>>> >>>>> Best, Peter >>>>> >>>>> Rainer M Krug schrieb am Mi., 5. Sep. 2018, 15:38: >>>>> >>>>>> OK - thanks. I will than disable the checks for CRAN. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Rainer >>>>>> >>>>>> >>>>>>> On 5 Sep 2018, at 15:37, Uwe Ligges >>>>>> wrote: >>>>>>> You should not run on CRAN. Note that the checks are done almost daily >>>>>> oin several platforms, hence the API key is used for about 10 check runs >>>>>> a >>>>>> day. >>>>>>> Best, >>>>>>> Uwe Ligges >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 05.09.2018 09:28, Rainer Krug wrote: >>>>>>>> Hi >>>>>>>> I have a package at GitHub (https://github.com/rkrug/ROriginStamp) >>>>>> which I am pre[paring for CRAN. >>>>>>>> It creates a trusted timestamp using the API fro OriginStamp ( >>>>>> https://originstamp.org/home) which requires an API key. Now this API >>>>>> should not be made public, as to much traffic through one API key will >>>>>> lead >>>>>> to it’s blocking. >>>>>>>> I have stored the key encrypted in the travis.yml,
Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)
Correct - I should have thought that there is a Hadley-solution to this problem. Thanks, Rainer > On 6 Sep 2018, at 09:25, Thierry Onkelinx wrote: > > Dear Rainer, > > It looks like you are using testthat. testthat has a skip_on_cran() function. > This will always skip the subsequent tests in the script unless the > environment variable NOT_CRAN is set. > > Best regards, > > Thierry > > > ir. Thierry Onkelinx > Statisticus / Statistician > > Vlaamse Overheid / Government of Flanders > INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND > FOREST > Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance > thierry.onkel...@inbo.be <mailto:thierry.onkel...@inbo.be> > Havenlaan 88 bus 73, 1000 Brussel > www.inbo.be <http://www.inbo.be/> > > /// > To call in the statistician after the experiment is done may be no more than > asking him to perform a post-mortem examination: he may be able to say what > the experiment died of. ~ Sir Ronald Aylmer Fisher > The plural of anecdote is not data. ~ Roger Brinner > The combination of some data and an aching desire for an answer does not > ensure that a reasonable answer can be extracted from a given body of data. ~ > John Tukey > /////// > > <https://www.inbo.be/> > > 2018-09-06 8:30 GMT+02:00 Rainer M Krug <mailto:rai...@krugs.de>>: > > > > On 5 Sep 2018, at 20:20, Henrik Bengtsson > <mailto:henrik.bengts...@gmail.com> <mailto:henrik.bengts...@gmail.com > > <mailto:henrik.bengts...@gmail.com>>> wrote: > > > > I take a complementary approach; I condition on, my home-made, > > R_TEST_ALL variable. Effectively, I do: > > > > if (as.logical(Sys.getenv("R_TEST_ALL", "FALSE"))) { > > ... > > } > > > > and set R_TEST_ALL=TRUE when I want to run that part of the test. You > > can also imagine refined versions of this, e.g. R_TEST_SETS=foo,bar > > and test scripts with: > > > > if ("foo" %in% strsplit(Sys.getenv("R_TEST_SETS"), split="[, ]+")[[1]]) { > > ...makes no assumption > > } > > > > That avoids making assumptions on where the tests are submitted/run, > > may it be CRAN, Bioconductor, Travis CI, … > > Thanks Henrik - that sounds like a good idea. At the moment, I am checking > for the name of my machine, which is obviously not to robust. > > I will implement this before submission to CRAN. > > Thanks, > > Rainer > > > > > /Henrik > > > > On Wed, Sep 5, 2018 at 11:08 AM Spencer Graves > > > <mailto:spencer.gra...@effectivedefense.org> > > <mailto:spencer.gra...@effectivedefense.org > > <mailto:spencer.gra...@effectivedefense.org>>> wrote: > >> > >> > >> > >> On 2018-09-05 12:52, Gábor Csárdi wrote: > >>> On Wed, Sep 5, 2018 at 6:34 PM Spencer Graves > >>> >>> <mailto:spencer.gra...@effectivedefense.org> > >>> <mailto:spencer.gra...@effectivedefense.org > >>> <mailto:spencer.gra...@effectivedefense.org>>> wrote: > >>>> The fda package disables some tests on CRAN using: > >>>> > >>>> > >>>> if(!fda::CRAN()){ > >>>> test you don't want run on CRAN > >>>> } > >>> Seemingly this just checks for a couple of (5 by default) environment > >>> variables that match "^_R_": > >>> https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14 > >>> > >>> <https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14> > >>> > >>> <https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14 > >>> > >>> <https://github.com/cran/fda/blob/0549e6a86aa144d8c2aade2d8704a269fb8a94ed/R/CRAN.R#L14>> > >>> > >>> I am not sure if this is a good indication of the machine being a CRAN > >>> machine, I do set some of these > >>> occasionally on my machine. It would be great if CRAN machines could > >>> set a specific environment > >>> variable globally, e.g. ON_CRAN, or _R_ON_CRAN_, so people could skip > >>> these tests and examples > >>> easily. > >> > >> > &
Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)
Hi Josh, > On 8 Sep 2018, at 21:02, Joshua Ulrich wrote: > > Hi Rainer, > > On Wed, Sep 5, 2018 at 2:28 AM, Rainer Krug wrote: >> Hi >> >> I have a package at GitHub (https://github.com/rkrug/ROriginStamp) which I am >> pre[paring for CRAN. >> >> It creates a trusted timestamp using the API fro OriginStamp >> (https://originstamp.org/home) which requires an API key. Now this API should >> not be made public, as to much traffic through one API key will lead to it’s >> blocking. >> >> I have stored the key encrypted in the travis.yml, and the package passes all >> tests. >> >> But if I send it to CRAN, it would fail the tests, as the api key is not in >> the package itself. >> >> I could disable all tests for CRAN which need the API key, but I think it >> would be better tu run the tests there as well (as an additional check to >> travis). >> >> My question: >> >> Is there a way of storing the API key encrypted, so that only the CRAN test >> servers can decrypt it, or is there another way can steal with this? >> > I have a similar issue with quantmod. I need API keys to test some > functionality and I would like the tests run regularly, so I can know > when something breaks without having to wait for a user to report the > change. Same motivation here. > > I store the API keys in encrypted environment variable in TravisCI, > and I check for those environment variables before running the tests > that require them. I am using the same approach for TravisCI and it works perfectly. > > Then I added a cron job on TravisCI to run the build if there hasn't > been a build in the past 24 hours. That solves the problem adequately > for my purposes without adding any burden to CRAN. Hopefully it works > for your purposes too. I haven’t thought about the CRON job for TravisCI - good point. I will activate it straight away. Thanks, Rainer > > Best, > Josh > >> Thanks, >> >> Rainer >> >> >> >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), >> MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) >> >> University of Zürich >> >> Cell: +41 (0)78 630 66 57 >> email: rai...@krugs.de >> Skype: RMkrug >> >> PGP: 0x0F52F982 >> >> >> >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> > > > > -- > Joshua Ulrich | about.me/joshuaulrich > FOSS Trading | www.fosstrading.com > R/Finance 2018 | www.rinfinance.com -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) University of Zürich Cell: +41 (0)78 630 66 57 email: rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 signature.asc Description: Message signed with OpenPGP __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled
I can confirm the same when checking on travis with r-devel. And thanks for the tip with env: - _R_CHECK_SYSTEM_CLOCK_=0 In .travis.yml Seems to be working now Rainer > On 7 Mar 2019, at 12:48, Ralf Herold wrote: > > Dear All, > > Checking a new package under development produces a warning in a local > R-devel MS Windows environment (output below). > > Building it with R-devel on Travis fails (because warnings are changed to > errors), but is successful when setting environment variable > _R_CHECK_SYSTEM_CLOCK_ to zero. > > No issue occurs when checking and building with R-stable and R-oldrel on > Travis, or with any R version on win-builder.r-project.org. > > The warning concerns using http://worldclockapi.com/, which however seems out > of service ("The web app you have attempted to reach is currently stopped and > does not accept any requests."). This is referenced in the main function for > R CMD check (https://svn.r-project.org/R/trunk/src/library/tools/R/check.R) > and may concern more R-devel than R-package-devel. I am posting here to check > if the issue was noticed by other package developers and to check the impact. > > Thanks for any suggestions. > Best regards, > Ralf > > > PS C:\Users\username> & 'C:\Program Files\R\R-devel\bin\R.exe' CMD check > E:\mypackage_0.1.2.3.tar.gz --as-cran > * using log directory 'C:/Users/username/ctrdata.Rcheck' > * using R Under development (unstable) (2019-03-05 r76200) > * using platform: x86_64-w64-mingw32 (64-bit) > * using session charset: ISO8859-1 > * using option '--as-cran' > [...] > * checking package directory ... OK > * checking for future file timestamps ...Warning in file(con, "r") : > cannot open URL 'http://worldclockapi.com/api/json/utc/now': HTTP status was > '403 Site Disabled' > WARNING > unable to verify current time > * checking 'build' directory … OK > [...] > > > > ## Ralf Herold > ## mailto: ralf.her...@mailbox.org [S/MIME] > ## https://paediatricdata.eu/ > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled
Can anyone confirm if this has been fixed? I would like to remove the _R_CHECK_SYSTEM_CLOCK_=0 but would like to know in advance. Thanks Rainer > On 8 Mar 2019, at 10:03, Gábor Csárdi wrote: > > I think you can put this in appveyor.yml: > > environment: > _R_CHECK_SYSTEM_CLOCK_: 0 > > before the "build_script" section. > > Gabor > > On Fri, Mar 8, 2019 at 5:15 AM Marta Karaś wrote: >> >> I have faced the same problem with using http://worldclockapi.com/. I dealt >> with Travis fail (because warnings are changed to errors) after setting >> environment variable _R_CHECK_SYSTEM_CLOCK_ to zero, as adviced above. >> >> How I deal with appveyor fail for the same reason? It may be seen in my >> built output here (link) >> <https://ci.appveyor.com/project/martakarass/adept/build/job/vq4ncvg6qbh526u4>. >> I googled but was unable to find the equivalent of >> >> env: >> - _R_CHECK_SYSTEM_CLOCK_=0 >> >> >> for appveyor. Would appreciate any hint a lot - thank you! >> Marta >> >> On Thu, Mar 7, 2019 at 2:53 PM Hadley Wickham wrote: >> >>> As of ~7 hours ago, the warning is suppressed: >>> >>> https://github.com/wch/r-source/commit/31ee14c620eb1b939acd322f3b5617f998aab8e8 >>> >>> (But the service still doesn't work) >>> >>> Hadley >>> >>> On Thu, Mar 7, 2019 at 11:03 AM Hadley Wickham >>> wrote: >>>> >>>> It appears that the code was added by BDR on 2 Sep 2018: >>>> >>> https://github.com/wch/r-source/commit/d839b1e04e173f90b51ad809ef0bdb18095abe6f >>>> >>>> I assume we are seeing failing R CMD check results because >>>> http://worldclockapi.com/api/json/utc/now has recently died. >>>> >>>> It would be appreciated if someone from R-core could look into this as >>>> it's currently causing all R-devel builds on travis to fail. >>>> >>>> Hadley >>>> >>>> On Thu, Mar 7, 2019 at 9:32 AM Bob Rudis wrote: >>>>> >>>>> (a) that's gd news (#ty) >>>>> (b) genuine apologies for my confusion >>>>> (c) why was the introduction of reliance on a third-party site even >>> under consideration? >>>>> >>>>>> On Mar 7, 2019, at 09:32, peter dalgaard wrote: >>>>>> >>>>>> It's not "stealth fixed"! It was never there... (on the release >>> branch) >>>>>> >>>>>> The timestamp checking code is still present in R-devel. I presume >>> something needs to be done about the breakage. >>>>>> >>>>>> - pd >>>>>> >>>>>>> On 7 Mar 2019, at 14:38 , Bob Rudis wrote: >>>>>>> >>>>>>> It's fixed in the RC that's GA on the 11th. >>>>>>> >>>>>>> I think perhaps "stealth fixed" may be more appropro since it's not >>> in SVN logs, Bugzilla nor noted prominently in any of the various NEWS* >>> files. >>>>>>> >>>>>>> Then there's the "why was the core R installation using a third >>> party, non-HTTPS site for this to begin with". >>>>>>> >>>>>>> And, in other news, there are tests in the R source that rely on a >>> check of `foo.bar` for connectivity. `.bar` is a valid domain and `foo.bar` >>> is registered. Thankfully there's no current IP address associated with it. >>> Anything under `*.invalid` (https://en.wikipedia.org/wiki/.invalid) might >>> be a better choice as well since that won't break the reason for the >>> connectivity checks and won't arbitrarily send telemetry pings to third >>> parties in the even anyone outside of R Core decides to run the tests (say, >>> when patching something in R). >>>>>>> >>>>>>> -boB >>>>>>> >>>>>>>> On Mar 7, 2019, at 07:54, Rainer M Krug wrote: >>>>>>>> >>>>>>>> I can confirm the same when checking on travis with r-devel. >>>>>>>> >>>>>>>> And thanks for the tip with >>>>>>>> >>>>>>>> env: >>>>>>>> - _R_CHECK_SYSTEM_CLOCK_=0 >>>>>>>> >>>>>>>> In .travis.yml >
Re: [R-pkg-devel] Checking for future file timestamps - warning with worldclockapi HTTP status 403 Site Disabled
Thanks - will do so. Rainer > On 19 Mar 2019, at 12:14, Gábor Csárdi wrote: > > AFAICT you can still get a NOTE about it, so I would just leave the > workaround in place: > https://github.com/wch/r-source/blob/87110b6b9e20c324c44766cc8f5816580f681a2a/src/library/tools/R/check.R#L457 > > G. > > On Tue, Mar 19, 2019 at 11:11 AM Rainer M Krug wrote: >> >> Can anyone confirm if this has been fixed? I would like to remove the >> _R_CHECK_SYSTEM_CLOCK_=0 but would like to know in advance. >> >> Thanks >> >> Rainer >> >> >>> On 8 Mar 2019, at 10:03, Gábor Csárdi wrote: >>> >>> I think you can put this in appveyor.yml: >>> >>> environment: >>> _R_CHECK_SYSTEM_CLOCK_: 0 >>> >>> before the "build_script" section. >>> >>> Gabor >>> >>> On Fri, Mar 8, 2019 at 5:15 AM Marta Karaś wrote: >>>> >>>> I have faced the same problem with using http://worldclockapi.com/. I dealt >>>> with Travis fail (because warnings are changed to errors) after setting >>>> environment variable _R_CHECK_SYSTEM_CLOCK_ to zero, as adviced above. >>>> >>>> How I deal with appveyor fail for the same reason? It may be seen in my >>>> built output here (link) >>>> <https://ci.appveyor.com/project/martakarass/adept/build/job/vq4ncvg6qbh526u4>. >>>> I googled but was unable to find the equivalent of >>>> >>>> env: >>>> - _R_CHECK_SYSTEM_CLOCK_=0 >>>> >>>> >>>> for appveyor. Would appreciate any hint a lot - thank you! >>>> Marta >>>> >>>> On Thu, Mar 7, 2019 at 2:53 PM Hadley Wickham wrote: >>>> >>>>> As of ~7 hours ago, the warning is suppressed: >>>>> >>>>> https://github.com/wch/r-source/commit/31ee14c620eb1b939acd322f3b5617f998aab8e8 >>>>> >>>>> (But the service still doesn't work) >>>>> >>>>> Hadley >>>>> >>>>> On Thu, Mar 7, 2019 at 11:03 AM Hadley Wickham >>>>> wrote: >>>>>> >>>>>> It appears that the code was added by BDR on 2 Sep 2018: >>>>>> >>>>> https://github.com/wch/r-source/commit/d839b1e04e173f90b51ad809ef0bdb18095abe6f >>>>>> >>>>>> I assume we are seeing failing R CMD check results because >>>>>> http://worldclockapi.com/api/json/utc/now has recently died. >>>>>> >>>>>> It would be appreciated if someone from R-core could look into this as >>>>>> it's currently causing all R-devel builds on travis to fail. >>>>>> >>>>>> Hadley >>>>>> >>>>>> On Thu, Mar 7, 2019 at 9:32 AM Bob Rudis wrote: >>>>>>> >>>>>>> (a) that's gd news (#ty) >>>>>>> (b) genuine apologies for my confusion >>>>>>> (c) why was the introduction of reliance on a third-party site even >>>>> under consideration? >>>>>>> >>>>>>>> On Mar 7, 2019, at 09:32, peter dalgaard wrote: >>>>>>>> >>>>>>>> It's not "stealth fixed"! It was never there... (on the release >>>>> branch) >>>>>>>> >>>>>>>> The timestamp checking code is still present in R-devel. I presume >>>>> something needs to be done about the breakage. >>>>>>>> >>>>>>>> - pd >>>>>>>> >>>>>>>>> On 7 Mar 2019, at 14:38 , Bob Rudis wrote: >>>>>>>>> >>>>>>>>> It's fixed in the RC that's GA on the 11th. >>>>>>>>> >>>>>>>>> I think perhaps "stealth fixed" may be more appropro since it's not >>>>> in SVN logs, Bugzilla nor noted prominently in any of the various NEWS* >>>>> files. >>>>>>>>> >>>>>>>>> Then there's the "why was the core R installation using a third >>>>> party, non-HTTPS site for this to begin with". >>>>>>>>> >>>>>>>>> And, in other news, there are tests in the R source that rely on a >>>>> check of `foo.bar` for connectivity. `.bar` i
[R-pkg-devel] Package dependency graphs of packages in development (local)
Hi I am quite sure, there was a recent discussion about dependency graphs of packages. I saw the post from Dirk at http://dirk.eddelbuettel.com/blog/2018/02/28/#017_dependencies but `tools::package_dependencies()` does only work on packages on CRAN. But my package is not yet on CRAN (but on GitHub and a drat repo), and I would like to look at the package dependencies BEFORE submitting to CRAN. Is there a tool which allows me to plot a dependency graph for my local package? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Package dependency graphs of packages in development (local)
Thanks Gabor. This gives me an impressive long list. Is there a way to see this graphically? Parsing seems to be a long, tedious process. I want to identify packages which I should leave out to reduce the number of (indirect) dependencies. Rainer > On 9 May 2019, at 11:24, Gábor Csárdi wrote: > > You can do something like this with https://github.com/r-lib/pkgdepends: > > pr <- pkgdepends::remotes()$new("local::.", library = tempfile()) > #> ℹ Creating library directory: > `/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5wgn/T//Rtmpo5NL9R/filee95427c73f55` > > pr$solve() > #> ℹ Checking for package metadata updates > #> ✔ All 10 metadata files are current. > #> ✔ Using session cached package metadata > #> ✔ Using cached package metadata > #> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms > ─── > #> local::. > #> Dependencies: > #> github: > #> r-lib/crancache, r-lib/rcmdcheck > #> standard: > #> askpass, assertthat, backports, base64enc, bit, bit64, blob, callr, > #> cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc, > #> digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite, > #> knitr, magrittr, markdown, memoise, mime, openssl, parsedate, > #> pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps, > #> R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite, > #> sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr, > #> xfun, xopen, yaml > > tibble::as_tibble(pr$get_solution()$data) > #> # A tibble: 61 x 27 > #>ref type direct status package version license > needscompilation priority > #> > #> 1 loca… local TRUE OK revdep… 1.0.0.… MIT + … NA NA > #> 2 askp… stan… FALSE OK askpass 1.1 NA FALSENA > #> 3 asse… stan… FALSE OK assert… 0.2.1 NA FALSENA > #> 4 back… stan… FALSE OK backpo… 1.1.4 NA FALSENA > #> 5 base… stan… FALSE OK base64… 0.1-3 NA FALSENA > #> 6 bit64 stan… FALSE OK bit64 0.9-7 NA FALSENA > #> 7 bit stan… FALSE OK bit 1.1-14 NA FALSENA > #> 8 blob stan… FALSE OK blob1.1.1 NA FALSENA > #> 9 callr stan… FALSE OK callr 3.2.0 NA FALSENA > #> 10 cli stan… FALSE OK cli 1.1.0 NA FALSENA > #> # … with 51 more rows, and 18 more variables: md5sum , sha256 , > #> # filesize , built , platform , rversion , > repodir , > #> # target , deps , mirror , sources , remote , > #> # error , metadata , extra , dep_types , > #> # cache_status , lib_status > > And the `deps` column there shows the direct dependencies of the dependencies: > > ❯ pr$get_solution()$data$deps[1:2] > #> [[1]] > #> # A tibble: 25 x 5 > #>ref typepackageopversion > #> > #> 1 assertthat Imports assertthat """" > #> 2 callr Imports callr """" > #> 3 cli Imports cli"""" > #> 4 clisymbols Imports clisymbols """" > #> 5 r-lib/crancache Imports crancache >=0.0.0.9001 > #> 6 crayon Imports crayon """" > #> 7 DBI Imports DBI """" > #> 8 descImports desc >=1.1.1.9002 > #> 9 glueImports glue """" > #> 10 gmailr Imports gmailr """" > #> # … with 15 more rows > #> > #> [[2]] > #> # A tibble: 2 x 5 > #> ref type package opversion > #> > #> 1 testthat suggests testthat """" > #> 2 sys imports sys >=2.1 > > Gabor > > On Thu, May 9, 2019 at 8:53 AM Rainer M Krug wrote: >> >> Hi >> >> I am quite sure, there was a recent discussion about dependency graphs of >> packages. I saw the post from Dirk at >> http://dirk.eddelbuettel.com/blog/2018/02/28/#017_dependencies but >> `tools::package_dependencies()` does only work on packages on CRAN. >> >> But my package is not yet on CRAN (but on GitHub and a drat repo), and I >> would like to look at the package dependencies BEFORE submitting to CRAN. >> >> Is there a tool which allows me to plot a depen
Re: [R-pkg-devel] Package dependency graphs of packages in development (local)
Thanks. This sounds like a really useful package - I’ll check it out. > On 9 May 2019, at 12:15, Maëlle SALMON wrote: > > Could https://github.com/jimhester/itdepends help? > > Maëlle. > Den torsdag 9 maj 2019 12:10:14 CEST, Rainer M Krug skrev: > > > Thanks Gabor. > > This gives me an impressive long list. Is there a way to see this > graphically? Parsing seems to be a long, tedious process. > > I want to identify packages which I should leave out to reduce the number of > (indirect) dependencies. > > Rainer > > > > On 9 May 2019, at 11:24, Gábor Csárdi > <mailto:csardi.ga...@gmail.com>> wrote: > > > > You can do something like this with https://github.com/r-lib/pkgdepends: > > > > pr <- pkgdepends::remotes()$new("local::.", library = tempfile()) > > #> ℹ Creating library directory: > > `/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5wgn/T//Rtmpo5NL9R/filee95427c73f55` > > > > pr$solve() > > #> ℹ Checking for package metadata updates > > #> ✔ All 10 metadata files are current. > > #> ✔ Using session cached package metadata > > #> ✔ Using cached package metadata > > #> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms > > ─── > > #> local::. > > #> Dependencies: > > #> github: > > #>r-lib/crancache, r-lib/rcmdcheck > > #> standard: > > #>askpass, assertthat, backports, base64enc, bit, bit64, blob, callr, > > #>cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc, > > #>digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite, > > #>knitr, magrittr, markdown, memoise, mime, openssl, parsedate, > > #>pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps, > > #>R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite, > > #>sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr, > > #>xfun, xopen, yaml > > > > tibble::as_tibble(pr$get_solution()$data) > > #> # A tibble: 61 x 27 > > #>ref type direct status package version license > > needscompilation priority > > #> > > #> 1 loca… local TRUE OKrevdep… 1.0.0.… MIT + … NA NA > > #> 2 askp… stan… FALSE OKaskpass 1.1NA FALSENA > > #> 3 asse… stan… FALSE OKassert… 0.2.1 NA FALSENA > > #> 4 back… stan… FALSE OKbackpo… 1.1.4 NA FALSENA > > #> 5 base… stan… FALSE OKbase64… 0.1-3 NA FALSENA > > #> 6 bit64 stan… FALSE OKbit64 0.9-7 NA FALSENA > > #> 7 bit stan… FALSE OKbit1.1-14 NA FALSENA > > #> 8 blob stan… FALSE OKblob1.1.1 NA FALSENA > > #> 9 callr stan… FALSE OKcallr 3.2.0 NA FALSENA > > #> 10 cli stan… FALSE OKcli1.1.0 NA FALSENA > > #> # … with 51 more rows, and 18 more variables: md5sum , sha256 , > > #> # filesize , built , platform , rversion , > > repodir , > > #> # target , deps , mirror , sources , remote > > , > > #> # error , metadata , extra , dep_types , > > #> # cache_status , lib_status > > > > And the `deps` column there shows the direct dependencies of the > > dependencies: > > > > ❯ pr$get_solution()$data$deps[1:2] > > #> [[1]] > > #> # A tibble: 25 x 5 > > #>reftypepackageopversion > > #> > > #> 1 assertthat Imports assertthat """" > > #> 2 callr Imports callr """" > > #> 3 cliImports cli"""" > > #> 4 clisymbols Imports clisymbols """" > > #> 5 r-lib/crancache Imports crancache >=0.0.0.9001 > > #> 6 crayon Imports crayon"""" > > #> 7 DBIImports DBI"""" > > #> 8 descImports desc >=1.1.1.9002 > > #> 9 glueImports glue """" > > #> 10 gmailr Imports gmailr"""" > > #> # … with 15 more rows > > #> > > #> [[2]] > > #> # A tibble: 2 x 5 > > #> ref typepackage opversion > > #> > > #> 1 testthat suggests testthat "&
Re: [R-pkg-devel] Package dependency graphs of packages in development (local)
But I don’t get it to run. When I do > itdepends::dep_plot_size(".") ℹ Checking for package metadata updates ✖ Metadata download failed Error in stop(http_error(resp)) : Not Found (HTTP 404). Could not load or update metadata cache. If you think your local cache is broken, try deleting it with `meta_cache_cleanup()`, or the `$cleanup()` method. d> I get an error. Suggestions? Rainer > On 9 May 2019, at 12:20, Rainer M Krug wrote: > > Thanks. > > This sounds like a really useful package - I’ll check it out. > > >> On 9 May 2019, at 12:15, Maëlle SALMON > <mailto:maelle.sal...@yahoo.se>> wrote: >> >> Could https://github.com/jimhester/itdepends >> <https://github.com/jimhester/itdepends> help? >> >> Maëlle. >> Den torsdag 9 maj 2019 12:10:14 CEST, Rainer M Krug > <mailto:rai...@krugs.de>> skrev: >> >> >> Thanks Gabor. >> >> This gives me an impressive long list. Is there a way to see this >> graphically? Parsing seems to be a long, tedious process. >> >> I want to identify packages which I should leave out to reduce the number of >> (indirect) dependencies. >> >> Rainer >> >> >> > On 9 May 2019, at 11:24, Gábor Csárdi > > <mailto:csardi.ga...@gmail.com>> wrote: >> > >> > You can do something like this with https://github.com/r-lib/pkgdepends: >> > <https://github.com/r-lib/pkgdepends:> >> > >> > pr <- pkgdepends::remotes()$new("local::.", library = tempfile()) >> > #> ℹ Creating library directory: >> > `/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5wgn/T//Rtmpo5NL9R/filee95427c73f55` >> > >> > pr$solve() >> > #> ℹ Checking for package metadata updates >> > #> ✔ All 10 metadata files are current. >> > #> ✔ Using session cached package metadata >> > #> ✔ Using cached package metadata >> > #> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms >> > ─── >> > #> local::. >> > #> Dependencies: >> > #> github: >> > #>r-lib/crancache, r-lib/rcmdcheck >> > #> standard: >> > #>askpass, assertthat, backports, base64enc, bit, bit64, blob, callr, >> > #>cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc, >> > #>digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite, >> > #>knitr, magrittr, markdown, memoise, mime, openssl, parsedate, >> > #>pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps, >> > #>R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite, >> > #>sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr, >> > #>xfun, xopen, yaml >> > >> > tibble::as_tibble(pr$get_solution()$data) >> > #> # A tibble: 61 x 27 >> > #>ref type direct status package version license >> > needscompilation priority >> > #> >> > #> 1 loca… local TRUE OKrevdep… 1.0.0.… MIT + … NA NA >> > #> 2 askp… stan… FALSE OKaskpass 1.1NA FALSENA >> > #> 3 asse… stan… FALSE OKassert… 0.2.1 NA FALSENA >> > #> 4 back… stan… FALSE OKbackpo… 1.1.4 NA FALSENA >> > #> 5 base… stan… FALSE OKbase64… 0.1-3 NA FALSENA >> > #> 6 bit64 stan… FALSE OKbit64 0.9-7 NA FALSENA >> > #> 7 bit stan… FALSE OKbit1.1-14 NA FALSENA >> > #> 8 blob stan… FALSE OKblob1.1.1 NA FALSENA >> > #> 9 callr stan… FALSE OKcallr 3.2.0 NA FALSENA >> > #> 10 cli stan… FALSE OKcli1.1.0 NA FALSENA >> > #> # … with 51 more rows, and 18 more variables: md5sum , sha256 >> > , >> > #> # filesize , built , platform , rversion , >> > repodir , >> > #> # target , deps , mirror , sources , remote >> > , >> > #> # error , metadata , extra , dep_types , >> > #> # cache_status , lib_status >> > >> > And the `deps` column there shows the direct dependencies of the >> > dependencies: >> > >> > ❯ pr$get_solution()$data$deps[1:2] >> > #> [[1]] >> > #> # A tibble: 25 x
Re: [R-pkg-devel] Package dependency graphs of packages in development (local)
Nope: ``` > meta_cache_update() ℹ Checking for package metadata updates ✔ Downloaded metadata files, 1.37 MB in 5 files. ✔ Updating metadata database > itdepends::dep_plot_size(".") ℹ Checking for package metadata updates ✖ Metadata download failed Error in stop(http_error(resp)) : Not Found (HTTP 404). Could not load or update metadata cache. If you think your local cache is broken, try deleting it with `meta_cache_cleanup()`, or the `$cleanup()` method. > I can download the cache manually (see above). Rainer ``` > On 9 May 2019, at 13:16, Gábor Csárdi wrote: > > It fails to download package metadata. Maybe your internet access is > restricted? > > Gabor > > On Thu, May 9, 2019 at 12:12 PM Rainer M Krug wrote: >> >> But I don’t get it to run. >> >> When I do >> >>> itdepends::dep_plot_size(".") >> ℹ Checking for package metadata updates >> ✖ Metadata download failed >> Error in stop(http_error(resp)) : >> Not Found (HTTP 404). >> >> Could not load or update metadata cache. If you think your local cache is >> broken, try deleting it with `meta_cache_cleanup()`, or the >> `$cleanup()` method. >> d> >> >> I get an error. Suggestions? >> >> Rainer >> >> >> >> On 9 May 2019, at 12:20, Rainer M Krug wrote: >> >> Thanks. >> >> This sounds like a really useful package - I’ll check it out. >> >> >> On 9 May 2019, at 12:15, Maëlle SALMON wrote: >> >> Could https://github.com/jimhester/itdepends help? >> >> Maëlle. >> Den torsdag 9 maj 2019 12:10:14 CEST, Rainer M Krug skrev: >> >> >> Thanks Gabor. >> >> This gives me an impressive long list. Is there a way to see this >> graphically? Parsing seems to be a long, tedious process. >> >> I want to identify packages which I should leave out to reduce the number of >> (indirect) dependencies. >> >> Rainer >> >> >>> On 9 May 2019, at 11:24, Gábor Csárdi wrote: >>> >>> You can do something like this with https://github.com/r-lib/pkgdepends: >>> >>> pr <- pkgdepends::remotes()$new("local::.", library = tempfile()) >>> #> ℹ Creating library directory: >>> `/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5wgn/T//Rtmpo5NL9R/filee95427c73f55` >>> >>> pr$solve() >>> #> ℹ Checking for package metadata updates >>> #> ✔ All 10 metadata files are current. >>> #> ✔ Using session cached package metadata >>> #> ✔ Using cached package metadata >>> #> PKG SOLUTION, 1 refs, resolved in 1.2s, solved in 193ms >>> ─── >>> #> local::. >>> #> Dependencies: >>> #> github: >>> #>r-lib/crancache, r-lib/rcmdcheck >>> #> standard: >>> #>askpass, assertthat, backports, base64enc, bit, bit64, blob, callr, >>> #>cli, clisymbols, cranlike, crayon, curl, DBI, debugme, desc, >>> #>digest, evaluate, fansi, glue, gmailr, highr, hms, httr, jsonlite, >>> #>knitr, magrittr, markdown, memoise, mime, openssl, parsedate, >>> #>pillar, pkgbuild, pkgconfig, prettyunits, processx, progress, ps, >>> #>R6, rappdirs, Rcpp, rematch2, remotes, rlang, rprojroot, RSQLite, >>> #>sessioninfo, stringi, stringr, sys, tibble, utf8, whoami, withr, >>> #>xfun, xopen, yaml >>> >>> tibble::as_tibble(pr$get_solution()$data) >>> #> # A tibble: 61 x 27 >>> #>ref type direct status package version license >>> needscompilation priority >>> #> >>> #> 1 loca… local TRUE OKrevdep… 1.0.0.… MIT + … NA NA >>> #> 2 askp… stan… FALSE OKaskpass 1.1NA FALSENA >>> #> 3 asse… stan… FALSE OKassert… 0.2.1 NA FALSENA >>> #> 4 back… stan… FALSE OKbackpo… 1.1.4 NA FALSENA >>> #> 5 base… stan… FALSE OKbase64… 0.1-3 NA FALSENA >>> #> 6 bit64 stan… FALSE OKbit64 0.9-7 NA FALSENA >>> #>
[R-pkg-devel] Package write access for storing new files
Hi I am writing a package which downloads files which become part of the package (only useful for functions in the package and independent of the working directory) into system.file("installedSchemes", package = "dmdScheme") (See https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_install.R#L71-L75 for the function). I know that is regulated for R packages, but I can’t find it. Is this allowed for R packages? Will this be allowed for CRAN? I would prefer not to allow custom paths here, as it would complicate things. Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] CRAN submission with "possibly unsafe calls" or alternative approach?
Hi In my package `dmdScheme` I define three variables. Depending on a state in the package (a selected metadata schemes) these are set as followed from within the package: ``` unlockBinding("dmdScheme_example", as.environment("package:dmdScheme")) assign("dmdScheme_example", scheme_example, "package:dmdScheme") lockBinding("dmdScheme_example", as.environment("package:dmdScheme")) scheme_raw <- as_dmdScheme_raw(scheme_example) unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme")) assign("dmdScheme_raw", scheme_raw, "package:dmdScheme") lockBinding("dmdScheme_raw", as.environment("package:dmdScheme")) scheme <- as_dmdScheme(scheme_raw, keepData = FALSE, checkVersion = FALSE) unlockBinding("dmdScheme", as.environment("package:dmdScheme")) assign("dmdScheme", scheme, "package:dmdScheme") lockBinding("dmdScheme", as.environment("package:dmdScheme”)) ``` ( See https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_use.R#L37-L49 ) My reasoning is that I want to lock these variables, as they are essential to the functioning of the package. But I get, probably not surprising, the following NOTE: ``` * checking R code for possible problems ... NOTE Found the following possibly unsafe calls: File ‘dmdScheme/R/scheme_use.R’: unlockBinding("dmdScheme_example", as.environment("package:dmdScheme")) unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme")) unlockBinding("dmdScheme", as.environment("package:dmdScheme")) ``` For the submission to CRAN, Can I disregard this note and explain it during the submission? My second question concerns the values itself. I set the variables to NULL in the /data folder in the package, but even after they are set as above, the valuee in `dmdScheme::dmdScheme` is still NULL: ``` > names(dmdScheme) [1] "Experiment" "Genus""Treatments" "Measurement" [5] "DataExtraction" "DataFileMetaData" > names(dmdScheme::dmdScheme) NULL > ``` Is there a way, that I can change the value of dmdScheme::… variables during runtime? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Package write access for storing new files
Thanks for the tip with rappdirs. I am just not sure, how I should handle the questions, as it should also run in a shiny application? > On 6 Dec 2019, at 10:12, Gregory Jefferis wrote: > > I use rappdirs to construct a platform appropriate consistent package > download directory. But for CRAN I believe you will need to obtain some kind > of user confirmation at least once to allow this behaviour. Best, Greg. > > Sent from my iPhone > >> On 6 Dec 2019, at 08:43, Rainer M Krug wrote: >> >> Hi >> >> I am writing a package which downloads files which become part of the >> package (only useful for functions in the package and independent of the >> working directory) into >> >> system.file("installedSchemes", package = "dmdScheme") >> >> (See >> https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_install.R#L71-L75 >> for the function). >> >> I know that is regulated for R packages, but I can’t find it. >> >> Is this allowed for R packages? Will this be allowed for CRAN? >> >> I would prefer not to allow custom paths here, as it would complicate things. >> >> Thanks, >> >> Rainer >> >> >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> >> Orcid ID: -0002-7490-0066 >> >> Department of Evolutionary Biology and Environmental Studies >> University of Zürich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Zürich >> Switzerland >> >> Office:+41 (0)44 635 47 64 >> Cell: +41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch >> rai...@krugs.de >> Skype: RMkrug >> >> PGP: 0x0F52F982 >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] CRAN submission with "possibly unsafe calls" or alternative approach?
Thanks for the clarification - I was not aware of that. I will put the variables in an environment and call them via a function before submission to CRAN.. Thanks, Rainer > On 6 Dec 2019, at 12:03, peter dalgaard wrote: > > I think you may want to rethink the mechanism. > > Locked bindings are generally there to allow the compiler to make assumptions > about the type, etc., of objects (or rather: not make assumptions because it > will know what the type is). Unlocking invalidates this and may trigger > recompilation or introduce errors. (There are people who know the details > much better than I do). > > I seem to recall that people have come up with ways to set up an environment > which can contain mutable objects of this sort. > > -pd > >> On 6 Dec 2019, at 10:05 , Rainer M Krug wrote: >> >> Hi >> >> In my package `dmdScheme` I define three variables. Depending on a state in >> the package (a selected metadata schemes) these are set as followed from >> within the package: >> >> ``` >> unlockBinding("dmdScheme_example", as.environment("package:dmdScheme")) >> assign("dmdScheme_example", scheme_example, "package:dmdScheme") >> lockBinding("dmdScheme_example", as.environment("package:dmdScheme")) >> >> >> scheme_raw <- as_dmdScheme_raw(scheme_example) >> unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme")) >> assign("dmdScheme_raw", scheme_raw, "package:dmdScheme") >> lockBinding("dmdScheme_raw", as.environment("package:dmdScheme")) >> >> >> scheme <- as_dmdScheme(scheme_raw, keepData = FALSE, checkVersion = FALSE) >> unlockBinding("dmdScheme", as.environment("package:dmdScheme")) >> assign("dmdScheme", scheme, "package:dmdScheme") >> lockBinding("dmdScheme", as.environment("package:dmdScheme”)) >> ``` >> >> ( See >> https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/b97e7b5ef116476e065aeec1da1050eecbd6adf7/R/scheme_use.R#L37-L49 >> ) >> >> My reasoning is that I want to lock these variables, as they are essential >> to the functioning of the package. >> >> But I get, probably not surprising, the following NOTE: >> >> >> ``` >> * checking R code for possible problems ... NOTE >> Found the following possibly unsafe calls: >> File ‘dmdScheme/R/scheme_use.R’: >> unlockBinding("dmdScheme_example", as.environment("package:dmdScheme")) >> unlockBinding("dmdScheme_raw", as.environment("package:dmdScheme")) >> unlockBinding("dmdScheme", as.environment("package:dmdScheme")) >> ``` >> >> For the submission to CRAN, Can I disregard this note and explain it during >> the submission? >> >> My second question concerns the values itself. I set the variables to NULL >> in the /data folder in the package, but even after they are set as above, >> the valuee in `dmdScheme::dmdScheme` is still NULL: >> >> ``` >>> names(dmdScheme) >> [1] "Experiment" "Genus""Treatments" "Measurement" >> [5] "DataExtraction" "DataFileMetaData" >>> names(dmdScheme::dmdScheme) >> NULL >>> >> ``` >> >> Is there a way, that I can change the value of dmdScheme::… variables during >> runtime? >> >> Thanks, >> >> Rainer >> >> >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> >> Orcid ID: 0000-0002-7490-0066 >> >> Department of Evolutionary Biology and Environmental Studies >> University of Zürich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Zürich >> Switzerland >> >> Office: +41 (0)44 635 47 64 >> Cell:+41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch >> rai...@krugs.de >> Skype: RMkrug >> >> PGP: 0x0F52F982 >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Office: A 4.23 > Email: pd@cbs.dk Priv: pda...@gmail.com > > > > > > > > > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] DOI in of package in DESCRIPTION file
Hi UI am preparing my package for CRAN. I have a DOI for my package, and would like to add Ito the DESCRIPTION file. At the moment, I am adding DOI: https://zenodo.org/record/3229615 To the DESCRIPTION file. This raises not an error during check, but tells me, that DOI is a unknown field. Is there a recommended way, of adding the DOI of a package to the DESCRIPTION file? I did not find anything when googling. Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] DOI in of package in DESCRIPTION file
Thanks Uwe, I will do so. Rainer > On 16 Dec 2019, at 15:56, Uwe Ligges wrote: > > > > On 16.12.2019 15:34, Rainer M Krug wrote: >> Hi >> UI am preparing my package for CRAN. I have a DOI for my package, and would >> like to add Ito the DESCRIPTION file. >> At the moment, I am adding >> DOI: https://zenodo.org/record/3229615 > > This is not a DOI, the DOI is actually > > 10.5281/zenodo.3229615 > > and we do not have a field fo it, but you can cite it within the Description > field and link to it via a sentence and DOI such as: > > "See R.M. Krug and O. Petchey (2019) ." > > Best, > Uwe Ligges > > >> To the DESCRIPTION file. This raises not an error during check, but tells >> me, that DOI is a unknown field. >> Is there a recommended way, of adding the DOI of a package to the >> DESCRIPTION file? I did not find anything when googling. >> Thanks, >> Rainer >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> Orcid ID: -0002-7490-0066 >> Department of Evolutionary Biology and Environmental Studies >> University of Zürich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Zürich >> Switzerland >> Office: +41 (0)44 635 47 64 >> Cell:+41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch >> rai...@krugs.de >> Skype: RMkrug >> PGP: 0x0F52F982 >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] DOI in of package in DESCRIPTION file
Thanks Robert, I will add this as well as in the Description field. Rainer > On 16 Dec 2019, at 15:52, Robert M. Flight wrote: > > Are you wanting to provide the DOI for citation purposes? Then I would > recommend making sure you have a valid citation file > https://r-pkgs.org/inst.html#inst-citation > <https://r-pkgs.org/inst.html#inst-citation> (which should be fine having a > DOI field), and add it to the README as well. > > -Robert > > Robert M Flight, PhD > Bioinformatics Research Associate > Puller of Rabbits from Hats > Research Parasite > Resource Center for Stable Isotope Resolved Metabolomics > Manager, Systems Biology and Omics Integration Journal Club > Markey Cancer Center > CC434 Roach Building > University of Kentucky > Lexington, KY > > Twitter: @rmflight > Web: rmflight.github.io <http://rmflight.github.io/> > ORCID: http://orcid.org/-0001-8141-7788 > <http://orcid.org/-0001-8141-7788> > EM rfligh...@gmail.com <mailto:rfligh...@gmail.com> > PH 502-509-1827 > > To call in the statistician after the experiment is done may be no more than > asking him to perform a post-mortem examination: he may be able to say what > the experiment died of. - Ronald Fisher > > On Mon, Dec 16, 2019 at 9:43 AM Rainer M Krug <mailto:rai...@krugs.de>> wrote: > Hi > > UI am preparing my package for CRAN. I have a DOI for my package, and would > like to add Ito the DESCRIPTION file. > > At the moment, I am adding > > DOI: https://zenodo.org/record/3229615 > <https://zenodo.org/record/3229615> > > To the DESCRIPTION file. This raises not an error during check, but tells me, > that DOI is a unknown field. > > Is there a recommended way, of adding the DOI of a package to the DESCRIPTION > file? I did not find anything when googling. > > Thanks, > > Rainer > > > > -- > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, > UCT), Dipl. Phys. (Germany) > > Orcid ID: -0002-7490-0066 > > Department of Evolutionary Biology and Environmental Studies > University of Zürich > Office Y34-J-74 > Winterthurerstrasse 190 > 8075 Zürich > Switzerland > > Office: +41 (0)44 635 47 64 > Cell: +41 (0)78 630 66 57 > email: rainer.k...@uzh.ch <mailto:rainer.k...@uzh.ch> > rai...@krugs.de <mailto:rai...@krugs.de> > Skype: RMkrug > > PGP: 0x0F52F982 > > __ > R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing > list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > <https://stat.ethz.ch/mailman/listinfo/r-package-devel> -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Proper way to ask a user to set permanent variables?
I second that - it provides the most consistent way of storing information permanently. I was in a similar situation, and ended up using the function at https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/master/R/cache.R <https://github.com/Exp-Micro-Ecol-Hub/dmdScheme/blob/master/R/cache.R> And the location `rappdirs::user_config_dir(appname = "dmdScheme", appauthor = "dmdScheme”)` as the permanent cache. I either either - use a temporary cache if the cache does not exist - if the cache does exist, use that one, and - use the `createPermanent` argument to create the cache so that it can be used. Cheers, Rainer > On 14 Jan 2020, at 17:34, Gábor Csárdi wrote: > > You can use the rappdirs package to look up the standard places for > permanent config, cache etc. files. E.g. on macOS: > > ❯ rappdirs::user_cache_dir() > [1] "/Users/gaborcsardi/Library/Caches" > > Gabor > > On Tue, Jan 14, 2020 at 4:10 PM Jonathan Greenberg wrote: >> >> Folks: >> >> My package gdalUtils is a wrapper for a set of binaries on disk (the GDAL >> Utilities) -- these have about as many places to install as there are people >> installing it, and the system environment variables aren't always much help >> (they aren't always set) for locating them. My package is trying to >> dummy-proof the usage as much as possible, so one of the things it does is >> if it can't find the install, it goes search for the install in, first, >> standard locations and runs a short test to see if the install is valid and, >> if not, goes on a longer hunt. Right now, it does this search everytime >> someone boots up R and uses it, which slows down the process. >> >> What I'm wondering is twofold: >> >> 1) Are there any packages/methods by which user "preferences" are saved that >> don't require saving workspaces (e.g. does R have a standardized >> "preferences" location that packages can use). >> >> 2) If the answer to #1 is "no", what is the preferred method for saving >> variables for use by packages that are always restored on boot -- e.g. I was >> thinking something like .Renviron but I think that's Rstudio only. I'm >> concerned with workspace-type saves since I feel like that often results in >> a ton of variables being saved. >> >> Thanks! >> >> --j >> >>[[alternative HTML version deleted]] >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Proper way to ask a user to set permanent variables?
Hi Dirk, The package-local environment is definitely a good approach (I use it myself an a few packages). And the options() are nice as they represent a standardised interface in R (Note to myself: I should use these more in my packages). But unless I am missing something, these are not persistent between sessions? I assume, that is not an issue in your case? Cheers, Rainer > On 15 Jan 2020, at 23:47, Dirk Eddelbuettel wrote: > > > Jonathan, > > In all but one (maybe two?) of my packages I found relying on options() > sufficient. I usually follow the somewhat-common pattern of creating a > package-local environment in R/init.R or R/zzz.R. I then fill it with values > reflecting options() (often under a tag starting with the package name) > and/or environment variables, and sometime also provide 'setters' to update > the environment values. That have proven to be both good enough and rather > robust and, as an added benefit, does not depend on anything further. > > Cheers, Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] R CMD build hanging for some but not all packages
> On 10 Feb 2020, at 17:58, Gábor Csárdi wrote: > > Maybe you have large, ignored files in the package directory? R first > creates a copy of the whole directory and only applies `.Rbuildignore` > after that. THANKS - you solved my question without me having to answer it. As I am using a makefile to build the package, I can easily rename the ignored directories before calling build. But the question is why are these ignored directories scanned before building the package? They should be ignored anyway? Rainer > > Gabor > > On Mon, Feb 10, 2020 at 4:54 PM Hong Ooi via R-package-devel > wrote: >> >> Actually, cancel that: it finished successfully, but took 3 minutes to >> prepare the package: >> >> r$> devtools::build() >> v checking for file 'C:\Users\hongo\Documents\GitHub\AzureStor/DESCRIPTION' >> - preparing 'AzureStor': (3m 4s) >> v checking DESCRIPTION meta-information ... >> - installing the package to build vignettes >> v creating vignettes (6.5s) >> - checking for LF line-endings in source and make files and shell scripts >> (13.8s) >> - checking for empty or unneeded directories >> - building 'AzureStor_3.1.0.9000.tar.gz' >> >> This is really weird, I'm used to the package prep step taking 10 seconds at >> most. >> >> >> -Original Message- >> From: R-package-devel On Behalf Of >> Hong Ooi via R-package-devel >> Sent: Tuesday, 11 February 2020 3:50 AM >> To: r-package-devel@r-project.org >> Subject: [EXTERNAL] [R-pkg-devel] R CMD build hanging for some but not all >> packages >> >> This is with R 3.6.2 on Windows 10 Pro 1909. >> >> In the last couple of weeks, devtools::build() and devtools::check() have >> started hanging on some, but not all, of my packages. After some poking >> around, I discovered that it's actually R CMD build that is having problems, >> right after the "checking for file 'DESCRIPTION'" step. >> >> A reproducible example can be found by cloning my AzureStor package: >> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2FAzureStor&data=02%7C01%7Chongooi%40microsoft.com%7Cae76a58d39b64b491a1008d7ae4955a9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637169502304943506&sdata=RW3TQM2D%2F3X43oGhiywDyKd%2F4oo5hFkOoVwZTUe9cOw%3D&reserved=0 >> If you run "R CMD build ." in the package directory, it should hang. This >> is a relatively simple package that doesn't require compilation, although it >> does import some commonly-used packages like httr, curl, jsonlite and xml2. >> >> As far as I can tell, R on Ubuntu works fine. What's going on? >> >> __ >> R-package-devel@r-project.org mailing list >> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=02%7C01%7Chongooi%40microsoft.com%7Cae76a58d39b64b491a1008d7ae4955a9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637169502304943506&sdata=DPyD6zGGcxq41irkaMfMLyjnmqSB96PiIxIh9N2p%2Ft4%3D&reserved=0 >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] R CMD build hanging for some but not all packages
> On 11 Feb 2020, at 09:42, Gábor Csárdi wrote: > > On Tue, Feb 11, 2020 at 8:38 AM Rainer M Krug <mailto:rai...@krugs.de>> wrote: >> >> >> >> On 10 Feb 2020, at 17:58, Gábor Csárdi wrote: >> >> Maybe you have large, ignored files in the package directory? R first >> creates a copy of the whole directory and only applies `.Rbuildignore` >> after that. >> >> THANKS - you solved my question without me having to answer it. As I am >> using a makefile to build the package, I can easily rename the ignored >> directories before calling build. >> >> But the question is why are these ignored directories scanned before >> building the package? They should be ignored anyway? >> >> Rainer > > A makefile is a good idea, but I would rather move the files that are > needed to a temporary directory, instead of temporarily renaming > unneeded files, because if the makefile fails, then you won't restore > them and your project will be in a broken state. You are right. Having two targets (prepare build, finalise build) which move the files and put them back afterwards would be the best option (and make the build call both). Is there a way to have an .onExit() type function in a makefile? Rainer > > Gabor > > [...] -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] R CMD build hanging for some but not all packages
> On 11 Feb 2020, at 09:54, Gábor Csárdi wrote: > > On Tue, Feb 11, 2020 at 8:52 AM Rainer M Krug wrote: >> On 11 Feb 2020, at 09:42, Gábor Csárdi wrote: >> On Tue, Feb 11, 2020 at 8:38 AM Rainer M Krug wrote: >> On 10 Feb 2020, at 17:58, Gábor Csárdi wrote: >> >> Maybe you have large, ignored files in the package directory? R first >> creates a copy of the whole directory and only applies `.Rbuildignore` >> after that. >> >> THANKS - you solved my question without me having to answer it. As I am >> using a makefile to build the package, I can easily rename the ignored >> directories before calling build. >> >> But the question is why are these ignored directories scanned before >> building the package? They should be ignored anyway? >> >> Rainer >> >> >> A makefile is a good idea, but I would rather move the files that are >> needed to a temporary directory, instead of temporarily renaming >> unneeded files, because if the makefile fails, then you won't restore >> them and your project will be in a broken state. >> >> >> You are right. Having two targets (prepare build, finalise build) which move >> the files and put them back afterwards would be the best option (and make >> the build call both). >> >> Is there a way to have an .onExit() type function in a makefile? > > The on-exit mechanism can fail as well. It is just better not to move > around the files of the project I think. True. Thanks, Rainer > > Gabor > > [...] -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] [EXTERNAL] R CMD build hanging for some but not all packages
Yes - I would suggest that this would be a useful change. As the files in .Rbuildignore are ignored anyway during build. So the ignoring could be done at the copying stage and not during the building stage? Rainer > On 11 Feb 2020, at 13:20, Hong Ooi wrote: > > They are scanned probably because R CMD build does something like cp * to > copy everything to a temp folder first up, before processing it. An argument > could be made that it should manually loop through all files and dirs, > checking each against .Rbuildignore before copying. > > > From: Rainer M Krug > Sent: Tuesday, 11 February 2020 7:38 PM > To: Gábor Csárdi > Cc: Hong Ooi ; r-package-devel@r-project.org > Subject: [EXTERNAL] Re: [R-pkg-devel] R CMD build hanging for some but not > all packages > > > > > On 10 Feb 2020, at 17:58, Gábor Csárdi <mailto:csardi.ga...@gmail.com> wrote: > > Maybe you have large, ignored files in the package directory? R first > creates a copy of the whole directory and only applies `.Rbuildignore` > after that. > > > > THANKS - you solved my question without me having to answer it. As I am using > a makefile to build the package, I can easily rename the ignored directories > before calling build. > > But the question is why are these ignored directories scanned before building > the package? They should be ignored anyway? > > Rainer > > > > > Gabor > > On Mon, Feb 10, 2020 at 4:54 PM Hong Ooi via R-package-devel > <mailto:r-package-devel@r-project.org> wrote: > > > Actually, cancel that: it finished successfully, but took 3 minutes to > prepare the package: > > r$> devtools::build() > v checking for file 'C:\Users\hongo\Documents\GitHub\AzureStor/DESCRIPTION' > - preparing 'AzureStor': (3m 4s) > v checking DESCRIPTION meta-information ... > - installing the package to build vignettes > v creating vignettes (6.5s) > - checking for LF line-endings in source and make files and shell scripts > (13.8s) > - checking for empty or unneeded directories > - building 'AzureStor_3.1.0.9000.tar.gz' > > This is really weird, I'm used to the package prep step taking 10 seconds at > most. > > > -Original Message- > From: R-package-devel <mailto:r-package-devel-boun...@r-project.org> On > Behalf Of Hong Ooi via R-package-devel > Sent: Tuesday, 11 February 2020 3:50 AM > To: mailto:r-package-devel@r-project.org > Subject: [EXTERNAL] [R-pkg-devel] R CMD build hanging for some but not all > packages > > This is with R 3.6.2 on Windows 10 Pro 1909. > > In the last couple of weeks, devtools::build() and devtools::check() have > started hanging on some, but not all, of my packages. After some poking > around, I discovered that it's actually R CMD build that is having problems, > right after the "checking for file 'DESCRIPTION'" step. > > A reproducible example can be found by cloning my AzureStor package: > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2FAzureStor&data=02%7C01%7Chongooi%40microsoft.com%7C7962d328eb984556a2e708d7aecdc0db%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637170071036915332&sdata=cmY0VPEiEgcuhI%2B4wIT8iIimQhq7751IJ0KHdsPaMtg%3D&reserved=0 > If you run "R CMD build ." in the package directory, it should hang. This is > a relatively simple package that doesn't require compilation, although it > does import some commonly-used packages like httr, curl, jsonlite and xml2. > > As far as I can tell, R on Ubuntu works fine. What's going on? > > __ > mailto:R-package-devel@r-project.org mailing list > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=02%7C01%7Chongooi%40microsoft.com%7C7962d328eb984556a2e708d7aecdc0db%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637170071036925320&sdata=XbCKzK3no6v5asG5assjd7oxy%2BOk9or2LbS%2Fkg8GESw%3D&reserved=0 > > __ > mailto:R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > > ______ > mailto:R-package-devel@r-project.org mailing list > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=02%7C01%7Chongooi%40microsoft.com%7C7962d328eb984556a2e708d7aecdc0db%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637170071036925320&sdata=XbCKzK3no6v5asG5assjd7oxy%2BOk9or2LbS%2Fkg8GESw%3D&reserved=0 > > -- > Rainer M. Krug, PhD (Conser
Re: [R-pkg-devel] R CMD build hanging for some but not all packages
Thanks Gabor. The speed is OK (much faster than copying everything), but in my case, all files are ignored, although the package builds fine. So the .Rbuildignore is fine for R. It looks as followed: ``` ^.*\.Rproj$ ^\.Rproj\.user$ ^Makefile$ ^Readme\\.$ ^README\..*$ ## Temporary folder ^tmp$ ^temp$ ## Example Data Folder ^inst/0.raw.data$ ^inst/1.pre-processed.data$ ``` Rainer > On 11 Feb 2020, at 15:30, Gábor Csárdi wrote: > > It is actually rather complicated, because .Rbuildignore can have > regular expressions, that refer to files or directories, and for the > latter you need to ignore the whole directory. You can look up in the > R source code how R does it, maybe you can reuse that code. > > Here is a quick and dirty function that does it, mostly based on code > from the remotes package. It is very slow for me currently, mainly > because my .git directory has thousands of files. Still faster than > copying a huge directory I guess. > > Speeding it up is left as an exercise. :) I think doing a manual > filtering for /.git initially would probably make it fast enough. Oh, > it is also not super tested. :) > > without_ignored <- function(path = ".", >extra = c("^\\.git$", "^\\.gitignore$")) { > paths <- dir(path, recursive = TRUE, all.files = TRUE) > ignore_file <- file.path(path, ".Rbuildignore") > ignore <- c(extra, tools:::get_exclude_patterns()) > > if (file.exists(ignore_file)) { >ignore <- c(ignore, readLines(ignore_file, warn = FALSE)) > } > > vlapply <- function(X, FUN, ..., USE.NAMES = TRUE) { >vapply(X, FUN, logical(1L), ..., USE.NAMES = USE.NAMES) > } > > matches_ignores <- function(x) { >any(vlapply(ignore, grepl, x, perl = TRUE, ignore.case = TRUE)) > } > > directories <- function(paths) { >dirs <- unique(dirname(paths)) >out <- dirs[dirs != "."] >while(length(dirs) > 0 && any(dirs != ".")) { > out <- unique(c(out, dirs[dirs != "."])) > dirs <- unique(dirname(dirs)) >} >sort(out) > } > > # We need to search for the paths as well as directories in the path, so > # `^foo$` matches `foo/bar` > should_ignore <- function(path) { >any(vlapply(c(path, directories(path)), matches_ignores)) > } > > paths[! vlapply(paths, should_ignore)] > } > > Gabor > > On Tue, Feb 11, 2020 at 2:23 PM Ben Bolker wrote: >> >> >> Something like file.copy( setdiff(list.files(recursive=TRUE)), >> scan(".Rbuildignore", what=character())), to = destdir) ? >> >> On 2020-02-11 8:50 a.m., Rainer Krug wrote: >>> Thinking about it - what would be the easiest way, to copy the package, >>> excluding files in .Rbuidignore, into the temp directory? >>> >>> I would like to use directly the .Rbuildignore file, to exclude the files >>> from copying. >>> >>> Any suggestions? >>> >>> >>>> On 11 Feb 2020, at 10:20, Rainer M Krug wrote: >>>> >>>> >>>> >>>>> On 11 Feb 2020, at 09:54, Gábor Csárdi wrote: >>>>> >>>>> On Tue, Feb 11, 2020 at 8:52 AM Rainer M Krug wrote: >>>>>> On 11 Feb 2020, at 09:42, Gábor Csárdi wrote: >>>>>> On Tue, Feb 11, 2020 at 8:38 AM Rainer M Krug wrote: >>>>>> On 10 Feb 2020, at 17:58, Gábor Csárdi wrote: >>>>>> >>>>>> Maybe you have large, ignored files in the package directory? R first >>>>>> creates a copy of the whole directory and only applies `.Rbuildignore` >>>>>> after that. >>>>>> >>>>>> THANKS - you solved my question without me having to answer it. As I am >>>>>> using a makefile to build the package, I can easily rename the ignored >>>>>> directories before calling build. >>>>>> >>>>>> But the question is why are these ignored directories scanned before >>>>>> building the package? They should be ignored anyway? >>>>>> >>>>>> Rainer >>>>>> >>>>>> >>>>>> A makefile is a good idea, but I would rather move the files that are >>>>>> needed to a temporary directory, instead of temporarily renaming >>>>>> unneeded files, because if the makefile fails, then you won't restore >>>>>> them and your project will be in a broken state. >>>>>> >>>>
[R-pkg-devel] Strange leftovers after check by CRAN
Hi My package dmdScheme gets always one note after submission to CRAN: ... * checking for detritus in the temp directory ... NOTE Found the following files/directories: ‘calibre_4.99.4_tmp_8yyefjbo’ ‘calibre_4.99.4_tmp_ft15_af5’ ‘calibre_4.99.4_tmp_jy4e07d6’ ‘calibre_4.99.4_tmp_oxx_azo2’ ‘runtime-hornik’ * DONE These leftovers are only reported from CRAN, and locally everything is fine. Uwe recommended to set the environmental variable R_CHECK_THINGS_IN_CHECK_DIR_=true But this does not change anything, I get the report back ... * checking for detritus in the temp directory ... OK * DONE Any suggestions how I can track down the where these are coming from? Each time my package has to go through a manual check at CRAN… Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Strange leftovers after check by CRAN
> On 19 Mar 2020, at 17:45, Kevin Ushey wrote: > > FWIW if I search for calibre_4.99.4 I see that it's a package on the > Debian repositories (a packaged copy of https://calibre-ebook.com/ it > seems?) so it seems like something is intentionally or unintentionally > trying to download and use that. OK - that explains, why I not seeing the detritus on my Mac. > > The only hint I see is that Bookdown does support calibre as an output. I have no package book down installed on my system, wherefore dmdScheme does not depend on it. > > As an aside, I'm not sure if that's a typo but you're missing a > leading underscore in the envvar: > > _R_CHECK_THINGS_IN_CHECK_DIR_=true Might be - but I tried it with the _ and also no detritus (see above). I don’t feel like installing a virtual machine / docker to follow this up. OK. Thanks, Rainer > > Best, > Kevin > > On Thu, Mar 19, 2020 at 9:21 AM Rainer M Krug wrote: >> >> Hi >> >> My package dmdScheme gets always one note after submission to CRAN: >> >> >> ... >> * checking for detritus in the temp directory ... NOTE >> Found the following files/directories: >> ‘calibre_4.99.4_tmp_8yyefjbo’ ‘calibre_4.99.4_tmp_ft15_af5’ >> ‘calibre_4.99.4_tmp_jy4e07d6’ ‘calibre_4.99.4_tmp_oxx_azo2’ >> ‘runtime-hornik’ >> * DONE >> >> These leftovers are only reported from CRAN, and locally everything is fine. >> Uwe recommended to set the environmental variable >> >> R_CHECK_THINGS_IN_CHECK_DIR_=true >> >> But this does not change anything, I get the report back >> >> ... >> * checking for detritus in the temp directory ... OK >> * DONE >> >> Any suggestions how I can track down the where these are coming from? Each >> time my package has to go through a manual check at CRAN… >> >> Thanks, >> >> Rainer >> >> >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> >> Orcid ID: -0002-7490-0066 >> >> Department of Evolutionary Biology and Environmental Studies >> University of Zürich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Zürich >> Switzerland >> >> Office: +41 (0)44 635 47 64 >> Cell: +41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch >>rai...@krugs.de >> Skype: RMkrug >> >> PGP: 0x0F52F982 >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Strange leftovers after check by CRAN
That’s good to know - thanks. As I am checking with —as-cran, these were all on anyway. Cheers, Rainer > On 20 Mar 2020, at 10:37, Tomas Kalibera wrote: > > On 3/19/20 6:03 PM, Max Turgeon wrote: >> Is there perhaps a typo in the environment variable name? This line suggests >> there should be an underscore at the beginning too: >> >> https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L6028 >> <https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L6028> > Also the correct name is in R Internals, where the variable is documented. > > Tomas > >> >> Max Turgeon >> Assistant Professor >> Department of Statistics >> Department of Computer Science >> University of Manitoba >> maxturgeon.ca<http://maxturgeon.ca> <http://maxturgeon.ca/> >> >> >> ____ >> From: R-package-devel >> <mailto:r-package-devel-boun...@r-project.org> on behalf of Rainer M Krug >> <mailto:rai...@krugs.de> >> Sent: March 19, 2020 11:21:08 AM >> To: R Package Devel >> Subject: [R-pkg-devel] Strange leftovers after check by CRAN >> >> Hi >> >> My package dmdScheme gets always one note after submission to CRAN: >> >> >> ... >> * checking for detritus in the temp directory ... NOTE >> Found the following files/directories: >> �calibre_4.99.4_tmp_8yyefjbo� �calibre_4.99.4_tmp_ft15_af5� >> �calibre_4.99.4_tmp_jy4e07d6� �calibre_4.99.4_tmp_oxx_azo2� >> �runtime-hornik� >> * DONE >> >> These leftovers are only reported from CRAN, and locally everything is fine. >> Uwe recommended to set the environmental variable >> >> R_CHECK_THINGS_IN_CHECK_DIR_=true >> >> But this does not change anything, I get the report back >> >> ... >> * checking for detritus in the temp directory ... OK >> * DONE >> >> Any suggestions how I can track down the where these are coming from? Each >> time my package has to go through a manual check at CRAN� >> >> Thanks, >> >> Rainer >> >> >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> >> Orcid ID: -0002-7490-0066 >> >> Department of Evolutionary Biology and Environmental Studies >> University of Z�rich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Z�rich >> Switzerland >> >> Office: +41 (0)44 635 47 64 >> Cell:+41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch <mailto:rainer.k...@uzh.ch> >> rai...@krugs.de <mailto:rai...@krugs.de> >> Skype: RMkrug >> >> PGP: 0x0F52F982 >> >> __ >> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing >> list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> <https://stat.ethz.ch/mailman/listinfo/r-package-devel> >> >> [[alternative HTML version deleted]] >> >> >> >> __ >> R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing >> list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> <https://stat.ethz.ch/mailman/listinfo/r-package-devel> > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?
Hi I have a package called `plantuml` (https://github.com/rkrug/plantuml) which converts plantuml code to UML graphs. It uses for this the java program https://plantuml.com which is Open Source. As it is not allowed to distribute a binary with an R package, I use the approach of a function which downloads the jar file into the directory `system.file("jar/plantuml.jar", package = "plantuml”)`. This works nicely, and at the moment, the function is called automatically before the plantuml.jar is used. Now I would like to submit the package to CRAN. I can’t find the guidelines anymore, so I am asking here: What is the appropriate way of handling this? I can think of a at least two ways of making it obvious to the user, that a binary is downloaded: 1) if the file plantuml.jar is not present, ask the user to run the function `updatePlantumlJar()` which downloads the jar to the original location in the package directory 2) tell the user to download the file manually and to put it somewhere, where the package will find it I would prefer the first version, as the plantuml.jar would be in the package directory, where usually nobody but the package is doing stuff. Any suggestions on how I could make this “CRAN conform”? Thanks a lot, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?
Thanks Duncan. > On 23 Jun 2020, at 14:35, Duncan Murdoch wrote: > > Your assumption that .jar files are not allowed is wrong: a number of > packages contain them: rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ... > There's a specific mention about how to include them in the CRAN policy > document: That’s good to know. > > "For Java .class and .jar files, the sources should be in a top-level java > directory in the source package (or that directory should explain how they > can be obtained)." So a tet file in the inst/jar directory giving the link to the GitHub repo would be fine in this case? > > If you still decide not to include your .jar file (maybe it is too big, for > example), I guess it would be stretching it a bit, as the jar file is 8.2 MB, and plantuml has regular continuous updates, so I would prefer to keep it dynamic. > then I think your option 1 is unusable for those people who can't write to > the library location because of permission problems. (Admin privileges are > often necessary to install packages in the main library.) Generally I think > everyone can install packages somewhere, but users do really get confused > when they have multiple library locations, possibly each containing a > different version of a package. So the suggested option would be to have a function, which 1) ask the user to create a directory in the home folder 2) download the jar file into that directory or, when no permission is granted, into the tmpdir() Thanks, no major changes necessary for that, Rainer > > Duncan Murdoch > > On 23/06/2020 8:18 a.m., Rainer M Krug wrote: >> Hi >> I have a package called `plantuml` (https://github.com/rkrug/plantuml) which >> converts plantuml code to UML graphs. It uses for this the java program >> https://plantuml.com which is Open Source. >> As it is not allowed to distribute a binary with an R package, I use the >> approach of a function which downloads the jar file into the directory >> `system.file("jar/plantuml.jar", package = "plantuml”)`. >> This works nicely, and at the moment, the function is called automatically >> before the plantuml.jar is used. >> Now I would like to submit the package to CRAN. I can’t find the guidelines >> anymore, so I am asking here: >> What is the appropriate way of handling this? >> I can think of a at least two ways of making it obvious to the user, that a >> binary is downloaded: >> 1) if the file plantuml.jar is not present, ask the user to run the function >> `updatePlantumlJar()` which downloads the jar to the original location in >> the package directory >> 2) tell the user to download the file manually and to put it somewhere, >> where the package will find it >> I would prefer the first version, as the plantuml.jar would be in the >> package directory, where usually nobody but the package is doing stuff. >> Any suggestions on how I could make this “CRAN conform”? >> Thanks a lot, >> Rainer >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> Orcid ID: -0002-7490-0066 >> Department of Evolutionary Biology and Environmental Studies >> University of Zürich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Zürich >> Switzerland >> Office: +41 (0)44 635 47 64 >> Cell:+41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch >> rai...@krugs.de >> Skype: RMkrug >> PGP: 0x0F52F982 >> -- >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >> UCT), Dipl. Phys. (Germany) >> Orcid ID: -0002-7490-0066 >> Department of Evolutionary Biology and Environmental Studies >> University of Zürich >> Office Y34-J-74 >> Winterthurerstrasse 190 >> 8075 Zürich >> Switzerland >> Office: +41 (0)44 635 47 64 >> Cell:+41 (0)78 630 66 57 >> email: rainer.k...@uzh.ch >> rai...@krugs.de >> Skype: RMkrug >> PGP: 0x0F52F982 >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] [EXTERNAL] Proper CRAN way - How to handle dependency of java jar file?
Thanks Hong - I like that. I found that package in the tools::R_user_dir() package - us that the one? Rainer > On 23 Jun 2020, at 15:07, Hong Ooi wrote: > > Another possibility, if you want the jar to be dynamic and also have a > standard location for it, is to write it to the R config/user dir. This is > available via R_user_dir() in R 4.0 (and earlier versions via the backports > package). An older alternative that still works is to use the rappdirs > package. > > > -Original Message- > From: R-package-devel On Behalf Of > Rainer M Krug > Sent: Tuesday, 23 June 2020 10:48 PM > To: Duncan Murdoch > Cc: R Package Devel > Subject: [EXTERNAL] Re: [R-pkg-devel] Proper CRAN way - How to handle > dependency of java jar file? > > Thanks Duncan. > >> On 23 Jun 2020, at 14:35, Duncan Murdoch wrote: >> >> Your assumption that .jar files are not allowed is wrong: a number of >> packages contain them: rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ... >> There's a specific mention about how to include them in the CRAN policy >> document: > > That’s good to know. > >> >> "For Java .class and .jar files, the sources should be in a top-level java >> directory in the source package (or that directory should explain how they >> can be obtained)." > > So a tet file in the inst/jar directory giving the link to the GitHub repo > would be fine in this case? > >> >> If you still decide not to include your .jar file (maybe it is too big, for >> example), > > > I guess it would be stretching it a bit, as the jar file is 8.2 MB, and > plantuml has regular continuous updates, so I would prefer to keep it dynamic. > > >> then I think your option 1 is unusable for those people who can't write to >> the library location because of permission problems. (Admin privileges are >> often necessary to install packages in the main library.) Generally I think >> everyone can install packages somewhere, but users do really get confused >> when they have multiple library locations, possibly each containing a >> different version of a package. > > So the suggested option would be to have a function, which > 1) ask the user to create a directory in the home folder > 2) download the jar file into that directory or, when no permission is > granted, into the tmpdir() > > Thanks, no major changes necessary for that, > > Rainer > > >> >> Duncan Murdoch >> >> On 23/06/2020 8:18 a.m., Rainer M Krug wrote: >>> Hi >>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) >>> which converts plantuml code to UML graphs. It uses for this the java >>> program https://plantuml.com which is Open Source. >>> As it is not allowed to distribute a binary with an R package, I use the >>> approach of a function which downloads the jar file into the directory >>> `system.file("jar/plantuml.jar", package = "plantuml”)`. >>> This works nicely, and at the moment, the function is called automatically >>> before the plantuml.jar is used. >>> Now I would like to submit the package to CRAN. I can’t find the guidelines >>> anymore, so I am asking here: >>> What is the appropriate way of handling this? >>> I can think of a at least two ways of making it obvious to the user, that a >>> binary is downloaded: >>> 1) if the file plantuml.jar is not present, ask the user to run the >>> function `updatePlantumlJar()` which downloads the jar to the original >>> location in the package directory >>> 2) tell the user to download the file manually and to put it somewhere, >>> where the package will find it >>> I would prefer the first version, as the plantuml.jar would be in the >>> package directory, where usually nobody but the package is doing stuff. >>> Any suggestions on how I could make this “CRAN conform”? >>> Thanks a lot, >>> Rainer >>> -- >>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >>> UCT), Dipl. Phys. (Germany) >>> Orcid ID: -0002-7490-0066 >>> Department of Evolutionary Biology and Environmental Studies >>> University of Zürich >>> Office Y34-J-74 >>> Winterthurerstrasse 190 >>> 8075 Zürich >>> Switzerland >>> Office: +41 (0)44 635 47 64 >>> Cell: +41 (0)78 630 66 57 >>> email: rainer.k...@uzh.ch >>> rai...@krugs.de >>> Skype: RMkrug >>> PGP:
Re: [R-pkg-devel] [EXTERNAL] Proper CRAN way - How to handle dependency of java jar file?
Perfect. You also mention the “backports” package - how can I use that one to be able to also support old versions of R? Thanks, Rainer > On 23 Jun 2020, at 16:34, Hong Ooi wrote: > > Yes, that’s the one. > > From: Rainer M Krug > Sent: Tuesday, 23 June 2020 11:12 PM > To: Hong Ooi > Cc: R Package Devel > Subject: Re: [EXTERNAL] [R-pkg-devel] Proper CRAN way - How to handle > dependency of java jar file? > > Thanks Hong - I like that. > > I found that package in the tools::R_user_dir() package - us that the one? > > Rainer > > > > On 23 Jun 2020, at 15:07, Hong Ooi <mailto:hong...@microsoft.com>> wrote: > > Another possibility, if you want the jar to be dynamic and also have a > standard location for it, is to write it to the R config/user dir. This is > available via R_user_dir() in R 4.0 (and earlier versions via the backports > package). An older alternative that still works is to use the rappdirs > package. > > > -Original Message----- > From: R-package-devel <mailto:r-package-devel-boun...@r-project.org>> On Behalf Of Rainer M Krug > Sent: Tuesday, 23 June 2020 10:48 PM > To: Duncan Murdoch <mailto:murdoch.dun...@gmail.com>> > Cc: R Package Devel <mailto:r-package-devel@r-project.org>> > Subject: [EXTERNAL] Re: [R-pkg-devel] Proper CRAN way - How to handle > dependency of java jar file? > > Thanks Duncan. > > > On 23 Jun 2020, at 14:35, Duncan Murdoch <mailto:murdoch.dun...@gmail.com>> wrote: > > Your assumption that .jar files are not allowed is wrong: a number of > packages contain them: rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ... > There's a specific mention about how to include them in the CRAN policy > document: > > That’s good to know. > > > > "For Java .class and .jar files, the sources should be in a top-level java > directory in the source package (or that directory should explain how they > can be obtained)." > > So a tet file in the inst/jar directory giving the link to the GitHub repo > would be fine in this case? > > > > If you still decide not to include your .jar file (maybe it is too big, for > example), > > > I guess it would be stretching it a bit, as the jar file is 8.2 MB, and > plantuml has regular continuous updates, so I would prefer to keep it dynamic. > > > > then I think your option 1 is unusable for those people who can't write to > the library location because of permission problems. (Admin privileges are > often necessary to install packages in the main library.) Generally I think > everyone can install packages somewhere, but users do really get confused > when they have multiple library locations, possibly each containing a > different version of a package. > > So the suggested option would be to have a function, which > 1) ask the user to create a directory in the home folder > 2) download the jar file into that directory or, when no permission is > granted, into the tmpdir() > > Thanks, no major changes necessary for that, > > Rainer > > > > > Duncan Murdoch > > On 23/06/2020 8:18 a.m., Rainer M Krug wrote: > > Hi > I have a package called `plantuml` (https://github.com/rkrug/plantuml > <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frkrug%2Fplantuml&data=02%7C01%7Chongooi%40microsoft.com%7C590b1587b3394bb6a8fd08d817770dc9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285147406339418&sdata=tDq%2Fnri4fwPoPvupKmloF47d5QH1Vb3J0lb5L17%2Fu%2FY%3D&reserved=0>) > which converts plantuml code to UML graphs. It uses for this the java > program https://plantuml.com > <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplantuml.com%2F&data=02%7C01%7Chongooi%40microsoft.com%7C590b1587b3394bb6a8fd08d817770dc9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285147406339418&sdata=5vv%2B%2BXZCPuoblNQUH9%2Fyaz8Fg39aV8XlNIMh1RawoU0%3D&reserved=0> > which is Open Source. > As it is not allowed to distribute a binary with an R package, I use the > approach of a function which downloads the jar file into the directory > `system.file("jar/plantuml.jar", package = "plantuml”)`. > This works nicely, and at the moment, the function is called automatically > before the plantuml.jar is used. > Now I would like to submit the package to CRAN. I can’t find the guidelines > anymore, so I am asking here: > What is the appropriate way of handling this? > I can think of a at least two ways of making it obvious to the user, that a > binary is downloaded: > 1) if the file plantuml.jar is not present, ask the user to
Re: [R-pkg-devel] Making possible the use of external java codes by downloading it
Please check out the recent thread "Proper CRAN way - How to handle dependency of java jar file?” About a week ago - I asked essentially the same questions. Cheers, Rainer > On 3 Jul 2020, at 10:15, Paul SAVARY wrote: > > Hello everyone, > > I would like to include external java codes (.jar files) to a package in > order to speed up some computations. > However, this would increase the package size above 5 Mb and this code would > not be working for users without java installation. > > Instead, I could include a default parameter in the function calling another > R package making the same computation but more slowly. It would be best for > users without java on their computer. > Besides, I could allow users to download the external java code from a stable > url, and include in the R function all the arguments to launch this java code > (wrapper for the java code). When downloaded, the jar file should be copied > directly into the extdata directory in the user computer if possible. > > Does it seem feasible to you? > > Many thanks > Regards > Paul > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Making possible the use of external java codes by downloading it
Pleas keep the list in CC so that they know tat you have a solution. Thanks. There is the function “Sys.which()” which returns the full path to an executable. Although in many cases correct, it can be that Java is installed but not in the path. So I have a variable called “java.path” which is used when java is called - the default is set to `java.path <- Sys.which("java”)` Plesase see https://github.com/rkrug/plantuml/blob/dev/R/aaa.R <https://github.com/rkrug/plantuml/blob/dev/R/aaa.R> and https://github.com/rkrug/plantuml/blob/dev/R/options.R <https://github.com/rkrug/plantuml/blob/dev/R/options.R> how I implemented it. > On 3 Jul 2020, at 11:09, Paul SAVARY wrote: > > I thank you Rainer. > > Then, I think I will allow users to download the .jar file from an url into > the user data directory. > I get the path to this directory with "rappdirs::user_data_dir()". > > Do you know how to check if java is installed on their machine? > > I thought about using something like that: > > jv <- system2("java", args = c("-version")) > if(jv != 0){ > stop("You have to install java on your machine.") > } > > Cheers > Paul > > De: "Rainer M Krug" > À: "Paul SAVARY" > Cc: "r-package-devel" > Envoyé: Vendredi 3 Juillet 2020 10:33:15 > Objet: Re: [R-pkg-devel] Making possible the use of external java codes by > downloading it > > Please check out the recent thread "Proper CRAN way - How to handle > dependency of java jar file?” About a week ago - I asked essentially the same > questions. > > Cheers, > > Rainer > > > > On 3 Jul 2020, at 10:15, Paul SAVARY <mailto:paul.sav...@univ-fcomte.fr>> wrote: > > Hello everyone, > > I would like to include external java codes (.jar files) to a package in > order to speed up some computations. > However, this would increase the package size above 5 Mb and this code would > not be working for users without java installation. > > Instead, I could include a default parameter in the function calling another > R package making the same computation but more slowly. It would be best for > users without java on their computer. > Besides, I could allow users to download the external java code from a stable > url, and include in the R function all the arguments to launch this java code > (wrapper for the java code). When downloaded, the jar file should be copied > directly into the extdata directory in the user computer if possible. > > Does it seem feasible to you? > > Many thanks > Regards > Paul > > __ > R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing > list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > <https://stat.ethz.ch/mailman/listinfo/r-package-devel> > > -- > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, > UCT), Dipl. Phys. (Germany) > > Orcid ID: -0002-7490-0066 > > Department of Evolutionary Biology and Environmental Studies > University of Zürich > Office Y34-J-74 > Winterthurerstrasse 190 > 8075 Zürich > Switzerland > > Office: +41 (0)44 635 47 64 > Cell: +41 (0)78 630 66 57 > email: rainer.k...@uzh.ch <mailto:rainer.k...@uzh.ch> > rai...@krugs.de <mailto:rai...@krugs.de> > Skype: RMkrug > > PGP: 0x0F52F982 > > > > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?
Thanks Maëlle - that is exactly what I am doing at the moment. Cheers, Rainer > On 13 Jul 2020, at 08:17, Maëlle SALMON wrote: > > Regarding where to save the jar file, you might be interested in "app dirs" > (via tools::R_user_dir() in R from 4.0, the rappdirs package, the hoardr > package) cf > https://blog.r-hub.io/2020/03/12/user-preferences/#not-so-temporary-files3 > > Maëlle. > > Den tisdag 23 juni 2020 14:56:30 CEST, Rainer M Krug skrev: > > > > > > Thanks Duncan. > >> On 23 Jun 2020, at 14:35, Duncan Murdoch wrote: >> >> Your assumption that .jar files are not allowed is wrong: a number of >> packages contain them: rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ... >> There's a specific mention about how to include them in the CRAN policy >> document: > > That’s good to know. > >> >> "For Java .class and .jar files, the sources should be in a top-level java >> directory in the source package (or that directory should explain how they >> can be obtained)." > > So a tet file in the inst/jar directory giving the link to the GitHub repo > would be fine in this case? > >> >> If you still decide not to include your .jar file (maybe it is too big, for >> example), > > > I guess it would be stretching it a bit, as the jar file is 8.2 MB, and > plantuml has regular continuous updates, so I would prefer to keep it dynamic. > > >> then I think your option 1 is unusable for those people who can't write to >> the library location because of permission problems. (Admin privileges are >> often necessary to install packages in the main library.) Generally I think >> everyone can install packages somewhere, but users do really get confused >> when they have multiple library locations, possibly each containing a >> different version of a package. > > So the suggested option would be to have a function, which > 1) ask the user to create a directory in the home folder > 2) download the jar file into that directory or, when no permission is > granted, into the tmpdir() > > Thanks, no major changes necessary for that, > > Rainer > > >> >> Duncan Murdoch >> >> On 23/06/2020 8:18 a.m., Rainer M Krug wrote: >>> Hi >>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) >>> which converts plantuml code to UML graphs. It uses for this the java >>> program https://plantuml.com which is Open Source. >>> As it is not allowed to distribute a binary with an R package, I use the >>> approach of a function which downloads the jar file into the directory >>> `system.file("jar/plantuml.jar", package = "plantuml”)`. >>> This works nicely, and at the moment, the function is called automatically >>> before the plantuml.jar is used. >>> Now I would like to submit the package to CRAN. I can’t find the guidelines >>> anymore, so I am asking here: >>> What is the appropriate way of handling this? >>> I can think of a at least two ways of making it obvious to the user, that a >>> binary is downloaded: >>> 1) if the file plantuml.jar is not present, ask the user to run the >>> function `updatePlantumlJar()` which downloads the jar to the original >>> location in the package directory >>> 2) tell the user to download the file manually and to put it somewhere, >>> where the package will find it >>> I would prefer the first version, as the plantuml.jar would be in the >>> package directory, where usually nobody but the package is doing stuff. >>> Any suggestions on how I could make this “CRAN conform”? >>> Thanks a lot, >>> Rainer >>> -- >>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >>> UCT), Dipl. Phys. (Germany) >>> Orcid ID: -0002-7490-0066 >>> Department of Evolutionary Biology and Environmental Studies >>> University of Zürich >>> Office Y34-J-74 >>> Winterthurerstrasse 190 >>> 8075 Zürich >>> Switzerland >>> Office:+41 (0)44 635 47 64 >>> Cell: +41 (0)78 630 66 57 >>> email: rainer.k...@uzh.ch >>> rai...@krugs.de >>> Skype:RMkrug >>> PGP: 0x0F52F982 >>> -- >>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >>> UCT), Dipl. Phys. (Germany) >>> Orcid ID: -0002-7490-0066 >>> Department of Evolutionary Biology and Environmental Studies >>> University
Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java jar file?
> On 13 Jul 2020, at 11:31, Paul SAVARY wrote: > > Thanks you too. > > That is also what I am doing. Note that I am downloading jar files into a > directory created in rappdirs::user_data_dir() using the command > download.file(url, ...). Jup - exactly. > > If I do not specify 'mode='wb'' in download.file() on a Windows OS, > downloaded jar file is corrupted and cannot be used because a text file is > created in which \n are converted into \r\n, which does not make sens for a > binary file. Yes - the `mode = “wb”` bit me as well - developing on MacOS, testing on travis on GitHub with Linux and Mac,, and what did I get, a corrupt jar on windows. Thanks, Rainer > > I hope it can help > Cheers > > Paul Savary - PhD Student > UMR 6049 ThéMA (Besançon), UMR 6282 Biogéosciences (Dijon), ARP-Astrance > (Paris) > Phone number : +33.6.30.97.34.27 > Research topics: population genetics, landscape ecology, graph theory, > spatial statistics > > - Mail original - > De: "Rainer M Krug" > À: "Maëlle SALMON" > Cc: "r-package-devel" > Envoyé: Lundi 13 Juillet 2020 11:15:10 > Objet: Re: [R-pkg-devel] Proper CRAN way - How to handle dependency of java > jar file? > > Thanks Maëlle - that is exactly what I am doing at the moment. > > Cheers, > > Rainer > > >> On 13 Jul 2020, at 08:17, Maëlle SALMON wrote: >> >> Regarding where to save the jar file, you might be interested in "app dirs" >> (via tools::R_user_dir() in R from 4.0, the rappdirs package, the hoardr >> package) cf >> https://blog.r-hub.io/2020/03/12/user-preferences/#not-so-temporary-files3 >> >> Maëlle. >> >> Den tisdag 23 juni 2020 14:56:30 CEST, Rainer M Krug >> skrev: >> >> >> >> >> >> Thanks Duncan. >> >>> On 23 Jun 2020, at 14:35, Duncan Murdoch wrote: >>> >>> Your assumption that .jar files are not allowed is wrong: a number of >>> packages contain them: rscala, J4R, Rbgs, bartMachine, OpenStreetMap, ... >>> There's a specific mention about how to include them in the CRAN policy >>> document: >> >> That’s good to know. >> >>> >>> "For Java .class and .jar files, the sources should be in a top-level java >>> directory in the source package (or that directory should explain how they >>> can be obtained)." >> >> So a tet file in the inst/jar directory giving the link to the GitHub repo >> would be fine in this case? >> >>> >>> If you still decide not to include your .jar file (maybe it is too big, for >>> example), >> >> >> I guess it would be stretching it a bit, as the jar file is 8.2 MB, and >> plantuml has regular continuous updates, so I would prefer to keep it >> dynamic. >> >> >>> then I think your option 1 is unusable for those people who can't write to >>> the library location because of permission problems. (Admin privileges are >>> often necessary to install packages in the main library.) Generally I >>> think everyone can install packages somewhere, but users do really get >>> confused when they have multiple library locations, possibly each >>> containing a different version of a package. >> >> So the suggested option would be to have a function, which >> 1) ask the user to create a directory in the home folder >> 2) download the jar file into that directory or, when no permission is >> granted, into the tmpdir() >> >> Thanks, no major changes necessary for that, >> >> Rainer >> >> >>> >>> Duncan Murdoch >>> >>> On 23/06/2020 8:18 a.m., Rainer M Krug wrote: >>>> Hi >>>> I have a package called `plantuml` (https://github.com/rkrug/plantuml) >>>> which converts plantuml code to UML graphs. It uses for this the java >>>> program https://plantuml.com which is Open Source. >>>> As it is not allowed to distribute a binary with an R package, I use the >>>> approach of a function which downloads the jar file into the directory >>>> `system.file("jar/plantuml.jar", package = "plantuml”)`. >>>> This works nicely, and at the moment, the function is called automatically >>>> before the plantuml.jar is used. >>>> Now I would like to submit the package to CRAN. I can’t find the >>>> guidelines anymore, so I am asking here: >>>> What is the appropriate
[R-pkg-devel] CRAN, API packages, Keys and tests
I know this has been asked a few times - but I can’t find anything which might help me. I have a package (https://github.com/rkrug/ROriginStamp) which wraps around API calls to OriginStamp (https://originstamp.com) to obtain trusted time stamps. The package works, but the tests are the problem on remote machines. My question is: 1) I have disabled all tests and all examples if there is no environmental variable set with the API Key - is this OK for CRAN? 2) If not, how can I make this CRAN compliant? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] CRAN, API packages, Keys and tests
Hi Josh, Thanks for the thumbs-up for CRAN. With the secure variable on Travis - that is exactly what I am doing. Thanks a lot, Rainer > On 4 Sep 2020, at 16:22, Joshua Ulrich wrote: > > On Fri, Sep 4, 2020 at 9:20 AM Joshua Ulrich <mailto:josh.m.ulr...@gmail.com>> wrote: >> >> Hi Rainer, >> >> You could set an environment variable with the API key, and only run >> the tests if the variable is set. >> > Sorry, I missed that you're already doing this. I confirm that it > works for CRAN. I also set my API key as a private/secure variable on > TravisCI, so the tests will run there. > > IIRC, testthat does something similar. You could look at that pattern, > since it works on CRAN for many packages. > >> Here's an example that I use: >> https://github.com/joshuaulrich/quantmod/blob/master/tests/test_getSymbols.R#L4 >> >> Best, >> Josh >> >> On Fri, Sep 4, 2020 at 3:25 AM Rainer M Krug wrote: >>> >>> I know this has been asked a few times - but I can’t find anything which >>> might help me. >>> >>> I have a package (https://github.com/rkrug/ROriginStamp) which wraps around >>> API calls to OriginStamp (https://originstamp.com) to obtain trusted time >>> stamps. >>> >>> The package works, but the tests are the problem on remote machines. >>> >>> My question is: >>> >>> 1) I have disabled all tests and all examples if there is no environmental >>> variable set with the API Key - is this OK for CRAN? >>> 2) If not, how can I make this CRAN compliant? >>> >>> Thanks, >>> >>> Rainer >>> >>> >>> -- >>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >>> UCT), Dipl. Phys. (Germany) >>> >>> Orcid ID: -0002-7490-0066 >>> >>> Department of Evolutionary Biology and Environmental Studies >>> University of Zürich >>> Office Y34-J-74 >>> Winterthurerstrasse 190 >>> 8075 Zürich >>> Switzerland >>> >>> Office: +41 (0)44 635 47 64 >>> Cell: +41 (0)78 630 66 57 >>> email: rainer.k...@uzh.ch >>>rai...@krugs.de >>> Skype: RMkrug >>> >>> PGP: 0x0F52F982 >>> >>> >>> >>> >>> >>> -- >>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, >>> UCT), Dipl. Phys. (Germany) >>> >>> Orcid ID: -0002-7490-0066 >>> >>> Department of Evolutionary Biology and Environmental Studies >>> University of Zürich >>> Office Y34-J-74 >>> Winterthurerstrasse 190 >>> 8075 Zürich >>> Switzerland >>> >>> Office: +41 (0)44 635 47 64 >>> Cell: +41 (0)78 630 66 57 >>> email: rainer.k...@uzh.ch >>>rai...@krugs.de >>> Skype: RMkrug >>> >>> PGP: 0x0F52F982 >>> >>> __ >>> R-package-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> >> >> >> -- >> Joshua Ulrich | about.me/joshuaulrich >> FOSS Trading | www.fosstrading.com > > > > -- > Joshua Ulrich | about.me/joshuaulrich <http://about.me/joshuaulrich> > FOSS Trading | www.fosstrading.com <http://www.fosstrading.com/> -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: -0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Zürich Office Y34-J-74 Winterthurerstrasse 190 8075 Zürich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: rainer.k...@uzh.ch rai...@krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel