Re: [R-pkg-devel] [Tagged] Re: multithreading in packages

2021-10-09 Thread Viechtbauer, Wolfgang (SP)
One thing I did not see mentioned in this thread (pun intended) so far: For what kind of computations is multithreading supposed to be used within the package being developed? If the computations involve a lot of linear/matrix algebra, then one could just use R with other linear algebra

Re: [R-pkg-devel] [External] Re: What is a "retired"package?

2021-09-21 Thread Viechtbauer, Wolfgang (SP)
:) That's a fortune nomination on my part. Best, Wolfgang >-Original Message- >From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On Behalf >Of >Hadley Wickham >Sent: Tuesday, 21 September, 2021 20:45 >To: Lenth, Russell V >Cc: r-package-devel@r-project.org >Subject:

Re: [Rd] sum() and mean() for (ALTREP) integer sequences

2021-09-03 Thread Viechtbauer, Wolfgang (SP)
Andre [mailto:andre.gillib...@chu-rouen.fr] >Sent: Thursday, 02 September, 2021 21:54 >To: Viechtbauer, Wolfgang (SP); r-devel@r-project.org >Subject: RE: sum() and mean() for (ALTREP) integer sequences > >Hello, > >Please, find a long response below. > >== difference be

Re: [Rd] sum() and mean() for (ALTREP) integer sequences

2021-09-03 Thread Viechtbauer, Wolfgang (SP)
>> Hi all, >> >> I am trying to understand the performance of functions applied to integer >sequences. Consider the following: >> >> ### begin example ### >> >> library(lobstr) >> library(microbenchmark) >> >> x <- sample(1e6) >> obj_size(x) >> # 4,000,048 B >> >> y <- 1:1e6 >> obj_size(y) >> #

[Rd] sum() and mean() for (ALTREP) integer sequences

2021-09-02 Thread Viechtbauer, Wolfgang (SP)
Hi all, I am trying to understand the performance of functions applied to integer sequences. Consider the following: ### begin example ### library(lobstr) library(microbenchmark) x <- sample(1e6) obj_size(x) # 4,000,048 B y <- 1:1e6 obj_size(y) # 680 B # So we can see that 'y' uses ALTREP.

Re: [R-pkg-devel] [External] R package submission fails due to using LaTeX functions that have not been implemented for building pdfs (not due to mathjaxr)

2021-06-25 Thread Viechtbauer, Wolfgang (SP)
again one of these quirks that is good to document. Best, Wolfgang >-Original Message- >From: Richard M. Heiberger [mailto:r...@temple.edu] >Sent: Friday, 25 June, 2021 16:53 >To: Marc Scherstjanoi >Cc: Viechtbauer, Wolfgang (SP); r-package-devel@r-project.org >Subject:

Re: [R-pkg-devel] speeding up package code/build/test cycle

2021-06-24 Thread Viechtbauer, Wolfgang (SP)
Dear Greg, You might want to look into the load_all() function from 'devtools'. Best, Wolfgang >-Original Message- >From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On Behalf >Of >Greg Minshall >Sent: Thursday, 24 June, 2021 11:16 >To: r-package-devel@r-project.org

Re: [R-pkg-devel] R package submission fails due to mathjaxr package

2021-06-21 Thread Viechtbauer, Wolfgang (SP)
age- >From: Marc Scherstjanoi [mailto:marc.scherstja...@thuenen.de] >Sent: Sunday, 20 June, 2021 23:16 >To: Viechtbauer, Wolfgang (SP) >Cc: Tiago Olivoto; Max Turgeon; r-package-devel@r-project.org >Subject: Re: R package submission fails due to mathjaxr package > >Hi

Re: [R-pkg-devel] R package submission fails due to mathjaxr package

2021-06-20 Thread Viechtbauer, Wolfgang (SP)
Hi Marc, mathjaxr maintainer here. Can you provide a minimal reproducible example illustrating the problem? If this is another case where the LaTeX command for Mathjax does not work directly for creating the pdf (or vice-versa), then I would like to document this (and a possible workaround) as

Re: [Rd] URL checks

2021-01-11 Thread Viechtbauer, Wolfgang (SP)
>>>>>> Viechtbauer, Wolfgang (SP) >>>>>> on Fri, 8 Jan 2021 13:50:14 + writes: > >> Instead of a separate file to store such a list, would it be an idea >to add versions of the \href{}{} and \url{} markup commands that are skipped >b

