Re: [Rd] [External] Re: capture "->"

2024-03-04 Thread Bill Dunlap
ame("<<-") > leftArrow <- as.name("<-") > ast1 <- parse(text=encode("x1 + x2 -> a3"))[[1]] > ast2 <- parse(text=encode("y4 <- b5 + (b6 / b7)"))[[1]] > identical(ast1[[1]], rightArrow) [1] TRUE > identical(ast2[[1]], leftA

Re: [Rd] Difficult debug

2024-02-07 Thread Bill Dunlap
emory misuse and | >>> you can inspect variables, etc., where an error occurs. | >>> You can check for memory leaks from gdb with | >>>(gdb) monitor leak_check full | >>> | >>> -Bill You can use ^C to get the gdb prompt, to, say, set a breakpoi

Re: [Rd] Difficult debug

2024-02-07 Thread Bill Dunlap
track down memory problems. -Bill On Wed, Feb 7, 2024 at 12:03 PM Therneau, Terry M., Ph.D. via R-devel < r-devel@r-project.org> wrote: > I've hit a roadblock debugging a new update to the survival package. I > do debugging in > a developement envinment, i.e. I don't create and

Re: [Rd] capture error messages from loading shared objects

2023-11-28 Thread Bill Dunlap
If you would like to save the error message instead of suppressing it, you can use tryCatch(message=function(e)e, ...). -BIll On Tue, Nov 28, 2023 at 3:55 AM Adrian Dusa wrote: > Once again, Ivan, many thanks. > Yes, that does solve it. > Best wishes, > Adrian > > On Tue, Nov

Re: [Rd] Concerns with SVD -- and the Matrix Exponential

2023-08-16 Thread Bill Dunlap
. Can you state your definition of the SVD and prove (or outline a proof of) that last statement? -Bill On Wed, Aug 16, 2023 at 3:47 AM Durga Prasad G me14d059 < me14d...@smail.iitm.ac.in> wrote: > Dear Martin, I am getting different responses from different officials of > R-Softwar

[R-pkg-devel] Possible bug in Codoc checking with R CMD Check

2023-08-05 Thread bill
are: https://github.com/billdenney/TopicLongTableR/blob/main/R/topic_long_table_h eader_footer.R https://github.com/billdenney/TopicLongTableR/blob/main/man/topic_long_table _header.Rd https://github.com/billdenney/TopicLongTableR/actions/runs/5771551599/job/15 645624146#step:6:99 Thanks,

Re: [Rd] New behavior when running script in package directory?

2023-06-21 Thread Bill Dunlap
If ./Rprofile is not present and ~/.Rprofile is present then R will run the latter at startup. Do you have a ~/.Rprofile that defines a ss() function? -Bill On Wed, Jun 21, 2023 at 8:50 AM Dominick Samperi wrote: > Thanks, I checked for .Rprofile and .RData files. They are not present.

Re: [R-pkg-devel] Inconsistent functionality of c++ code in MatchIt

2023-05-11 Thread Bill Dunlap
I see the problem when I compile the C++ code on Ubuntu 20.04 and the latest R-devel with C++ compiler: ‘g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 If I change all the unadorned 'abs' calls in src/nn_matchC_vec.cpp with the prefix 'std::' the problem goes away. -Bill On Thu, May 11, 2023 at 11

Re: [Rd] range() for Date and POSIXct could respect `finite = TRUE`

2023-05-11 Thread Bill Dunlap
n and max for the class instead of one that just said they were -Inf and Inf or not. -Bill On Thu, May 11, 2023 at 1:49 AM Martin Maechler wrote: > >>>>> Davis Vaughan > >>>>> on Tue, 9 May 2023 09:49:41 -0400 writes: > > > It seems like the

Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Bill Dunlap
3) > str(xyTable(x,y)) List of 3 $ x : num [1:5] 1 2 2 5 6 $ y : num [1:5] 2 2 4 NA 3 $ number: int [1:5] 2 1 1 1 1 table() does not use this logic, as one NA in a vector would make all the counts NA. Should xyTable have a way to handle NAs the way table() does? -Bill On Tue,

Re: [Rd] WISH: Optional mechanism preventing var <<- value from assigning non-existing variable

2023-03-19 Thread Bill Dunlap
Why should it make an exception for cases where the about-to-be-assigned-to name is present in the global environment? I think it should warn or give an error if the altered variable is in any environment on the search list. -Bill On Sun, Mar 19, 2023 at 10:54 AM Duncan Murdoch wrote: >

Re: [Rd] tab-complete for non-syntactic names could attempt backtick-wrapping

2023-03-02 Thread Bill Dunlap
of, "") [1] "symbol""symbol""character" > vapply(as.list(quote(list$'component')), typeof, "") [1] "symbol""symbol""character" Single and double quoted character sequences do parse to the same thing

Re: [R-pkg-devel] Sanitize Input Code for a Shiny App

