Re: [R-pkg-devel] visible binding for '<<-' assignment

2020-09-03 Thread William Dunlap
> Is there a reason that this slightly more explicit > version [assign(envir=.GlobalEnv)] wouldn't work? https://cran.r-project.org/web/packages/policies.html - Packages should not modify the global environment (user’s workspace). Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Sep 3, 2020

Re: [R-pkg-devel] Formatting .Rbuildignore

2020-08-17 Thread William Dunlap
I just tried this out with R-4.0.2 on Linux and it looks like .Rbuildignore does not treat lines with '#'s as comments. E.g., % mkdir test test/inst % touch 'test/inst/#octothorp.txt' 'test/inst/normal.txt' % echo > test/DESCRIPTION 'Package: test\nVersion: 0.1\nTitle: test\nDescription: A test o

Re: [R-pkg-devel] Package can't be imported with Suggests

2020-08-05 Thread William Dunlap
You might make a second package that depends only on nimble and your main package can then suggest that second package and JAGS. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Aug 5, 2020 at 3:36 PM Simon Bonner wrote: > > Hi all, > > I’m wondering if someone an offer advice on a problem I

Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread William Dunlap
R-4.0 introduced a new function, tools::R_user_dir(package, which), where which is one of "data", "config", and "cache". It gives standard directory names in which to place package-and-user-specific files which you want to last longer than one R session. I suppose you will still have to ask the u

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread William Dunlap
'\0'; > > F77_CALL(zhpevx)(cjobz, crange, cuplo, &n[0], ap, &vl[0], &vu[0], &il[0], > &iu[0], &abstol[0], &m[0], > w, z, &ldz[0], work, rwork, iwork, ifail, &info[0], strlen(cjobz), > strlen(crange), strlen(cuplo)); > > > D

Re: [R-pkg-devel] warning: type of ‘zhpevx_’ does not match original declaration [-Wlto-type-mismatch]

2020-07-06 Thread William Dunlap
Have you tried what is recommended in https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html ? For arguments of CHARACTER type, the character length is passed as a hidden argument at the end of the argument list. For deferred-length strings, the value is passed by reference, ot

Re: [R-pkg-devel] check cross-references error: Non-file package-anchored link(s)