Re: [Rd] URL checks

2021-01-11 Thread Viechtbauer, Wolfgang (SP)
Instead of a separate file to store such a list, would it be an idea to add versions of the \href{}{} and \url{} markup commands that are skipped by the URL checks? Best, Wolfgang >-Original Message- >From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Spencer >Graves

Re: [R-pkg-devel] [External] Re: Two packages with the same generic function

2020-06-23 Thread Viechtbauer, Wolfgang (SP)
Re: Two packages with the same generic >function > >On 23/06/2020 4:22 a.m., Guido Schwarzer wrote: >> Am 23.06.20 um 10:00 schrieb Viechtbauer, Wolfgang (SP): >>> [...] >>> @Neal: A separate package with generic functions that pkgA and pkgB could >import is a

Re: [R-pkg-devel] [External] Re: Two packages with the same generic function

2020-06-23 Thread Viechtbauer, Wolfgang (SP)
to accomplish this. This relies >on >> >>>> "methods" returning an error if "foo" has no defined methods, so it >is >> >>> not >> >>>> redefined if their are previous methods. I haven't had time to try >> this >&

[R-pkg-devel] Two packages with the same generic function

2020-06-22 Thread Viechtbauer, Wolfgang (SP)
Hi All, Let's say there are two packages pkgA and pkgB, both of which have a generic function foo <- function(x, ...) UseMethod("foo") and pkgA has a method for objects of class "A": foo.A <- function(x, ...) print(x) and pkgB has a method for objects of class "B": foo.B <-

[Rd] Possible bug in heatmap()?

2020-06-21 Thread Viechtbauer, Wolfgang (SP)
Dear All, There might be a bug in heatmap(): x <- matrix(rnorm(10*5), 10, 5) heatmap(x, labCol=1:5) Error in axis(1, 1L:nc, labels = labCol, las = 2, line = -0.5, tick = 0, : 'at' and 'labels' lengths differ, 5 != 10 Works fine under 4.0.1. Looking at the code from 4.0.1 vs. Rdevel, esp.

Re: [R-pkg-devel] RES: RES: MathJax for Rd files

2020-05-13 Thread Viechtbauer, Wolfgang (SP)
a the CDN, which means that you need an internet connection for equations to render. Best, Wolfgang >-Original Message- >From: Tiago Olivoto [mailto:tiagooliv...@gmail.com] >Sent: Wednesday, 13 May, 2020 21:25 >To: 'Duncan Murdoch'; Viechtbauer, Wolfgang (SP); r-package-devel@r-

Re: [R-pkg-devel] RES: MathJax for Rd files

2020-05-13 Thread Viechtbauer, Wolfgang (SP)
020 20:31 >To: Viechtbauer, Wolfgang (SP); 'Duncan Murdoch'; r-package-devel@r- >project.org >Subject: RES: [R-pkg-devel] RES: MathJax for Rd files > >Thank you so much! It works! >In my example, I've created a simple helper function, preview_rd() > >preview_rd <- f

Re: [R-pkg-devel] RES: MathJax for Rd files

2020-05-13 Thread Viechtbauer, Wolfgang (SP)
L(tools::Rd2HTML(Rd, outfile, macros="/mathjaxr/help/macros/mathjax.Rd")) Best, Wolfgang >-Original Message- >From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] >Sent: Wednesday, 13 May, 2020 19:30 >To: tiagooliv...@gmail.com; Viechtbauer, Wolfgang (SP); 'Helmut Schütz';

Re: [R-pkg-devel] MathJax for Rd files

2020-05-13 Thread Viechtbauer, Wolfgang (SP)
May, 2020 17:01 >To: Viechtbauer, Wolfgang (SP); tiagooliv...@gmail.com; r-package-devel@r- >project.org >Subject: Re: [R-pkg-devel] MathJax for Rd files > >Hi Wolfgang, > >Viechtbauer, Wolfgang (SP) wrote on 2020-05-13 16:53: >> Seems like you are using roxygen2. I have

Re: [R-pkg-devel] MathJax for Rd files