2023-02-28 Thread Bill Denney
some minimal sanitization of the input, but then we will also ensure that we do anything in a container with limits applied from the outside, too. Thanks, Bill On Sun, Feb 26, 2023, 4:57 PM Simon Urbanek wrote: > Bill, > > the short answer is you can't limit anything at R level. Any

[R-pkg-devel] Sanitize Input Code for a Shiny App

2023-02-26 Thread bill
? Thanks, Bill [[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] reproducing cran warnings

2023-02-03 Thread Bill Dunlap
rintf(string, length, "format ..."); -Bill On Fri, Feb 3, 2023 at 8:28 AM Brad Eck wrote: > Dear List - > > What’s the latest best practice on trying to reproduce warnings raised > on CRAN checks? > > I updated my epanet2toolkit package earlier this week. > R CMD che

Re: [Rd] Potential bug in fitted.nls

2023-01-26 Thread Bill Dunlap
Doesn't nls() expect that the lengths of vectors on both sides of the formula match (if both are supplied)? Perhaps it should check for that. -Bill On Thu, Jan 26, 2023 at 12:17 AM Dave Armstrong wrote: > Dear Colleagues, > > I recently answered [this question]() on Stac

Re: [R-pkg-devel] replacements of sprintf in compiled code

2023-01-21 Thread Bill Dunlap
Even Microsoft added snprintf to Visual C++ in 2015 (not that that matters for R). -Bill On Sat, Jan 21, 2023 at 2:47 AM Duncan Murdoch wrote: > On 21/01/2023 5:33 a.m., Holger Hoefling wrote: > > Hi, > > > > thanks for the tip! Is that available everywhere or do I nee

Re: [R-pkg-devel] corrupted NAMESPACE file

2023-01-20 Thread Bill Dunlap
locale(locale="C") [1] "C" > tools::showNonASCIIfile(' https://raw.githubusercontent.com/JamesRamsay5/fda/master/NAMESPACE') 1: export(AmpPhasDecomp, > rawToChar(readBin(' https://raw.githubusercontent.com/JamesRamsay5/fda/master/NAMESPACE', what="raw", n=20)) [1]

Re: [R-pkg-devel] NOTE about use of `:::`

2022-12-14 Thread Bill Dunlap
all) [That code is completely untested.] -Bill On Wed, Dec 14, 2022 at 3:19 PM David Kepplinger wrote: > Dear List, > > I am working on updating the pense package and refactored some of the > methods. I have several functions which take the same arguments, hence I'm > sending all

Re: [Rd] Lazy-evaluate elements wrapped with invisible

2022-10-29 Thread Bill Dunlap
ist should be considered garbage if not 'immediately' extracted from a list? Could you show a few usage cases? -Bill On Fri, Oct 28, 2022 at 7:41 PM Dipterix Wang wrote: > > This is not quite true. The value, even when invisible, is captured by > .Last.value, and > > > f <

Re: [Rd] Lazy-evaluate elements wrapped with invisible

2022-10-28 Thread Bill Dunlap
sum(x)}) +environment() + } > fx <- f(1:10) > date() [1] "Fri Oct 28 14:22:12 2022" > Sys.sleep(2) > fx$eval_date Evaluating 'date' [1] "Fri Oct 28 14:22:24 2022" > Sys.sleep(2) > fx$eval_date [1] "Fri Oct 28 14:22:24 2022" > fx$sum_x Evalu

Re: [Rd] Parser bug? A comma too much.

2022-09-16 Thread Bill Dunlap
> By putting in the comma, unless I am mistaken, you are effectively > saying the second element is NULL, which is how it's naturally > defined. No, in f(x,) the second argument is missing, not NULL. -Bill On Fri, Sep 16, 2022 at 7:43 AM Avraham Adler wrote: > That may actually

Re: [R-pkg-devel] Save and restoring random number seed in a package function

2022-09-14 Thread Bill Dunlap
ame of the argument. The format of the seed depends on the generator used - I think it used the nature of the proffered seed to get the likely generator, but there may have also been arguments to specify the generator explicitly. I think this would be a nice thing to add to R's set.seed. -Bill On Wed,

Re: [R-pkg-devel] Warning... unable to translate 'Ekstrm' to a wide string; Error... input string 1 is invalid

2022-07-19 Thread Bill Dunlap
ing(qu) [1] "UTF-8" "UTF-8" "UTF-8" "UTF-8" > qx == qu [1] TRUE TRUE TRUE TRUE (charToRaw shows that qu and qx are not byte-for-byte identical: '==' coerces the latin1 strings to utf-8.) -Bill On Tue, Jul 19, 2022 at 9:38 AM Spencer Graves < spencer

Re: [Rd] New R version - Issue with as.vector coercion on data.frame

