Re: [Rd] Fix documentation about <- and = differences

2025-01-04 Thread Duncan Murdoch
roject.org (rev 608, same day). Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Fix documentation about <- and = differences

2025-01-04 Thread Duncan Murdoch
error. My own feeling is that any use of "=" as an assignment operator is too much. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [R-pkg-devel] Removing packages files

2025-01-03 Thread Duncan Murdoch
suggesting that you require the user to explicitly ask for the data. You don't want CRAN to install the data during testing and then have it left behind at the end. Duncan Murdoch On Thu, 2 Jan 2025 at 22:42, Henrik Bengtsson wrote: As a first step, this sounds like something for the &

Re: [R-pkg-devel] Removing packages files

2025-01-02 Thread Duncan Murdoch
en your package is unloaded.) Duncan Murdoch On 2025-01-02 4:29 p.m., Lluís Revilla wrote: Dear Duncan, Thank you for your answer. I checked again and made a mock package that removes a file with .onDetach. The file was not removed upon uninstalling the package. Lluís On Thu, 2 Jan 2025 a

Re: [Rd] Possible issue in stats/arima.R package

2025-01-02 Thread Duncan Murdoch
On 2025-01-02 11:20 a.m., Duncan Murdoch wrote: On 2025-01-02 9:04 a.m., Norbert Kuder wrote: Hello all, I am running R version 4.4.2 (2024-10-31 ucrt) on Windows 10 x64, and noticed something that might be a minor bug (or at least inconsistent code) in the stats/arima.R package. I have found

Re: [R-pkg-devel] Removing packages files

2025-01-02 Thread Duncan Murdoch
hen the namespace is unloaded (via a call to unloadNamespace, perhaps called by detach(unload = TRUE)) with argument the full path to the installed package’s directory. Functions .onUnload and .onDetach should be defined in the namespace and not exported, but .Last.li

Re: [Rd] Possible issue in stats/arima.R package

2025-01-02 Thread Duncan Murdoch
], Delta, kappa, SSinit) if(ncxreg > 0) x <- x - xreg %*% coef[narma + (1L:ncxreg)] arimaSS(x, mod) yet the log shows no recent changes. I'm not sure what's going on. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [R-pkg-devel] Case of package name

2024-12-30 Thread Duncan Murdoch
I think CRAN would be reluctant to do even this, because it inconveniences anyone who has used the plasma package. Alternatively, point out these issues to the reviewers, and suggest that confusion with blood plasma is unlikely given the context and full title

Re: [R-pkg-devel] Getting summary.glm to use Matrix::chol2inv

2024-12-23 Thread Duncan Murdoch
a2156/src/library/stats/R/glm.R#L687-L773 . You can copy that into your package, then modify it to work with Matrix. You should list "The R Core Team" as a copyright holder on that file if you do this so you're not violating the R license. Duncan Murdoch On 2024-12-22 4:26 p.m.

Re: [R-pkg-devel] use of assert in C++

2024-12-19 Thread Duncan Murdoch
just going by the two mentions you quoted in your first message.) Duncan Murdoch |We trade run-time and compile-time off in other ways so this should be a run-time check, with e.g. Rf_error() or Rcpp::stop() returning to the R prompt with an error message. If you feel you must program your C++ comp

Re: [R-pkg-devel] use of assert in C++

2024-12-19 Thread Duncan Murdoch
remember that those asserts were effectively just comments, not being acted on without some trickery to enable them? You'd be much safer if you used a different function specific to R that triggered an R error if the assertion was false. Duncan Murdoch | |So viewed from that an

Re: [R] Query concerning working directory for file.choose()

2024-12-18 Thread Duncan Murdoch
ends are allowed to replace the underlying function, so that may depend on which front end you are using. I'm talking about R.app on a Mac. Duncan Murdoch On 2024-12-18 10:32 a.m., J C Nash wrote: I've been working on a small personal project that needs to select files for manipul

Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN Submission NMRphasing 1.0.6

2024-12-17 Thread Duncan Murdoch
Nice spotting! Just for fun, I just asked chatgpt if there were any other problems in that code. It spotted 3, but not the one you found. Two of them were definitely bogus, but this one might not be: On line 471 kmax is used, but it may not be initialized. Duncan Murdoch On 2024-12-17 5

Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN Submission NMRphasing 1.0.6