2020-05-13 Thread Viechtbauer, Wolfgang (SP)
mailto:tiagooliv...@gmail.com] >Sent: Wednesday, 13 May, 2020 16:20 >To: Viechtbauer, Wolfgang (SP); r-package-devel@r-project.org >Subject: RES: [R-pkg-devel] MathJax for Rd files > >Dear Wolfgang, >Thank you so much for the awesome package >I've installed mathjaxr and it worked. &g

Re: [R-pkg-devel] MathJax for Rd files

2020-05-13 Thread Viechtbauer, Wolfgang (SP)
Dear Olivoto, There is a package now for this purpose: https://cran.r-project.org/package=mathjaxr https://github.com/wviechtb/mathjaxr Best, Wolfgang >-Original Message- >From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On >Behalf Of Tiago Olivoto >Sent: Wednesday,

Re: [Rd] S3 method dispatch for methods in local environments

2020-05-12 Thread Viechtbauer, Wolfgang (SP)
the S3 >method using the new function .S3method (intended for R scripts, not >packages). After running > >.S3method("print", "myclass", myenv$print.myclass) > >your method will be found from the generic. > >Best regards, > > Seb

Re: [Rd] S3 method dispatch for methods in local environments

2020-05-12 Thread Viechtbauer, Wolfgang (SP)
"myclass", myenv$print.myclass) attach(myenv) myfun(1:4) # [1] "1.0" "2.0" "3.0" "4.0" Thanks for the tip! Best, Wolfgang >-Original Message- >From: Martin Maechler [mailto:maech...@stat.math.ethz.ch] >Sent: Tuesd

[Rd] S3 method dispatch for methods in local environments

2020-05-12 Thread Viechtbauer, Wolfgang (SP)
Dear All, In R 3.6.3 (and earlier), method dispatch used to work for methods stored in local environments that are attached to the search path. For example: myfun <- function(y) { out <- list(y=y) class(out) <- "myclass" return(out) } print.myclass <- function(x, ...)

Re: [Rd] Use of MathJax (or something similar) in .Rd files

2020-05-05 Thread Viechtbauer, Wolfgang (SP)
and suggestions more than welcome! Best, Wolfgang >-Original Message- >From: Ravi Varadhan [mailto:ravi.varad...@jhu.edu] >Sent: Thursday, 30 April, 2020 15:58 >To: Viechtbauer, Wolfgang (SP); r-devel >Subject: Re: [Rd] Use of MathJax (or something similar) in .Rd files &

Re: [Rd] Use of MathJax (or something similar) in .Rd files

2020-04-30 Thread Viechtbauer, Wolfgang (SP)
, 30 April, 2020 12:22 >To: Viechtbauer, Wolfgang (SP); r-devel >Subject: Re: [Rd] Use of MathJax (or something similar) in .Rd files > >On 30/04/2020 6:15 a.m., Viechtbauer, Wolfgang (SP) wrote: >> Interesting. I gave this a try, but couldn't make this work. One would >h

Re: [Rd] Use of MathJax (or something similar) in .Rd files

2020-04-30 Thread Viechtbauer, Wolfgang (SP)
}) doesn't do that (it just gets printed). If somebody has already successfully done this, I would be interested in hearing how. Best, Wolfgang >-Original Message- >From: Gábor Csárdi [mailto:csardi.ga...@gmail.com] >Sent: Thursday, 30 April, 2020 11:51 >To: Viechtbauer, Wolfgang (

[Rd] Use of MathJax (or something similar) in .Rd files

2020-04-30 Thread Viechtbauer, Wolfgang (SP)
Hello All, I am wondering if there has ever been any discussion/consideration given to incorporating MathJax (or something similar) into R for rendering equations in .Rd files. I know that equations are rendered beautifully in the pdf manuals, but I suspect the majority of users primarily look

Re: [R-pkg-devel] Require -package.Rd?

2019-09-24 Thread Viechtbauer, Wolfgang (SP)
-Original Message- From: Dirk Eddelbuettel [mailto:e...@debian.org] Sent: Tuesday, 24 September, 2019 14:39 To: joris.m...@ugent.be Cc: Viechtbauer, Wolfgang (SP); r-package-devel@r-project.org Subject: Re: [R-pkg-devel] Require -package.Rd? Wolfgang, Joris, This may not necessarily

[R-pkg-devel] Require -package.Rd?