2022-05-02 Thread Bill Dunlap
R-4.1.2's as.vector(aDataFrame) did. I think that as.vector() is a function that few people should use. It has almost nothing to do with with the notion of a vector in math or physics. -Bill On Mon, May 2, 2022 at 2:19 AM Marc Weibel wrote: > Hi > > I recently upgraded to the

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Bill Dunlap
>I think a lot of these things ultimately mean that if there were to be a string >concatenation operator, it probably shouldn't have behavior identical to >paste0. Was that what you were getting at as well, Bill? Yes. On Mon, Dec 6, 2021 at 4:21 PM Gabriel Becker wrote: >

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Bill Dunlap
Should paste0(character(0), c("a","b")) give character(0)? There is a fair bit of code that assumes that paste("X",NULL) gives "X" but c(1,2)+NULL gives numeric(0). -Bill On Mon, Dec 6, 2021 at 1:32 PM Duncan Murdoch wrote: > On 06/12/2021 4:21 p

Re: [Rd] How is the environment variable "R_USER" defined?

2021-11-22 Thread Bill Dunlap
Is your C:\Users\yourname\Documents linked to OneDrive (either by your choice or by some administrator setting a group policy)? If so, ou could unlink it using OneDrive's settings dialog. Or you could set R_USER to avoid using ...\Documents. -Bill On Mon, Nov 22, 2021 at 8:47 AM Jiefei Wang

Re: [Rd] Inconsistent is.list results on 'by' objects

2021-11-16 Thread Bill Dunlap
Try adding simplify=FALSE to the call to by(). -Bill On Tue, Nov 16, 2021 at 4:04 AM Ofek Shilon wrote: > Take this toy code: > df <- data.frame(a=seq(10), b=rep(1:2, 5)) > df.empty <- subset(df, a>10) > byy <- by(data=df, INDICES=df$b, FUN=functi

Re: [R-pkg-devel] What influences the size of the rdb file in a package

2021-10-30 Thread Bill Dunlap
tes [Is there a more direct way to remove byte code from a function? Or to inspect it?] Building Matrix with --no-byte-compile reduces the size of R/Matrix.rdx by more than half, from 2.7 MB to 1 MB. -Bill On Sat, Oct 30, 2021 at 12:00 AM Mosqueira Sanchez, Iago < iago.mosque...@wur.nl&

Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Bill Dunlap
Can you tell if the failure to download was due to a Solaris-specific issue or due to the Solaris test machine not being fully connected to the internet? -Bill On Fri, Sep 24, 2021 at 7:50 AM Roy Mendelssohn - NOAA Federal via R-package-devel wrote: > Hi All: > > I am getting din

[R-pkg-devel] Unicode Name Warnings for Package Constant

2021-09-02 Thread bill
unable to translate '' to native encoding unable to translate '' to native encoding unable to translate '' to native encoding unable to translate '' to native encoding unable to translate '' to native encoding unable to translate '' to native encoding unable to translat

Re: [R-pkg-devel] can't reproduce 'Additional issues' on CRAN with valgrind

2021-08-06 Thread Bill Dunlap
;data, p, n ); + s->data[n] = '\0'; s->len = n; } I don't know why valgrind isn't working for you. -Bill On Mon, Aug 2, 2021 at 4:23 PM Georgi Boshnakov < georgi.boshna...@manchester.ac.uk> wrote: > Thanks for looking into this. I probably didn’t make it clear that

Re: [R-pkg-devel] can't reproduce 'Additional issues' on CRAN with valgrind

2021-08-02 Thread Bill Dunlap
I ran the tests of rbibutils-2.2.2, using the latest devel version of R configured to use valgrind, with R --debugger=valgrind --debugger-args=--track-origins=yes --quiet -e 'testthat::test_package("rbibutils")' I saw a lot of 'conditional jump depends on uninitialized value' errors: ==27280==

Re: [Rd] [R-pkg-devel] Tracking down inconsistent errors and notes across operating systems

2021-07-22 Thread Bill Dunlap
‘s_object’ 7 | static s_object* obj = NULL; |^~~~ On Thu, Jul 22, 2021 at 10:18 AM Bill Dunlap wrote: > I think the problem with RPostgreSQL/sec/RS-DBI.c comes from some changes > to Defn.h and Rinternals.h in RHOME/include that Luke made recently > (2021

Re: [R-pkg-devel] Tracking down inconsistent errors and notes across operating systems

2021-07-22 Thread Bill Dunlap
I think the problem with RPostgreSQL/sec/RS-DBI.c comes from some changes to Defn.h and Rinternals.h in RHOME/include that Luke made recently (2021-07-20, svn 80647). Since then the line #define s_object SEXPREC in Rdefines.h causes problems. Should it now be 'struct SEXPREC'? -Bill On Thu

Re: [R-pkg-devel] weird C stack traces from win-builder, due to brms/rstan load?

2021-07-05 Thread Bill Dunlap
tor >&) -Bill On Mon, Jul 5, 2021 at 11:01 AM Duncan Murdoch wrote: > On 05/07/2021 10:32 a.m., Ben Bolker wrote: > >I'm running into trouble checking a new release of the 'broom.mixed' > > package <https://cran.r-project.org/web/packages/broom.mixed/index.html&g