2020-07-02 Thread William Dunlap
On Linux you can use 'ltrace' to get a list of all the environment variables that R looks up. E.g., do the following in 'script' so all the output is stored in a file ('typescript') and later look around in it for the getenv calls. $ R-devel --debugger=ltrace --debugger-args="-f -e getenv" ... [p

Re: [R-pkg-devel] Uncaught use of internal functions from other packages in R CMD check

2020-06-16 Thread William Dunlap
And at least one widely used CRAN package defines `%:::%`, to mimic `:::`, and uses it to use unexported functions from the tools package. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jun 15, 2020 at 3:03 PM Balasubramanian Narasimhan < na...@stanford.edu> wrote: > At least one package

Re: [R-pkg-devel] Forward function call

2020-06-08 Thread William Dunlap
Use Call[[1]] <- quote(survival::coxph) Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jun 8, 2020 at 12:12 PM Göran Broström wrote: > Hello, > > the function 'coxreg' in my package 'eha' is often just a wrapper for > 'coxph' in survival, so I have code like > > if (cox.ph){ >

Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-04-08 Thread William Dunlap
% R-devel --vanilla --quiet > library(Matrix) > setClassUnion("mMatrix", c("Matrix", "matrix")) Error in get(cname, envir = cwhere, inherits = FALSE) : object '.__C__compMatrix' not found Error in setClassUnion("mMatrix", c("Matrix", "matrix")) : unable to create union class: could not set mem

Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-04-08 Thread William Dunlap
openv="", inherits=TRUE Tracing get(".SigLength", envir = env) on entry x=".SigLength", envir="", topenv="", inherits=TRUE Tracing get(".SigLength", envir = env) on entry x=".SigLength", envir="", topenv="&q

Re: [R-pkg-devel] Question regarding R package development, how to resolve "Warning: no source files found"

2020-02-11 Thread William Dunlap
INSTALL will give that warning if you have a pkg/src directory that contains no files that look like C, C++, or Fortran files. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Feb 11, 2020 at 11:58 AM Mohsen Nabian wrote: > Greetings! > > How to resolve the following warning for my R packa

Re: [R-pkg-devel] r-hub status

2020-02-04 Thread William Dunlap
CRAN's check gives a warning checking Rd \usage sections ... WARNING Documented arguments not in \usage in documentation object 'Process chromR objects': ‘...’ and man/proc_chromR.Rd on github does list '...' in the \arguments section but no function listed in the \usage section uses '...'. T

Re: [R-pkg-devel] error in sample(), invalid 'size' argument

2020-01-15 Thread William Dunlap
If mss$member is not a matrix you will get that error because setsiz will be NULL. > setsiz <- ncol( 33 ) > sample(1:3, setsiz) Error in sample.int(length(x), size, replace, prob) : invalid 'size' argument Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Jan 15, 2020 at 4:58 AM R

Re: [R-pkg-devel] Bug in checks in R-devel (was: Data docs)

2019-10-28 Thread William Dunlap
The Matrix package explicitly sets LazyData to "no" with a note saying that it is necessary. LazyData: no LazyDataNote: not possible, since we use data/*.R *and* our classes My notes on implementing install.packages() in TERR include When R's install.packages() processes *.R files in the packag

Re: [R-pkg-devel] Building fails with 'mypackage/DESCRIPTION' does not exist

2019-09-30 Thread William Dunlap
Will the package build if you back out the "minor changes"? If so, what were the minor changes (show diff output)? Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Sep 30, 2019 at 12:24 PM Steve Gutreuter wrote: > I have a package which will no longer build after minor changes. The > pro

Re: [R-pkg-devel] Problems installing dependences of my package

2019-09-09 Thread William Dunlap
> And now, I have another problem because the versions are usually indicated using “>=”, for example: > forecast (>=8.7) but I need to use exactly the versión 8.7 because sometimes when packages are updated, > they lost some functions. But if I use <= or == and the package is update to versión 8.8,

Re: [R-pkg-devel] R CMD build: "Error in if (any(update))"

2019-06-10 Thread William Dunlap
You might be able to find where the error occurred by putting the following lines in ~/.Rprofile cat("~/.Rprofile: setting alternate error handler\n") options( error=quote({ dump.frames() writeLines(c("Stack trace", paste0(" ",names(last.dump})) Bill Dunlap TIBCO Software

Re: [R-pkg-devel] try() in R CMD check --as-cran

2019-06-07 Thread William Dunlap
ppp has this body. --- END OF FAILURE REPORT -- Fatal error: the condition has length > 1 * checking PDF version of manual ... OK * DONE Status: 1 ERROR, 1 NOTE See ‘/tmp/bill/ppp.Rcheck/00check.log’ for details. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Jun 7, 201

Re: [R-pkg-devel] try() in R CMD check --as-cran

2019-06-07 Thread William Dunlap
The length-condition-not-equal-to-one checks will cause R to shutdown even if the code in a tryCatch(). Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Jun 7, 2019 at 7:47 AM Duncan Murdoch wrote: > On 07/06/2019 9:46 a.m., J C Nash wrote: > > Should try() not stop those checks from forci

Re: [R-pkg-devel] CRAN review

2019-03-29 Thread William Dunlap
2/lib64/R/site-library/RcppEigen/include/Eigen/src/Core/MathFunctions.h" -- # 295 "/home/R/R-3.5.2/lib64/R/site-library/RcppEigen/include/Eigen/src/Core/arch/CUDA/Half.h" return x + (y-x) * half(float(std::rand()) / float(2147483647)); # 412 "/home/R/R-3.5.2/lib64/R/site-library/Rc

Re: [R-pkg-devel] CRAN review

2019-03-29 Thread William Dunlap
.org/web/checks/check_results_BH.html > > Max > ---------- > *From:* R-package-devel on behalf > of William Dunlap > *Sent:* March 29, 2019 12:05 PM > *To:* Vissarion Fisikopoulos > *Cc:* R Package Development > *Subject:* Re: [R-pkg-devel] CRAN review > > It looks like it

Re: [R-pkg-devel] CRAN review

2019-03-29 Thread William Dunlap
Oops, RcppEigen does contain compiled code, but its header files include much more code that doesn't get checked because it is not used in RcppEigen.so. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Mar 29, 2019 at 9:35 AM William Dunlap wrote: > The check only looks at compi

Re: [R-pkg-devel] CRAN review

2019-03-29 Thread William Dunlap
RAND_MAX); } Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Mar 29, 2019 at 8:43 AM William Dunlap wrote: > > Library lpSolveAPI uses rand() and srand() in lp_utils.c. We replace > > both functions with GetRNGstate(); PutRNGstate(); unif_rand(); from > > R’s interna

Re: [R-pkg-devel] CRAN review

2019-03-29 Thread William Dunlap
> Library lpSolveAPI uses rand() and srand() in lp_utils.c. We replace > both functions with GetRNGstate(); PutRNGstate(); unif_rand(); from > R’s internal random number generation routines as it is proposed in > `Writing R Extensions`. Moreover if you run in folder `/src`: > $ grep -r 'rand()' > Y

Re: [R-pkg-devel] How to debug CRAN errors?

2019-03-13 Thread William Dunlap
hough, is there any way to debug the > problem? I’ll assume that making repeated uploads to CRAN is not a viable > approach it would be great if there were a Docker image of their setup > available, for example. > > On Wed, 13 Mar 2019 at 17:00, William Dunlap wrote: > >>

Re: [R-pkg-devel] How to debug CRAN errors?

2019-03-13 Thread William Dunlap
The complaint > test_check("huxtable") -- 1. Failure: Data written in appropriate format (@test-openxlsx.R#101) -- `openxlsx::saveWorkbook(wb, file = "test-xlsx.xlsx", overwrite = TRUE)` produced messages. comes from your call to testthat::expect_silent() test_that("Data written in

[R-pkg-devel] COMPILED_BY vs. R_COMPILED_BY

2019-02-07 Thread William Dunlap
Is there rational for COMPILED_BY (a make variable on Windows) and R_COMPILED_BY (an environment variable on Windows) differing? > system(intern=TRUE, paste(file.path(R.home("bin"), "R"), "CMD config COMPILED_BY")) [1] "gcc-4.9.3" > Sys.getenv("R_COMPILED_BY") [1] "gcc 4.9.3" The NEWS file for R-

Re: [R-pkg-devel] devtools::check() gives error on missing License field, but License field is not missing

2018-11-08 Thread William Dunlap
The output of sessionInfo(), at the time of the error, would also be useful - it will give the versions of devtools, pkgload, and all the other packages that devtools requires. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Nov 8, 2018 at 8:32 AM, Kevin Ushey wrote: > It would be easiest

Re: [R-pkg-devel] nativeRoutines error when using roxygen2 in RStudio

2018-11-07 Thread William Dunlap
After installing a new version of R the OP may have to rebuild (and retest) packages like pkgload that define functions by grabbing functions from the base package and modifying them, as in pkgload/R/namespace-env.r: onload_assign("makeNamespace", eval( modify_lang( extract_lang(body(l

Re: [R-pkg-devel] dependency on a bioconductor package

2018-10-05 Thread William Dunlap
It looks like affy is the culprit. > requiredByCAMERA <- tools::package_dependencies("CAMERA", recursive=TRUE)$CAMERA > directlyRequired <- tools::package_dependencies(requiredByCAMERA) > names(directlyRequired)[ vapply(directlyRequired, function(x)"BiocInstaller"%in%x, FUN.VALUE=NA) ] [1] "affy"

Re: [R-pkg-devel] Determine subset from glm object

2018-07-08 Thread William Dunlap
If there might be NA's in the response or predictors so na.exclude or na.omit would remove some rows as well, then using the row.names might be an easier way to match up rows in the original data with rows in gout$x. Bill Dunlap TIBCO Software wdunlap tibco.com On Sun, Jul 8, 2018 at 11:04 AM, Ch

Re: [R-pkg-devel] mvrnorm, eigen, tests, and R CMD check

2018-05-17 Thread William Dunlap
ity > > across architectures. The choice of basis appears to use different > > heuristics on 32-bit windows than on 64-bit Windows or Linux machines. > As a > > result, I can't include the tests I'd like as part of a CRAN submission. > > > > On Thu, May 17, 2018

Re: [R-pkg-devel] mvrnorm, eigen, tests, and R CMD check

2018-05-17 Thread William Dunlap
Your explanation needs to be a bit more general in the case of identical eigenvalues - each distinct eigenvalue has an associated subspace, whose dimension is the number repeats of that eigenvalue and the eigenvectors for that eigenvalue are an orthonormal basis for that subspace. (With no repeate

Re: [R-pkg-devel] How to write example results to a tempdir()?

2018-04-26 Thread William Dunlap
The withr package has a bunch of simple functions executing code in various contexts, e.g., in a given directory or with given options() settings: > withr::with_dir function (new, code) { old <- setwd(dir = new) on.exit(setwd(old)) force(code) } > withr::with_dir(tempdir(), getwd()) [

[R-pkg-devel] reg.finalizer and .onUnload

2018-03-21 Thread William Dunlap
I have a package that lets a user log into another system and I want it to be sure to log the user out, at least by the time the R session is over. My Login(username,password) function stashes a token (the username in my simplfied code) in an environment and my Logout() function needs to use that

Re: [R-pkg-devel] Depreciate Function

2018-02-07 Thread William Dunlap
Instead of help(oldFunction) giving the example oldFunction(x = something, option = "XYZ") show the user, via comments in the example, how to convert the old usage to the new # replace oldFunction(x = something, option = "XYZ") by newFunction(object = log(something), method = "XYZ-log")

Re: [R-pkg-devel] Working with R-devel

2018-01-24 Thread William Dunlap
On Linux you can trace all the getenv calls with ltrace. It only works on ELF files, not sh scripts: % R CMD ltrace -e getenv `R RHOME`/bin/*/R libR.so->getenv("R_HOME") = "/home/R/R-3.4.3/lib64/R" libR.so->getenv("R_TRANSLATIONS") = nil libR.so->getenv("R_PLATFORM")

Re: [R-pkg-devel] Assignments to the Global environment

2018-01-07 Thread William Dunlap
I think that assigning something to parent.frame() is bad practice, for the same reasons that assigning to .GlobalEnv is bad. You could instead make an environment in your package called, say, "TSEtools.env", with TSETools.env <- new.env() in some *.R file in the package's R directory. Export

Re: [R-pkg-devel] Exited with status -1073741819.

2017-11-29 Thread William Dunlap
You wrote Exited with status -1073741819. The low byte of that status code is 5, which I think means a segmentation fault - reading or writing an address that you do not have permission of use. > as.hexmode(-1073741819) [1] "c005" If your code uses memory that it has not allocated it i

Re: [R-pkg-devel] Summary: tibbles are not data frames

2017-10-04 Thread William Dunlap
> However, I learned that I should change things like > 'dat[5:8, 1]' to 'dat[[1]][5:8]', respecting the fact that a data frame is a list In the old days we encouraged the dat[i,j] usage because it worked on both matrices and data.frames. Even now, the transformation to dat[[j]][i] only works whe

Re: [R-pkg-devel] Solaris SPARC, Fortran, and logical errors?

2017-03-15 Thread William Dunlap
I don't know about the current Sparc Fortran compilers, but over the years have learned not to try to pass logicals and character strings between C and Fortran. I have seen Fortran compilers that treated integer -1 (all bits 1) as .true. and anything else as .false. and I have see ones that looked

Re: [R-pkg-devel] TryCatch messages

2017-02-03 Thread William Dunlap
Use conditonMessage() to extract the message from an error, warning, message, or other 'condition' For more, see Hadley Wickham's book, "Advanced R": http://adv-r.had.co.nz/Exceptions-Debugging.html http://adv-r.had.co.nz/beyond-exception-handling.html Bill Dunlap TIBCO Software wdunlap tibc

Re: [R-pkg-devel] Weird MAKEFLAGS bug

2017-01-10 Thread William Dunlap
MAKEFLAGS='CXXFLAGS=-std=c++0x -O2' R CMD SHLIB passes two items, 'CXXFLAGS=-std=c++0x' and '-O2', not the single item 'CXXFLAG=-std=c++0x -O2', to make. Suitably recent versions of GNU make take the make argument -O2 to control the 'output-sync'. Bill Dunlap TIBCO Software wdunlap tibco.com

Re: [R-pkg-devel] accessing data by packagename::dataname from within package code fails.

2016-12-12 Thread William Dunlap
You can define the data in the R directory. You can keep it all in a *.R file by wrapping the text of the *.csv file in quotes and using read.table(text="quoted stuff"), as in: theData <- read.csv(header=TRUE, text=" English,Digit One,1 Two,2 Three,3") N <- nrow(theData) You need to make sure 't

Re: [R-pkg-devel] Using BLAS on Windows

2016-11-10 Thread William Dunlap
The MGGM package has the following in src/Makevars.win to tell the linker to link with the Lapack, BLAS, and Fortran libraries. PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) Its Makevars file is identical - is that Makevars.win really needed? I don't see Makevars or Makevars.win in your github

Re: [R-pkg-devel] environment scoping

2016-10-27 Thread William Dunlap
If I were writing a package for factoring integers I might store a vector of known primes in an environment in my package and have my factoring functions append to the list when they find some more primes. This works because there is only one set of of primes (given we stick with ordinary integers

Re: [R-pkg-devel] Only printing a message once per top-level call.

2016-10-24 Thread William Dunlap
This is not a complete answer to your problem, but here is an example of how to make and store messages of a certain class, "lowMessage", and later print a table of the messages and their counts. > lowMessage <- function(text, call = sys.call(-1)) { # make a message of class "lowMessage"

Re: [R-pkg-devel] win-builder, compiling C code, make[1]: ar: Command not found

2016-10-07 Thread William Dunlap
solved! Changing ‘ar’ to ‘$(AR)’ in the Makefile along with adding > AR="$(AR)" to @(cd libmseed && $(MAKE) static CC="$(CC)" > CFLAGS="$(CFLAGS)") in the Makevars.win fixed the problem. > > Thank you! > Gillian Sharer > > > On Oc

Re: [R-pkg-devel] win-builder, compiling C code, make[1]: ar: Command not found

2016-10-07 Thread William Dunlap
Do you have a Makefile in the directory yourPackage/src/libmseed? If so, how does it call 'ar' or '$(AR)'? Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Oct 7, 2016 at 3:44 PM, Gillian Sharer wrote: > Thank you for your response. I apologize for asking basic questions, but > I’m new to t

Re: [R-pkg-devel] Absent variables and tibble

2016-06-28 Thread William Dunlap
Currently exists("someName", where=someDataFrame) reports if "someName" is an column of the data.frame 'someDataFrame' and the 'where=' may be omitted. If we have an environment we use exsts("someName", envir=someEnvironment). It might be nice to continue using exists() instead of introducing a n

Re: [R-pkg-devel] --as-cran URL check

2015-12-14 Thread William Dunlap
t;percent signs escaped". It just gets me back to > the status 500 error. I think Dirk may be correct that it is a bug in the > --as-can URL check. > > Paul > > > On 12/14/2015 09:10 PM, William Dunlap wrote: >> >> Put backslashes in front of the percent signs

Re: [R-pkg-devel] --as-cran URL check

2015-12-14 Thread William Dunlap
Put backslashes in front of the percent signs in the Rd file's URL: \url{http://www.rug.nl/research/portal/publications/pub\%28d7d4ea3d-af1d-487a-b9b6-c0816994ef5a\%29.html} Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Dec 14, 2015 at 4:46 PM, Paul Gilbert wrote: > > I am having some

Re: [R-pkg-devel] coercion in R CMD check

2015-12-02 Thread William Dunlap
It may depend on your locale setting (see Sys.getlocale() and Sys.setlocale()). In what locale is "/A/string" > "0"? Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Dec 2, 2015 at 3:24 PM, Facundo Muñoz wrote: > I have been struggling all day with this issue, which was terribly > difficult

Re: [R-pkg-devel] Redefinition of generic for plot function breaks plot.formula

2015-09-01 Thread William Dunlap
Try giving y a default value, NULL, in your plot.default: plot.default <- function(x, y=NULL, ...) graphics::plot(x, y, ...) Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Aug 31, 2015 at 7:37 PM, Gavin Simpson wrote: > Why do you even need to take over `plot`, `plot.default`?

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread William Dunlap
] "cdef" "Config" #[7] "def" Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Aug 11, 2015 at 8:47 AM, William Dunlap wrote: > This is a problem in the compiler package. Here is a way to reproduce it: > > def <- quote(Config &

Re: [R-pkg-devel] Visible bindings and reference classes

2015-08-11 Thread William Dunlap
This is a problem in the compiler package. Here is a way to reproduce it: def <- quote(Config <- setRefClass("Config", fields = list( ConfigString = "character"), methods = list( # Constructor initialize = function() { ConfigString <<- "Hello, World!"