2019-09-24 Thread Viechtbauer, Wolfgang (SP)
Hi All, When starting to work with an unfamiliar package, one might typically look for vignettes, a paper/book accompanying the package, a package website, and of course the help files themselves, but help(package="") is often not so useful -- such a listing of functions (with titles) might

[Rd] Weird problem / bug with augPred() from nlme

2019-03-05 Thread Viechtbauer, Wolfgang (SP)
Posted this to r-sig-mixed-models (https://stat.ethz.ch/pipermail/r-sig-mixed-models/2019q1/027620.html) but this might rather need to go to r-devel anyway, so reposting here: I came across a weird problem / bug with augPred() from nlme (nlme_3.1-137). Here is a reproducible example to

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

2017-12-14 Thread Viechtbauer Wolfgang (SP)
Hi All, I asked this over at r-help, but didn't get any responses. As this seems like a bug (or at least undocumented behavior) to me, I'll try again here. It seems to me that xyTable() gets thrown off by NAs: x <- c(1, 1, 2, 2, 2, 3) y <- c(1, 2, 1, 3, NA, 3) table(x, y, useNA="always")

[Rd] Font Size for View() under Linux

2017-10-22 Thread Viechtbauer Wolfgang (SP)
Hello, I am using Ubuntu 16.04, using the default (Unity) window manager. The font size using View() is way too small on a high dpi monitor. I already use scaling, but View() doesn't seem affected by that. On Windows, the font size for View() appears to be controlled by the font size

Re: [Rd] Discourage the weights= option of lm with summarized data

2017-10-08 Thread Viechtbauer Wolfgang (SP)
Ah, I think you are referring to this part from ?lm: "(including the case that there are w_i observations equal to y_i and the data have been summarized)" I see; indeed, I don't think this is what 'weights' should be used for (the other part before that is correct). Sorry, I misunderstood the

Re: [Rd] Discourage the weights= option of lm with summarized data

2017-10-07 Thread Viechtbauer Wolfgang (SP)
Using 'weights' is not meant to indicate that the same observation is repeated 'n' times. It is meant to indicate different variances (or to be precise, that the variance of the last observation in 'x' is sigma^2 / n, while the first three observations have variance sigma^2). Best, Wolfgang

Re: [Rd] Compiling R-devel - missing some expected features (zlib, bzlib, lzma, PCRE)

2017-06-22 Thread Viechtbauer Wolfgang (SP)
echtbauer Wolfgang (SP) >Sent: Thursday, June 22, 2017 12:49 >To: r-devel@r-project.org >Subject: [Rd] Compiling R-devel - missing some expected features (zlib, >bzlib, lzma, PCRE) > >Hi All, > >I am compiling R-devel on Linux (Ubuntu 16.04.2) and that works just fine, >b

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Viechtbauer Wolfgang (SP)
Well, one correction -- the 'standardized coefficients' that SPSS shows are based on standardizing all variables separately (so x1, x2, and x1*x2 are all standardized). So with respect to that, the criticism certainly stands. -Original Message- From: Viechtbauer Wolfgang (SP) Sent

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Viechtbauer Wolfgang (SP)
tp://socserv.mcmaster.ca/jfox/ >- Original Message - > >From: "peter dalgaard" <pda...@gmail.com> >To: "Viechtbauer Wolfgang (SP)" ><wolfgang.viechtba...@maastrichtuniversity.nl>, "Nick Brown" ><nick.br...@free.fr> >

Re: [Rd] lm() gives different results to lm.ridge() and SPSS

2017-05-05 Thread Viechtbauer Wolfgang (SP)
I had no problems running regression models in SPSS and R that yielded the same results for these data. The difference you are observing is from fitting different models. In R, you fitted: res <- lm(DEPRESSION ~ ZMEAN_PA * ZDIVERSITY_PA, data=dat) summary(res) The interaction term is the

[Rd] help(clusterApply) (parallel package)

2017-01-25 Thread Viechtbauer Wolfgang (SP)
Hello, In help(clusterApply) of the 'parallel' package, it says: "clusterApply calls fun on the first node with arguments seq[[1]] and ..., on the second node with seq[[2]] and ..., and so on, recycling nodes as needed." But the argument that is iterated over in clusterApply() is called 'x'