Re: [Rd] ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread Bill Dunlap
am) [1] FALSE > .Call("is_altrep", amn) [1] FALSE where is_altrep() is defined by the following C code: #include #include SEXP is_altrep(SEXP x) { return Rf_ScalarLogical(ALTREP(x)); } -Bill On Tue, Jun 29, 2021 at 8:03 AM Sebastian Martin Krantz < sebastian.kra...@graduate

Re: [Rd] Should last default to .Machine$integer.max-1 for substring()

2021-06-21 Thread Bill Dunlap
give 4 identical results with no warning: > substring("abcde", 3, c(10, 2^31-1, 2^31, Inf)) [1] "cde" "cde" NANA Warning message: In substring("abcde", 3, c(10, 2^31 - 1, 2^31, Inf)) : NAs introduced by coercion to integer range -Bill On Mon, Jun

Re: [R-pkg-devel] [Error] data length differs from size of matrix

2021-06-04 Thread Bill Dunlap
solve_svd's second argument is 'tolerance', a small scalar value, not the right hand side of X %*% beta == Y. It returns the [approximate] inverse of X, not beta. solve_svd(cor.x2,cor.y) should probably be solve_svd(cor.x2)%*%cor.y (or just solve(cor.x2,cor.y)). -Bill On Fri, Jun 4, 2021 at 8

Re: [R-pkg-devel] [Error] data length differs from size of matrix

2021-06-04 Thread Bill Dunlap
The offending line in path_coeff seems to be betas[i, 2:nvar] <- t(solve_svd(cor.x2, cor.y)) where i is a single integer, nvar is 15, and the right hand side is a 14 by 14 matrix. What is this line trying to do? Did it ever give the correct result? -Bill On Fri, Jun 4, 2021 at 7:39 AM B

Re: [R-pkg-devel] [Error] data length differs from size of matrix

2021-06-04 Thread Bill Dunlap
lt;- -> [<-.data.frame -> matrix Execution halted In the current R-devel the matrix command matrix(value, nrow, ncol) complains if length(value)>nrow*ncol, so you need to truncate 'value'. (Previously matrix() would silently truncate value.) -Bill On Thu, Jun 3, 2021 at 5:57 PM Tiago O

Re: [Rd] base R pipe documentation

2021-05-18 Thread Bill Dunlap
help(`|>`) does mention magrittr's pipe operator so the user can compare and contrast them. -Bill On Mon, May 17, 2021 at 10:20 AM Ben Bolker wrote: >As of right now, as far as I can tell, the documentation for the new > native |> pipe still says that it's experimental. >

Re: [R-pkg-devel] R vignettes

2021-04-29 Thread Bill Dunlap
cli does export col_red - did you omit the 'r' when calling it from your package or vignette? On Thu, Apr 29, 2021 at 9:29 AM Danielle Maeser wrote: > Hi Duncan, > > I really appreciate your response. Unfortunately, I am still receiving the > error below. > > If anyone has ideas, I'd appreciate

Re: [R-pkg-devel] Using ggplot2 within another package

2021-04-24 Thread Bill Dunlap
S=c("weights","subset","offset")) usesNSE(FUN="~") # missing ARGUMENTS means all args are NSE This information would be stored in the environment that contains FUN. -Bill On Sat, Apr 24, 2021 at 6:18 AM Martin Maechler wrote: > >>>>> Ben Bolker

Re: [Bioc-devel] CGEN package maintainer change request

2021-04-23 Thread Wheeler, Bill (IMS)
Dear Bioconductor, Please let Nilotpal Sanyal be the new maintainer of the CGEN package. Sincerely, Bill From: Nilotpal Sanyal Sent: Thursday, April 22, 2021 7:24 PM To: maintai...@bioconductor.org; bioc-devel@r-project.org Cc: Wheeler, Bill (IMS) ; Summer S Han ; nilan...@jhu.edu Subject

Re: [R-pkg-devel] Error on Solaris 10 'memory not mapped'

2021-04-01 Thread Bill Dunlap
Have you run the offending examples under valgrind on Linux with gctorture(TRUE)? -Bill On Thu, Apr 1, 2021 at 11:51 AM Zhang, Wan wrote: > > Hello, > > In our package “BET” version 0.3.4 published on 2021-03-21, there is a > “memory not mapped” error on Solaris 10. &g

Re: [Rd] Surprising behavior when using the reference class with the dollar symbol

2021-03-27 Thread Bill Dunlap
i <- "A" > `$`(L, i) NULL The 2nd argument is treated as a symbol and is never evaluated. If it is given as a string literal then it is converted to a symbol - that is a holdover from the old days before backticks could be used to make symbol literals for symbols that included odd th