2024-12-17 Thread Duncan Murdoch
I think that is coming from a package you are using, rather than from your package NMRphasing. Maybe you can try working with the maintainer of that package to work out whether the problem is in it or in the way you are using it. Duncan Murdoch Thanks! Aixiang ��ȡOutlook for Android<h

Re: [R-SIG-Mac] R-SIG-Mac Digest, Vol 261, Issue 2

2024-12-16 Thread Duncan Murdoch
Two new data points: 1. The loss of event handling happened again today, so John Fox's suggestion to avoid AppNap was not sufficient. 2. Sys.sleep(10) still produces the ignored events, but in the broken state, it doesn't recover at the end. Dunc

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Duncan Murdoch
so have many local optima, though I don't know in this case. Duncan Murdoch Best, John On Sat, 14 Dec 2024 at 01:14, John Fox wrote: Dear Daniel et al., Following on Duncan's remark and examining the message produced by nloptr(), I simply tried increasing the max

Re: [R] Non linear optimization with nloptr package fail to produce true optimal result

2024-12-13 Thread Duncan Murdoch
You posted a version of this question on StackOverflow, and were given advice there that you ignored. nloptr() clearly indicates that it is quitting without reaching an optimum, but you are hiding that message. Don't do that. Duncan Murdoch On 2024-12-13 12:52 p.m., Daniel Lobo

Re: [R-SIG-Mac] R-SIG-Mac Digest, Vol 261, Issue 2

2024-12-12 Thread Duncan Murdoch
On 2024-12-11 6:22 p.m., Simon Urbanek wrote: On Dec 12, 2024, at 10:00 AM, Duncan Murdoch wrote: On 2024-12-11 3:43 p.m., Michael Hall wrote: Message: 1 Date: Wed, 11 Dec 2024 12:25:42 -0500 From: Duncan Murdoch To: R-SIG-Mac Subject: [R-SIG-Mac] R.app not handling events Message-ID

Re: [R-SIG-Mac] R-SIG-Mac Digest, Vol 261, Issue 2

2024-12-11 Thread Duncan Murdoch
On 2024-12-11 3:43 p.m., Michael Hall wrote: Message: 1 Date: Wed, 11 Dec 2024 12:25:42 -0500 From: Duncan Murdoch To: R-SIG-Mac Subject: [R-SIG-Mac] R.app not handling events Message-ID: Content-Type: text/plain; charset="utf-8"; Format="flowed" Every now and then R.

Re: [R-SIG-Mac] R.app not handling events

2024-12-11 Thread Duncan Murdoch
On 2024-12-11 2:22 p.m., John Fox wrote: Hello Duncan The problem may be related to macOS App Nap (although the persistence of the problem when R.app has the focus seems to contradict that). If so, you could either make sure that R.app retains the focus while the command executes or disable App

[R-SIG-Mac] R.app not handling events

2024-12-11 Thread Duncan Murdoch
n't spotted the cause. The only solution I've found is to quit the session and restart it. Does anyone know what might be causing this, or a way to fix it without ending the session? Duncan Murdoch ___ R-SIG-Mac mailing list R-SI

Re: [R] outer() is not working with my simple function

2024-12-10 Thread Duncan Murdoch
your function could be FN1 <- function(x, y) rep_len(3, length(x)) and it would work. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R-pkg-devel] conditional import of a package?

2024-12-05 Thread Duncan Murdoch
from DESCRIPTION Imports/Depends entries: ‘nloptr’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE And - admittedly - I have no idea about how to insert appropriate import statements in NAMESPACE. You shouldn't need to do that. Duncan Murdoch Best rega

Re: [R-pkg-devel] conditional import of a package?

2024-12-04 Thread Duncan Murdoch
way: In the `.onLoad` function of your package, you would have code like if (requireNamespace("pkg")) { foo <- pkg::foo bar <- pkg::bar } else { foo <- stub bar <- stub } where `stub` is a function that says "you need `pkg` to use this function".

Re: [R] Undocumented behaviour of diag when replacing the diagonal of a matrix?