Re: [Rd] Potential improvements of ave?

2021-03-16 Thread Bill Dunlap
Your proposed change (roughly, replacing interaction() by unique(paste())) slows down ave() considerably when there are long columns with lots of repeated rows. I think that interaction(drop=TRUE, ...) can be changed to use less memory and be faster by making a separate branch for drop=TRUE that

Re: [R-pkg-devel] rcmdcheck reports wrong version of lattice

2021-03-08 Thread Bill Dunlap
I haven't followed all the code branches in tools:::.check_packages(), but some of them use --vanilla when running the R subprocess that does the checking. I think that would mean that libraries in ~/R would not be in the search path. -BIll On Mon, Mar 8, 2021 at 8:45 AM Thierry Onkelinx wrote

Re: [R-pkg-devel] How to R CMD build / check using LTO

2021-02-18 Thread Bill Dunlap
logicals out of habit. -Bill On Thu, Feb 18, 2021 at 1:59 AM Paul Schmidt-Walter wrote: > > Hi Bill, > > thanks a lot for your suggestion! > > I managed to use Gabors Docker image to reproduce the warning... I > already found a solution, by turning LOGICAL to INTEGER in the F

Re: [R-pkg-devel] How to R CMD build / check using LTO

2021-02-17 Thread Bill Dunlap
I suspect your problem is that, at least with the recent gnu compilers, the Fortran 'c_logical' maps to the C _Bool, not the C int. -Bill On Wed, Feb 17, 2021 at 11:38 AM Paul Schmidt-Walter wrote: > > Dear Team, > > My package 'LWFBrook90R' (https://github.com/pschmidtwalter

Re: [Rd] Corrupt internal row names when creating a data.frame with `attributes<-`

2021-02-16 Thread Bill Dunlap
> rownames(as.matrix(dPos)) [1] "1" "2" "3" > rownames(as.matrix(dNeg)) NULL -Bill On Tue, Feb 16, 2021 at 11:06 AM Kevin Ushey wrote: > > Strictly speaking, I don't think this is a "corrupt" representation, > given that any APIs used t

Re: [Rd] brief update on the pipe operator in R-devel

2021-01-15 Thread Bill Dunlap
If 3 |> x => f(x, y=x) were allowed then I think that runif(1) |> x => f(x, y=x) be parsed as f(runif(1), y=runif(1)) so runif(1) would be evaluated twice, leading to incorrect results from f(). -Bill On Fri, Jan 15, 2021 at 2:16 PM Avi Gross via R-devel wro

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-13 Thread Bill Dunlap
{ if (!is.list(expr)) { expr <- as.list(expr) } nms <- names(expr) for (i in seq_along(expr)) { str.language(expr[[i]], name=nms[[i]], indent = indent + 1) } } invisible(expr) } On Tue, Jan 12, 2021 at 1:16 P

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Bill Dunlap
|> and => into an ordinary looking function call so deparsing is irrelevant. > deparse(quote(x |> tmp => f(7,arg2=tmp))) [1] "f(7, arg2 = x)" -Bill On Tue, Jan 12, 2021 at 12:01 PM Dirk Eddelbuettel wrote: > > On 12 January 2021 at 20:38, Iñaki Ucar wrot

Re: [R-pkg-devel] accessing call constructors in Cpp

2021-01-05 Thread Bill Dunlap
Try using their official names, Rf_ScalarReal, Rf_eval, Rf_install, etc. You may have #defined R_NO_REMAP in code that you did not show us. -Bill On Tue, Jan 5, 2021 at 1:42 PM Oliver Madsen wrote: > This is maybe better suited for Rcpp-devel or another mailing list. If so, > I apo

Re: [Rd] From .Fortran to .Call?

2020-12-31 Thread Bill Dunlap
to R objects), never the double* or the like that .Fortran expects. -Bill On Wed, Dec 23, 2020 at 3:58 AM Koenker, Roger W wrote: > Thanks to all and best wishes for a better 2021. > > Unfortunately I remain somewhat confused: > > o Bill reveals an elegant way to get from

Re: [Rd] From .Fortran to .Call?

2020-12-31 Thread Bill Dunlap
. -Bill On Wed, Dec 23, 2020 at 8:27 AM Bill Dunlap wrote: >As the proverbial naive R (ab)user I’m left wondering: > > o if I updated my quantreg_init.c file in accordance with Bill’s > suggestion could I > then simply change my .Fortran calls to .Call?

Re: [Rd] From .Fortran to .Call?

2020-12-19 Thread Bill Dunlap
To make C prototypes for routines defined in a *.f file you can use gfortran's -fc-prototypes-external flag. You still have to convert 'name_' to 'F77_NAME(name). bill@Bill-T490:~/packages/quantreg/src$ gfortran -fc-prototypes-external -fsyntax-only boot.f ... [elided defs of complex types

Re: [Rd] the pipe |> and line breaks in pipelines

2020-12-09 Thread Bill Dunlap
thing to make it easy to turn debugging on and off with options(debug=TRUE/FALSE). -Bill On Wed, Dec 9, 2020 at 1:58 PM Timothy Goodman wrote: > > On Wed, Dec 9, 2020 at 1:03 PM Duncan Murdoch > wrote: Then I could run any number of lines with pipes at the > > > > start a

Re: [Rd] [R/S-PLUS] [EXTERNAL] Re: [External] anonymous functions

2020-12-07 Thread Bill Dunlap
One advantage of the new pipe operator over magrittr's is that the former works with substitute(). > f <- function(x, xlab=deparse1(substitute(x))) paste(sep="", xlab, ": ", paste(collapse=", ",x)) > 2^(1:4) |> f() [1] "2^(1:4): 2, 4, 8, 16" > 2^(1:4) %>% f() [1] ".: 2, 4, 8, 16" This is

Re: [Rd] all.equal applied to function closures

2020-12-01 Thread Bill Dunlap
nv(list(p=1.5), parent=new.env(parent=baseenv( > base::all.equal.environment(E1,E3) [1] TRUE > globalenv()$all.equal.environment(E1,E3) [1] " Component “p”: Mean relative difference: 0.1538462" [2] " target is and current is " On Tue, Dec 1, 2020 at 1:31 AM Martin M

Re: [Rd] all.equal applied to function closures

2020-11-30 Thread Bill Dunlap
To make the comparison more complete, all.equal.environment could compare the parents of the target and current environments. That would have to be recursive but could stop at the first 'top level environment' (the global, empty, or a package-related environment generally) and use identical

Re: [Rd] .Internal(quit(...)): system call failed: Cannot allocate memory

2020-11-23 Thread Bill Dunlap
=SA_NOSAVE, status=status@entry=0, runLast=) at system.c:87 #4 0x556cc85e in do_quit (call=, op=, args=0x57813f90, rho=) at main.c:1393 -Bill On Mon, Nov 23, 2020 at 3:15 AM Tomas Kalibera wrote: > On 11/21/20 6:51 PM, Jan Gorecki wrote: > > Dear R-developers, > > &

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Bill Dunlap
Perhaps the parser should warn if you use return() at all. It is rarely needed and is akin to the evil 'GOTO' statement in that it makes the flow of control less obvious to the reader. -Bill On Fri, Nov 20, 2020 at 2:37 PM Mateo Obregón wrote: > I'm not thinking of complicated ca

Re: [Rd] formatting issue with gcc 9.3.0 on Ubuntu on WSL2

2020-11-18 Thread Bill Dunlap
fixed the problem. This also fixed one of my test C programs: '1.0L + 1e-60L > 1.0L' was true if I compiled with gcc -O but false with no optimization. On Wed, Nov 18, 2020 at 3:56 AM Iñaki Ucar wrote: > On Wed, 18 Nov 2020 at 10:26, Tomas Kalibera > wrote: > > > > On 1

[Rd] formatting issue with gcc 9.3.0 on Ubuntu on WSL2

2020-11-17 Thread Bill Dunlap
000e-15" "9.838000e-15" [7] "9.899000e-15" "9.934000e-15" "9.995000e-15" > str(grep(value=TRUE, "0e", vapply((1+(0:1)/1000)*1e-14, deparse, ""))) chr [1:295] "8.002000e-14" "8

[Rd] (no subject)

2020-11-04 Thread Bill Dunlap
Hi All, I am no longer with TIBCO and hope to be able to contribute more directly to R now. It will take a little while to set up a build environment and to start working on some bugzilla issues. -Bill Dunlap williamwdun...@gmail.com [[alternative HTML version deleted

Re: [Rd] tools::package_dependencies problems

2020-10-16 Thread Bill Dunlap
Have you tried using the 'db' argument to tools::package_dependencies? rbind the common columns of installed.packages() and available.packages() and use that as the package database. installed <- installed.packages() available <- available.packages() commonCols <-

[R-pkg-devel] Compiling 32-bit on Windows using 64-bit gcc and -m32

2020-09-07 Thread bill
leted successfully (though installation failed as expected because the compiled .dll couldn't load on 32-bit R). Thanks, Bill [[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] Check Error Due to Unicode in Documentation

2020-07-23 Thread bill
hand, > instead of auto-generated? I don't think roxygen2 intentionally converts \u sequences, I think this is just a consequence of the parse() + deparse() roundtrip: x <- '"\\u03bc"' charToRaw(x) #> [1] 22 5c 75 30 33 62 63 22 y <- deparse(eval(parse(text = x))) charToRaw(y) #

[R-pkg-devel] Check Error Due to Unicode in Documentation

2020-07-23 Thread bill
4194320e07/R/unicode_to_ascii.R#L28-L31 And the documentation is here: https://github.com/billdenney/bsd.report/blob/454caf217c5b333af1d65c7e63bbad 4194320e07/man/unicode_to_ascii.Rd#L17-L24 Do you have any suggestions on how to make this code/documentation work with Codoc? Thanks, B

Re: [R-pkg-devel] Private S3 Method not Found

2020-02-17 Thread bill
ot desired. Thanks, Bill -Original Message- From: Duncan Murdoch On 17/02/2020 10:05 a.m., b...@denney.ws wrote: > Does anyone know why the S3 method for name class objects is not found > when checking the package? I think you need to register knit_print_helper_formula.name as an

Re: [R-pkg-devel] Private S3 Method not Found

2020-02-17 Thread bill
}[!tbp] \begin{center} \begin{tabular}{l} \hline\hline \multicolumn{1}{c}{}\tabularnewline \hline ~\tabularnewline a\tabularnewline b\tabularnewline \hline \end{tabular}\end{center} \end{table} While I’m wanting an equation: $$a = b$$ Thanks, Bill From: Richard M

[R-pkg-devel] Private S3 Method not Found

2020-02-17 Thread bill
formula.R #L60-L79): knit_print_helper_formula <- function(x, ...) { UseMethod("knit_print_helper_formula") } # Some other methods knit_print_helper_formula.name <- function(x, ...) { # Function body } Does anyone know why the S3 method for name class ob

Re: [R-pkg-devel] Large Data Package CRAN Preferences

2019-12-15 Thread bill
etenv("HOME"), "datapkg_cache")` if they have not set the option. To me #3 sounds best, but I'd like to be sure that I'm not missing something. Thanks, Bill -Original Message- From: Uwe Ligges Sent: Sunday, December 15, 2019 11:54 AM To: b...@denney.ws; r-package-de

[R-pkg-devel] Large Data Package CRAN Preferences

2019-12-12 Thread bill
lly with the umbrella package. I believe that it is considered poor form to write within the library location for a package except during installation. What is the best practice for caching the resulting large dataset which is locally-generated? Thanks, Bill [[alternative HTML version dele

Re: [R-pkg-devel] How to Document and S3 Method for the Parenthesis Class?

2019-11-07 Thread bill
> entries, and all their arguments documented. > > The \usage entries must correspond to syntactically valid R code. > > See chapter 'Writing R documentation files' in the 'Writing R > > Extensions' manual. > > > >I have tried variants of escaping the pare

Re: [R-pkg-devel] How to Document and S3 Method for the Parenthesis Class?

2019-11-07 Thread bill
entries, and all their arguments documented. > >The \usage entries must correspond to syntactically valid R code. > >See chapter 'Writing R documentation files' in the 'Writing R > >Extensions' manual. > > > > I have tried variants of escap

[R-pkg-devel] How to Document and S3 Method for the Parenthesis Class?

2019-11-07 Thread bill
tensions' manual. I have tried variants of escaping the parenthesis like "\(" and "\\(" and the unescaped variant "(", too. Thanks, Bill [1] In case the first thought is, "don't write formula which have a full side within redundant parenthes

Re: [R-pkg-devel] Literal LaTeX Text in Function Arguments

2019-08-24 Thread bill
tead of what is shown in the 2 backslashes case when check showed just "...". So, while I agree that 4 backslashes would make the most sense for the .Rd file, there is still an issue somewhere with that 4 backslashes case. Thanks, Bill -Original Message- From: Duncan Murdoch Sent: Sat

Re: [R-pkg-devel] Literal LaTeX Text in Function Arguments

2019-08-24 Thread bill
case when check showed just "...". So, while I agree that 4 backslashes would make the most sense for the .Rd file, there is still an issue somewhere with that 4 backslashes case. Thanks, Bill -Original Message- From: Duncan Murdoch Sent: Saturday, August 24, 2019 8:37 A

Re: [R-pkg-devel] Literal LaTeX Text in Function Arguments

2019-08-23 Thread bill
tinued \\ldots", verbatim = NULL) Docs: function(x, bottom_border = "\hline", bottom_all_pages = NULL, bottom_last_page = NULL, subsequent_page_notification = "continued ...", verbatim = NULL) Mismatches in argument default values: Nam

Re: [R-pkg-devel] Literal LaTeX Text in Function Arguments

2019-08-23 Thread bill
th extra escaping for the backslashes (well, roxygen2 is doing the extra escaping). Rd text -- topic_long_table_header(x, col_names = NULL, above_col_names = "hline", below_col_names = "hline", subsequent_page_notification = "\\\\ldots continued&q

[R-pkg-devel] Literal LaTeX Text in Function Arguments

2019-08-23 Thread bill
subsequent_page_notification = "\... continued", latex_header = NULL) ``` I'm not sure, but I think that the solution is to add more protection to the \s when generating the roxygen or perhaps wrapping the arguments in some form of verbatim block (if it's avai

Re: [R-pkg-devel] Conditionally register method with generic in other package

2017-12-06 Thread Bill Denney
be") } } else { message("To use the foo.bar function, please install package A.") } Thanks, Bill __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Bill Denney
other packages. I'm going to implement that unless someone indicates something that I'm missing. Thanks, Bill > > I can ask to translate that into the current session language using > > gettext("NaNs produced", domain = "R") > > Figuring out the righ

[R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Bill Denney
ror (about coercion) without testing the formatting of the error text? The only solution that immediately occurs to me is to wrap the coercion in a tryCatch and give my own error. But, then were the R error translated, the users of my package would lose the benefit of translation. Tha

Re: [R-pkg-devel] Installing Tests with R Build

2017-11-25 Thread Bill Denney
directory and run the vignette if the tests were installed. Thanks, Bill -Original Message- From: Joshua Ulrich [mailto:josh.m.ulr...@gmail.com] Sent: Saturday, November 25, 2017 9:20 AM To: Bill Denney <b...@denney.ws> Cc: Dirk Eddelbuettel <e...@debian.org>; r-pac

Re: [R-pkg-devel] Installing Tests with R Build

2017-11-23 Thread Bill Denney
Hi Joshua and Dirk, > On Nov 23, 2017, at 10:17, Dirk Eddelbuettel <e...@debian.org> wrote: > > > On 23 November 2017 at 08:07, Joshua Ulrich wrote: > | On Wed, Nov 22, 2017 at 4:21 PM, Bill Denney <b...@denney.ws> wrote: > | > When running R BUILD no

[R-pkg-devel] Installing Tests with R Build

2017-11-22 Thread Bill Denney
, I can add --install-tests. Is there a way to control R BUILD so that the installation includes test installation? Thanks, Bill __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R-pkg-devel] r-quantities seeking feedback

2017-10-06 Thread Bill Denney
own libraries (optionally). Thanks, Bill > On Oct 6, 2017, at 13:13, David Hugh-Jones <davidhughjo...@gmail.com> wrote: > > One question that comes to mind: what's the synergy? I e why are units and > errors best handled together? I use standard errors a lot, but never &g

[R-pkg-devel] Loading Libraries Outside of .lib.loc

2017-06-28 Thread Bill Denney
Paths), c("/tmp/current", "/usr/local/lib/R/site-library", "/usr/lib/R/site-library", "/usr/lib/R/library")) Thanks, Bill P.S. Apologies if this would better fit on a more general mailing list, but the

Re: [R-pkg-devel] Handling Not-Always-Needed Dependencies? - Part 2

2016-08-04 Thread Bill Denney
because no end user ever needs it? If "Depends", then it leads to over-installation of the package by end users who don't care about running tests locally. If "Suggests", then all of the tests would fail (assuming that Dirk's suggestion is implemented). At a loss,

Re: [R-pkg-devel] Warning that are Unintentionally OS-Specific (Maybe Bug in warning?)

2016-07-20 Thread Bill Denney
! Bill On 7/20/2016 3:40 PM, Ben Bolker wrote: Digging into the code (specifically by setting options(warn=2,error=recover), I see that the warning is happening during this call: tmp.results <- parallel::mclapply(X = conc.dose, FUN = pk.nca.intervals, intervals = data$interv

Re: [R-pkg-devel] Warning that are Unintentionally OS-Specific (Maybe Bug in warning?)

2016-07-20 Thread Bill Denney
it behave differently when options(warn=1) is set rather than the default of options(warn=0)? Thanks, Bill On 7/20/2016 3:06 PM, François Michonneau wrote: Hi Bill, The problem is not with the warning() function but with your if() test that triggers the warning. It probably has something

[R-pkg-devel] Warning that are Unintentionally OS-Specific (Maybe Bug in warning?)

2016-07-20 Thread Bill Denney
why warnings may behave differently on Windows compared to non-Windows platforms? Is this a bug in R somewhere? (I've not been able to make a simpler example that triggers the issue, unfortunately.) Thanks, Bill __ R-package-devel@r-project.org mailin

Re: [Rd] How to convert time_t to R date object

2014-03-17 Thread Bill Wang
Hi Sandip, I think that you know on the 64-bit Unix/Linux/OS X platforms, long is 64-bit whereas int and INTEGER are 32-bit, so return directly Integer unexpected problems may occur. Cheers, Bill 2014-03-17 13:24 GMT+08:00 Sandip Nandi sanna...@umail.iu.edu: Hi Bill , The following C code

[Rd] How to convert time_t to R date object

2014-03-16 Thread Bill Wang
Hi all, I am writing a R extensions, and I need pass time_t to R in C, but I don't know how to do. Can you give me some help? do not use double directly. Thanks, Bill -- *Travel | Programming* *http://freecnpro.net* http://freecnpro.net [[alternative HTML version deleted

  1   2   3   >