2024-12-04 Thread Duncan Murdoch
(A[-1, ]) <- 2` is pretty complex; it involves two assignment functions (both `diag<-` and `[<-`), so you might have tried to execute the wrong thing. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [Rd] 'else' on new line not parsed at top level as part of preceding 'if'

2024-12-02 Thread Duncan Murdoch
BTW, this is discussed in section 3.2.1 of "The R Language Definition". Duncan Murdoch On 2024-12-02 10:56 a.m., Mikael Jagan wrote: I wonder if there is room for improvement here: > str2lang("if (a) b1else b0") if (a) b1 else b0 > str2

Re: [R-pkg-devel] [External] Re: Confusing error

2024-12-02 Thread Duncan Murdoch
survey, and add some innocuous direct reference to it to quiet the NOTE. Duncan Murdoch On 2024-12-02 3:38 p.m., Cohen, Aaron wrote: Hello, thank you for getting back to me. I have a github with the code: https://github.com/237triangle/surveynnet <https://github.com/237triangle/surveyn

Re: [Rd] 'else' on new line not parsed at top level as part of preceding 'if'

2024-12-02 Thread Duncan Murdoch
when they are complete, it will evaluate this and return b1 or NULL. Putting the full expression in braces solves the issue, because this is clearly incomplete: { if (a) b1 Duncan Murdoch On 2024-12-02 10:56 a.m., Mikael Jagan wrote: I wonder if there is room for improvement here:

Re: [R-pkg-devel] Confusing error

2024-12-02 Thread Duncan Murdoch
ncies in R code ... NOTE Namespace in Imports field not imported from: ‘survey’ All declared Imports should be used. How do I resolve this issue? I'd remove the survey package on your system, and try running the example that fails. If you get the same error, you can track it

Re: [R] Remove all box around a plot except bottom line (base graphics)

2024-11-29 Thread Duncan Murdoch
d 4 right sides of the plot box) You don't need the axis() call. plot() already includes the x axis. Duncan Murdoch Best Fer On 11/28/24 14:52, Duncan Murdoch wrote: On 2024-11-28 8:36 a.m., Michael Dewey wrote: To make the plot clearer I have removed the axes but I wish to remove al

Re: [R] Remove all box around a plot except bottom line (base graphics)

2024-11-28 Thread Duncan Murdoch
egments(). For example: plot(rnorm(100), yaxt="n", bty="n") usr <- par("usr") lines(usr[c(1,2)], usr[c(3,3)], xpd = TRUE) You might not even need the lines() call if you don't care how far the axis extends. Duncan Murdoch ___

Re: [R-SIG-Mac] What are these other 'R' processes?

2024-11-27 Thread Duncan Murdoch
r? Are they leftovers? I don't see extra R processes. Just the one with the R icon. If you exit R.app, do the remaining processes go away? Duncan Murdoch ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Re: [R] grDevices::bringToTop is documented but not available: A bug?

2024-11-21 Thread Duncan Murdoch
tions have the same issue as ?bringToTop. Maybe someone remembers the intention of that move... Duncan Murdoch On 2024-11-20 1:09 p.m., re...@meer.net wrote: There is help for grDevices::bringToTop but the function is not present. bringToTop() Error in bringToTop() : could not find fun

Re: [R-pkg-devel] Simple way to run code during package install

2024-11-20 Thread Duncan Murdoch
I think I have a solution. Roxygen2 allows this option to be specified in the DESCRIPTION file: Roxygen: list(markdown = TRUE, load = "installed") With the `load = "installed"` setting, it doesn't try to run the .R files. Duncan Murdoch On 2024-11-19 9:01 a.m.,

[R-pkg-devel] Simple way to run code during package install

2024-11-19 Thread Duncan Murdoch
keDependency call so that Roxygen ignores it. Is that possible? 4. I can write a Makevars file that runs makeDependency. That seems like a pretty heavyweight solution, especially since I need to save the result of the call so it is available later. Does anyone else have this pr

Re: [R-pkg-devel] Alternative to ifeq for Makevars

2024-11-08 Thread Duncan Murdoch
re it does not need to be deleted. Just ignore it in the build (i.e. list it in .Rbuildignore, so it doesn't end up in the tarball, and each system installing the package recreates it). Duncan Murdoch The approach I have now is a cleanup script with only rm -rf src/Makevars. This works *

Re: [R-pkg-devel] new version jumps in minor?

2024-11-04 Thread Duncan Murdoch
with this note? Not all notes trigger a rejection, some (like the maintainer note just above) are just for information. Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R] Invalid term in model formula with gmm after formula.tools is loaded

2024-11-04 Thread Duncan Murdoch
dn't have time to fix the bug. Apparently nobody else has had time either. Another choice is to recognize that there isn't much interest in supporting that package from the author or any of its users, and abandon it. Duncan Murdoch __ R-he

Re: [R-pkg-devel] DESCRIPTION file corrections for accepted package

2024-10-28 Thread Duncan Murdoch
in version 1.2.12. You can get 1.2.14 from Github using this code: , or wait a couple of months until a later version is released on CRAN". I dislike Hadley's x.y.z.9000 scheme. Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R-pkg-devel] DESCRIPTION file corrections for accepted package

2024-10-27 Thread Duncan Murdoch
I don't think R will enforce a 3 part version just because you used it once. You might have other reasons to try to maintain versioning consistency. Duncan Murdoch On 2024-10-27 7:48 a.m., Gianmarco Alberti wrote: Dear Duncan, Thank you for the straightforward guidance. My initial

Re: [R-pkg-devel] DESCRIPTION file corrections for accepted package

2024-10-27 Thread Duncan Murdoch
cepted package, given that incrementing the version number might seem a bit disproportionate? Thank you for your time and assistance. The simplest thing is to just update the version. Use 1.1.1 if you don't want to go to 1.2. Duncan Murdoch _

Re: [R] Help in Recursive Function for steps reconstruction in Clusters Analysis - HCA: Single Link

2024-10-26 Thread Duncan Murdoch
nd( xmd1, xmd2 ) ) ) There may be other places where this change is needed; I haven't tried running your code. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [Rd] Could .Primitive("[") stop forcing R_Visible = TRUE?

2024-10-25 Thread Duncan Murdoch
ax to have side effects. Surely you or they should be the ones to run the test across all of CRAN? Duncan Murdoch On 2024-10-25 6:35 a.m., Ivan Krylov via R-devel wrote: On Thu, 24 Oct 2024 13:23:56 -0400 Toby Hocking wrote: The patch you are proposing to base R is https://github.com/Rdata

Re: [R] OSX-specific Bug in randomForest

2024-10-23 Thread Duncan Murdoch
I've cc'd this to the package maintainer, Andy Liaw . I'm not sure he reads this list. Duncan Murdoch On 2024-10-23 1:26 a.m., Stevie Pederson wrote: Hi, It appears there is an OSX-specific bug in the function `randomForest.default()` Going by the source code at https://

Re: [R] Is there a sexy way ...?

2024-09-27 Thread Duncan Murdoch
sult. However I cannot devise one. Don't you find a for loop's naked display of intention to be sexy? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R-pkg-devel] Rolling Back an Archived Package

2024-09-23 Thread Duncan Murdoch
package would be the CRAN request for updates “no more than every 1–2 months". I think the original package wouldn't have been archived unless it was failing tests and the author didn't address the failures. Duncan Murdoch https://cran.r-project.org/web/packages/polici

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-13 Thread Duncan Murdoch
On 2024-09-13 8:53 a.m., Jonathan Dushoff wrote: Message: 4 Date: Thu, 12 Sep 2024 11:21:02 -0400 From: Duncan Murdoch That's not the correct formula, is it? I think the result should be x * Conj(y) / Mod(y)^2 . Correct, sorry. And thanks. So that would involve * and / , not just

Re: [R] Subject: Re: BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-12 Thread Duncan Murdoch
gets opened up – it might also make sense to calculate x / y using real arithmetic (as x*y / |y|²) That's not the correct formula, is it? I think the result should be x * Conj(y) / Mod(y)^2 . So that would involve * and / , not just real arithmetic. Dunc

[R-SIG-Mac] Bug in reading UTF-16LE file?

2024-09-08 Thread Duncan Murdoch
s Jeff got correct results on several different systems using "UTF-16". Is this a MacOS bug or an R for MacOS bug? Duncan Murdoch ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Re: [R] Reading a txt file from internet

2024-09-08 Thread Duncan Murdoch
spec says to honor the BOM and if there isn't one to assume that it is big-endian data. But in this case there is a BOM so your machine has a buggy decoder? Sounds like it! I did it on a Mac running R 4.4.1. Duncan Murdoch On September 7, 2024 2:43:24 PM PDT, Duncan Murdoch wrote: On

Re: [R] Reading a txt file from internet

2024-09-07 Thread Duncan Murdoch
On 2024-09-07 4:52 p.m., Jeff Newmiller via R-help wrote: When you specify LE in the encoding type, you are logically telling the decoder that you know the two-byte pairs are in little-endian order... which could override whatever the byte-order-mark was indicating. If the BOM indicated big-en

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-06 Thread Duncan Murdoch
flaws need thinking about, and sometimes shouldn't be fixed. On the other hand, I was unable to find documentation saying that the current behaviour is intended, so I could be wrong. Duncan Murdoch On Fri, 6 Sept 2024 at 10:12, Bert Gunter wrote: Perhaps Inf*1i [1] NaN+Infi clarifies wh

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-05 Thread Duncan Murdoch
CxByReal(complex(real=0, imaginary=Inf), 5) # [1] 0+Infi Duncan Murdoch Sincerely, Leonard -------- *From:* Duncan Murdoch *Sent:* Friday, September 6, 2024 12:40 AM *To:* Leo Mada ; r-help@r-project.org *Subject:* Re: [R] BUG:

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-05 Thread Duncan Murdoch
ink this is a bug? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented,

Re: [Rd] Apply .Rbuildignore before copying files in R CMD build

2024-08-29 Thread Duncan Murdoch
On 2024-08-29 3:34 p.m., Gábor Csárdi wrote: On Thu, Aug 29, 2024 at 12:12 AM Duncan Murdoch wrote: [...] I think the reason is simplicity. The build process can add, delete or modify files. You wouldn't want that to happen on the original source files, so R copies the files to a temp

Re: [Rd] Apply .Rbuildignore before copying files in R CMD build

2024-08-28 Thread Duncan Murdoch
. Having an R package that needs so much data that you can't fit two copies of it on your disk is a really unusual situation. I think it will have to be up to you to fix it (by increasing your temp space, or decreasing the size of some of those files, or something else).

Re: [Rd] specials and ::

2024-08-27 Thread Duncan Murdoch
) ~ datavector + strata(inst), data=lung) if a user had a vector named datavector. Duncan Murdoch Terry On 8/27/24 03:38, peter dalgaard wrote: In my view, that's just plain wrong, because strata() is not a function but a special operator in a model formula. Wouldn't i

Re: [Rd] specials and ::

2024-08-26 Thread Duncan Murdoch
On 2024-08-26 12:34 p.m., Duncan Murdoch wrote: On 2024-08-26 10:42 a.m., Therneau, Terry M., Ph.D. via R-devel wrote: The survival package makes significant use of the "specials" argument of terms(), before calling model.frame; it is part of nearly every modeling function. The reaso

Re: [Rd] specials and ::

2024-08-26 Thread Duncan Murdoch
less likely to show up in another package, but it's old code. This isn't on CRAN yet, so I'd be interested in hearing about problems with this approach, or better solutions. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] specials and ::

2024-08-26 Thread Duncan Murdoch
rary() or require()") in functions that could trigger the problems. Duncan Murdoch Would there be a tolerably easy way to make the fit fail loudly on `survival::strata(…)` rather than return the wrong result? On Aug 26, 2024, at 7:42 AM, Therneau, Terry M., Ph.D. via R-devel wrot

Re: [R-pkg-devel] Spell Check with Hunspell on Windows

2024-08-20 Thread Duncan Murdoch
. Were you running R from the command line when aspell() worked? Duncan Murdoch On 2024-08-20 11:51 a.m., Kevin R. Coombes wrote: Hi, This is a follow-up to an earlier question where I asked about R CMD check on Windows to be able to check R packages in a manner closer to the checks on CRAN ma

Re: [R] Terminating a cmd windows from R

2024-08-17 Thread Duncan Murdoch
ell window. Could you show us an example of what you are doing? Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.o

Re: [R] Very strange behavior of 'rep'

2024-08-15 Thread Duncan Murdoch
1, each=n.per.grp*n.tt)) #> [1] 1078 Duncan Murdoch Created on 2024-08-15 with [reprex v2.1.1](https://reprex.tidyverse.org) On 2024-08-15 2:39 p.m., Izmirlian, Grant (NIH/NCI) [E] via R-help wrote: \n<>\n\n \n<< This is very weird. I was running a swarm job on the cluster and it b

Re: [R] Determining the Correct Help List

2024-08-12 Thread Duncan Murdoch
rgl is probably not appropriate on any of the R mailing lists. You could post as an issue on its Github page, or as a question on StackOverflow. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch

Re: [R] If loop

2024-08-09 Thread Duncan Murdoch
equired to be an existing variable in a parent environment. Duncan Murdoch -- Bert On Fri, Aug 9, 2024 at 1:53 AM CALUM POLWART wrote: OK. The fact it's in a function is making things clearer. Are you trying to update the values of an object from within the function, and hav

Re: [Rd] Question about regexp edge case

2024-08-09 Thread Duncan Murdoch
Thanks! I think your suggested additions to the docs are perfect. Duncan Murdoch On 2024-08-09 5:01 a.m., Tomas Kalibera wrote: On 8/1/24 20:55, Duncan Murdoch wrote: Thanks Tomas.  Do note that my original post also mentioned a bug or doc error in the PCRE docs for this regexp:   - perl

Re: [R] Manually calculating values from aov() result

2024-08-07 Thread Duncan Murdoch
Sure, summary(aov(A ~ C, dat)) will give it to you. Duncan Murdoch On 2024-08-07 8:27 a.m., Brian Smith wrote: Hi, Thanks for this information. Is there any way to force R to use Type-1 SS? I think most textbooks use this only. Thanks and regards, On Wed, 7 Aug 2024 at 17:00, Duncan Murdoch

Re: [R] Manually calculating values from aov() result

2024-08-07 Thread Duncan Murdoch
On 2024-08-07 6:06 a.m., Brian Smith wrote: Hi, I have performed ANOVA as below dat = data.frame( 'A' = c(-0.3960025, -0.3492880, -1.5893792, -1.4579074, -4.9214873, -0.8575018, -2.5551363, -0.9366557, -1.4307489, -0.3943704), 'B' = c(2,1,2,2,1,2,2,2,2,2), 'C' = c(0,1,1,1,1,1,1,0,1,1)) summary

Re: [R-pkg-devel] A function in one of my package is now a method in base R

2024-08-03 Thread Duncan Murdoch
also mess up on sort_by( foo, bar, priority ) Duncan Murdoch On 2024-08-03 7:13 a.m., Deepayan Sarkar wrote: I haven't thought about this carefully, but shouldn't this mostly work?   sort_by.est_table <- function(x, y = c("op", "lhs", "rhs"),     obje

Re: [R-pkg-devel] A function in one of my package is now a method in base R

2024-08-02 Thread Duncan Murdoch
here if we specified object explicitly? if (!missing(object) { if (!missing(x)) stop("both x and object specified!") x <- object } # This one is more likely to do something: if (!missing(by)) { if (!missing(y)) stop("both y and by specified!"

Re: [Rd] Question about regexp edge case

2024-08-01 Thread Duncan Murdoch
hould only match the literal string "{,5}"). Duncan On 2024-08-01 6:49 a.m., Tomas Kalibera wrote: On 7/29/24 09:37, Ivan Krylov via R-devel wrote: В Sun, 28 Jul 2024 20:02:21 -0400 Duncan Murdoch пишет: gsub("^([0-9]{,5}).*","\\1","123456789

Re: [R] round and trailing zero

2024-07-29 Thread Duncan Murdoch
ad only one element per column. If you had printed t(haz) you'd get numbers displayed like the second version, where haz[1,] converts that row to a vector. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see http

[Rd] Question about regexp edge case

2024-07-28 Thread Duncan Murdoch
"123456789", because "{,5}" is documented to not be a quantifier, so it should only match the literal string "{,5}"). - Some regexp engines (including Perl and Awk) document that "12345" is correct. Is any of this worth fixing? Duncan Murdoch

Re: [R-pkg-devel] R CMD BATCH plot output

2024-07-28 Thread Duncan Murdoch
f `dev.new()` or `pdf()` called anywhere in the code. Not explicitly, but if you try to call a plot function with no device active, the graphics system will call dev.new(). Duncan Murdoch On Sun, Jul 28, 2024 at 3:44 PM Duncan Murdoch <mailto:murdoch.dun...@gmail.com>> wrote: On

Re: [R-pkg-devel] R CMD BATCH plot output

2024-07-28 Thread Duncan Murdoch
ut will be used in a non-interactive one. Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R-pkg-devel] MSRV on Fedora

2024-07-23 Thread Duncan Murdoch
have done this in your submission comments. I don't think a Fedora failure will cause a submission to be automatically rejected, but the CRAN reviewers may want to know if you have dealt with the error, and you should explain that this is what you've done. Duncan Murdoch On 2024-

Re: [R-SIG-Mac] Installing openssl package in R-devel

2024-07-21 Thread Duncan Murdoch
to disable Homebrew whenever you are compiling something native. Cheers, Simon On 22/07/2024, at 6:28 AM, Duncan Murdoch wrote: Okay, I've figured out the previous issue. The openssl package configure script dies if it doesn't have openssl version 3, while install.libs() provides

Re: [R-SIG-Mac] Installing openssl package in R-devel

2024-07-21 Thread Duncan Murdoch
n(/Users/murdoch/R/R-devel/library/00LOCK-openssl/00new/openssl/libs/openssl.so, 0x0006): symbol not found in flat namespace '_EVP_CIPHER_CTX_get_block_size' Error: loading failed Execution halted ERROR: loading failed * removing ‘/Users/murdoch/R/R-devel/library/openssl’ Any suggestions? D

[R-SIG-Mac] Installing openssl package in R-devel

2024-07-21 Thread Duncan Murdoch
sl config is finding the Homebrew info. Can someone suggest what I need to do to get this to work? Duncan Murdoch ___ R-SIG-Mac mailing list R-SIG-Mac@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Re: [R] Using the pipe, |>, syntax with "names<-"

2024-07-20 Thread Duncan Murdoch
On 2024-07-20 6:02 p.m., Iris Simmons wrote: z <- data.frame(a = 1:3, b = letters[1:3]) z |> names() |> _[2] <- "foo" z That's a great suggestion! Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSU

Re: [R] Using the pipe, |>, syntax with "names<-"

2024-07-20 Thread Duncan Murdoch
I suspect that you would want to define a function which was aware of the limitations of piping to handle this. For example: rename <- function(x, col, newname) { names(x)[col] <- newname x } Then z |> rename(2, "foo") would be fine. Duncan Murdoch On 2024-07-20 4:4

Re: [R-pkg-devel] How to get arbitrary precise inputs from R for an Rcpp package?

2024-07-19 Thread Duncan Murdoch
b.com/wch/r-source/blob/b64422334a8269535718efd9a1f969c94b103056/src/main/gram.y#L2577-L2705 I don't know how much of that you want to replicate, but I suppose handling the weird cases (e.g. 0x1p1) the way R does will make it easier for your users. Duncan Murdoch On 2024-07-18 4:29 p.m., Khue Tran

Re: [R-pkg-devel] How to get arbitrary precise inputs from R for an Rcpp package?

2024-07-19 Thread Duncan Murdoch
# the mathematical fraction 1/10 It seems like mpfr("0.1", 100) works pretty well. I'd assume it does the parsing, rather than parse 0.1 to the closest double, and convert that. Duncan Murdoch ## if you really want that, I'd also recommend truly exact f

[R-pkg-devel] Use of ‘R_InputHandlers’

2024-07-10 Thread Duncan Murdoch
nix/sys-std.c, but I'm not sure which comments. rgl references it from this code: https://github.com/dmurdoch/rgl/blob/fbedc326e291c3ec28a9ccac7d030f04b05edfa3/src/x11lib.cpp#L53-L72 Can anyone tell me whether I can fix this? Duncan Murdoch _

Re: [R-SIG-Mac] Issue installing units package after updating R to 4.4

2024-07-09 Thread Duncan Murdoch
mmend that you install R from CRAN instead, and if necessary follow the instructions on https://mac.r-project.org/bin/ to get extra libs like udunits. Duncan Murdoch On 2024-07-09 7:56 a.m., Jacob Howard Ph.D. wrote: Hello all, I am running the R 4.4 on an M2 mac chip. Since updating R to 4.4 I

Re: [R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-05 Thread Duncan Murdoch
e first place. So if you’re as clever as you can be when you write it, how will you ever debug it?" Duncan Murdoch On 2024-07-05 7:35 a.m., Erez Shomron wrote: Is the following a bug in your opinion? I think so. This works as expected: ``` with(mtcars, plot(wt, mpg, plot.first = { plo

Re: [R-pkg-devel] Is R-Forge dead?

2024-07-01 Thread Duncan Murdoch
to make a contribution to one of them, they are less likely to want to do it. Duncan Murdoch On 2024-07-01 6:04 p.m., Kevin R. Coombes wrote: Hi, I have been maintaining packages in R-Forge for many tears. Last week I sent an email to r-fo...@r-project.org to report problems with the build process.

Re: [R-pkg-devel] Help needed with CRAN check error under MacOS and old-rel

2024-06-30 Thread Duncan Murdoch
I'd fix the "create conditionally, evaluate unconditionally" bug. Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [Rd] \>

2024-06-29 Thread Duncan Murdoch
x27;t single step through a pipe (as far as I know), but with that modification, you can see what you've got at any point. Duncan Murdoch On 2024-06-29 6:57 p.m., Spencer Graves wrote: Hi, Duncan: On 6/29/24 17:24, Duncan Murdoch wrote:   Yes. I'm not yet facile with "|

[Rd] \>

2024-06-29 Thread Duncan Murdoch
rds: x |> f(a = 1) |> g(b = 2) is just g(f(x, a = 1), b = 2) This isn't quite true of the magrittr pipe, but it is exactly true of the base pipe. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] rbind() on zero row matrices is inconsistent

2024-06-26 Thread Duncan Murdoch
nd to it, but the 0xn matrix is unchanged for n > 0. Clearly from the help this is intentional, but is it desirable? Wouldn't it make more sense for NULL to be ignored by rbind() and cbind()? Duncan Murdoch __ R-devel@r-project.org mai

Re: [Rd] SET_TYPEOF no longer allowed, how should I call R from within C?

2024-06-25 Thread Duncan Murdoch
better, the one that comes with the development version of R. Duncan Murdoch As a more comprehensive example of constructing an R call in C code and evaluating, consider the following fragment of printAttributes in src/main/print.c. /* Need to construct a call to print(CAR(a

Re: [R-pkg-devel] Windows binary package not at mirrors

2024-06-23 Thread Duncan Murdoch
which needs compilation? Updating RStudio wouldn't help, that needs an R update, but it seems like a possibly useful suggestion. What would be your suggested wording? Should it depend on R trying to figure out if the current version is old? Duncan Mu

Re: [R-pkg-devel] Windows binary package not at mirrors

2024-06-23 Thread Duncan Murdoch
On 2024-06-23 5:44 a.m., Agner Fog wrote: On 23/06/2024 09.56, Duncan Murdoch wrote: CRAN only builds Windows binaries for the devel version, the current release, and the previous release, so nothing older than 4.3.0 will get it. Thank you. Updating R helped. BTW, I don't think we ne

Re: [R-pkg-devel] Windows binary package not at mirrors

2024-06-23 Thread Duncan Murdoch
On 2024-06-23 2:18 a.m., Agner Fog wrote: On 23/06/2024 00.15, Duncan Murdoch wrote: As far as I know, CRAN doesn't push changes to the mirrors, the mirrors pull changes from CRAN.  So if you are seeing that message, the problem is likely with the mirror you're using.  Which mirr

Re: [R-pkg-devel] Windows binary package not at mirrors

2024-06-22 Thread Duncan Murdoch
irror you're using. Which mirror is that? Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R] plot(aov, which=1) with different labels?

2024-06-20 Thread Duncan Murdoch
your help Plotting an aov object is done by stats:::plot.lm. From the help page ?plot.lm, I think the value that you want to change is the "caption" argument, i.e. plot(my_aov, which=1, ann=FALSE, caption = "Résidus vs Valeurs prédites") title(xlab="Valeur

Re: [R-SIG-Mac] How to workaround RStudio issues

2024-06-18 Thread Duncan Murdoch
d this in rgl's configure script. Duncan Murdoch On 2024-06-15 2:13 p.m., Duncan Murdoch wrote: RStudio is causing problems for rgl builds. In particular, on my M3 system, I have installed the arm64 binaries and tools in /opt/R/arm64/bin as recommended, and builds work fine if I run them

Re: [R] I have Problem using the Pipe Command

2024-06-18 Thread Duncan Murdoch
ith line breaks. This works: 1:10 |> mean() but this fails: 1:10 |> mean() Duncan Murdoch If you don't want to do that, install and load the 'magrittr' package and change |> to %>% everywhere. On 2024-06-18 12:13 p.m., Ogbos Okike wrote: Greetings

[R-SIG-Mac] How to workaround RStudio issues

2024-06-15 Thread Duncan Murdoch
he arm64 files to /opt/R/arm64/bin? - Should I really be doing this, or is my system broken since my /usr/local/bin directory contains things it shouldn't, or should I just tell people to put /opt/R/arm64/bin first in their PATH? Duncan Murdoch __

  1   2   3   4   5   6   7   8   9   10   >