Re: [R] Number changed weirdly when converting to numeric

2025-03-10 Thread Martin Maechler
en a good long term behaviour. and "yes" (nr. 3): I tell everybody that indeed, the speed of the M{1,2,3,4,..} chips is amazing and beating all competition at the moment, *BUT* the cost is decreased accuracy in amazingly many situations. Martin > Cheers, > John Na

Re: [R] Issue with littler vs. R and source()

2025-03-08 Thread Steve Martin via R-help
Hi John, Does it work if you run R CMD r -i FailBill.R? Steve Original Message On 3/7/25 10:45, J C Nash wrote: > I want to use littler (i.e. "r -i ") to run an R script so I can > set up a clickable icon for a program which uses package staplr. > Actually to use staplr t

Re: [R] Weird and changed as.roman() behavior

2025-01-16 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Thu, 16 Jan 2025 12:04:44 +0100 writes: [..] > But there's more: our current help page > https://search.r-project.org/R/refmans/utils/html/roman.html > says >> Only numbe

Re: [R] Weird and changed as.roman() behavior

2025-01-16 Thread Martin Maechler
https://www.rapidtables.com/convert/number/date-to-roman-numerals.html does convert _dates_ up to the year 4999, see, https://www.rapidtables.com/convert/number/date-to-roman-numerals.html?msel=January&dsel=1&year=4999&fmtsel=MM.DD. giving CMXCIX for 4999. Hence, I als

Re: [R] Weird and changed as.roman() behavior

2025-01-15 Thread Martin Maechler
> Jani Välimaa > on Tue, 14 Jan 2025 20:39:19 +0200 writes: > Hello, > I don't know what's changed or how to figure out why as.roman() started > to work different way lately on Mageia Cauldron. Cauldron is the > latest development version of Mageia Linux. > Expect

Re: [R] Extracting specific arguments from "..."

2025-01-08 Thread Martin Maechler
ionary.org/wiki/UTSL "Use The Source, Luke!") instead. Here's the always latest (development / R-devel) source for lm() *and* related functions ... also with comments etc: --> https://svn.r-project.org/R/trunk/src/library/stats/R/lm.R (or you use one of its github mirrors ..) Mar

Re: [R] Weird Behavior of mean

2024-12-13 Thread Martin Maechler
nd Thomas Lumley (about implementing an 'or' of a logical vector) R-help (August 2004) It uses if(isTRUE(na.rm)) and yes, people using T for TRUE are "selber tschuld" (Swiss German for "your fault!") Martin > If you ever see posts from Bert on here

Re: [R] Spreadsheets data

2024-12-05 Thread Martin Møller Skarbiniks Pedersen
ow good do you know R? R contains many functions to read input. Regards Martin __ 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/p

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

2024-11-28 Thread Martin Maechler
[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 also, if like in this example, you are talking about using plot.default() {or something that *cal

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

2024-11-22 Thread Martin Maechler
etc. I had been working quite a lot afterwards to get close to this goal, but there are still parts to do, notably in the "devices space", where *some* platform dependency may seem ok. ==> To answer the OP's question: Yes, there *is* a documentation bug here: All three he

Re: [R] [EXT] Mac ARM for lm() ?

2024-11-15 Thread Martin Maechler
> Andrew Robinson via R-help > on Thu, 14 Nov 2024 12:45:44 + writes: > Not a direct answer but you may find lm.fit worth > experimenting with. Yes, lm.fit() is already faster, and .lm.fit() {added to base R by me, when a similar question was asked years ago ...

Re: [R] Matrix - querying dsCMatrix how to save it

2024-11-11 Thread Martin Maechler
int [1:164107] 0 1 2 3 4 5 6 7 8 9 ... ..@ p : int [1:2001] 0 1 2 3 4 5 6 7 8 9 ... ..@ Dim : int [1:2] 2000 2000 ..@ Dimnames:List of 2 .. ..$ : chr [1:2000] "1" "2" "3" "4" ... .. ..$ : chr [1:2000] "1" "2"

[R] readLines on open connection reads only first write on MacOS

2024-10-28 Thread martin gregory via R-help
. Regards, Martin ## Program to demonstrate the behaviour ## input data rL <- list(paste0("Line ", 1:4), paste0("Line ", 1:3), paste0("Line ", 1:2)) ## create an empty file and open write and read connections to the file close(file("rL.log",open="

Re: [R] OSX-specific Bug in randomForest

2024-10-25 Thread Martin Maechler
erson >> wrote: >> >> sum(rep(1 / 9, 9)) - 1 # [1] 2.220446e-16 But indeed, it *is* a bug *always* to assume that double precision arithmetic is exact be it in R or not (unless you *know* that all the numbers involved are of the form * 2^k ; k in "around&q

Re: [R] Outputting a difftime object in PASTE or AS.CHARACTER is missing the unit + expand the format options?

2024-10-24 Thread Martin Maechler
> Reuver, B de \(epi\) via R-help > on Wed, 23 Oct 2024 08:11:50 + writes: > Hello, > I was working on an R script using the datediff object, to log certain durations in the data processing. > I ran in to the issue that outputing a datediff object using PASTE will le

Re: [R] OSX-specific Bug in randomForest

2024-10-23 Thread Martin Maechler
absolute difference, i.e., if (abs(sum(cutoff) - 1) > .Machine$double.eps || ... and I'd really recommend if (isTRUE(all.equal(1, sum(cutoff))) || Martin Maechler > On 2024-10-23 1:26 a.m., Stevie Pederson wrote: >> Hi, >> >> It appears there

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

2024-09-27 Thread Martin Maechler
nly valid proposition and a very nice one, indeed, was Deepayan's (well, he's "R core", ...) unsplit(x, f) Martin > On 27/09/2024 11:13, Duncan Murdoch wrote: >> On 2024-09-26 11:55 p.m., Rolf Turner wrote: >>> >>> I have (toy example):

Re: [R] Dirichlet kernel requires r to be defined, which is not in the help

2024-09-18 Thread Martin Maechler
t or Fejer kernel. --> I will fix the sources accordingly. Should be in the next released version of R .. thanks to you very much, Samuel! Martin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/

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

2024-09-07 Thread Martin Maechler
th complex numbers as base type It may (or may not, I'm not the expert) be a bit challenging trying to remain back compatible (e.g. with save complex number R objects) and still use C standard complex headers ... But mid to long term I guess that would be the way to go. Martin

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

2024-09-06 Thread Martin Maechler
even if only because the above "overall principle" is predominant and tought very often when teaching R. In this case, I do think we should look into the consequences of indeed distinguishing * * and / from their respective current {1. coerce to complex, 2. use comp

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

2024-09-06 Thread Martin Maechler
st messing with infinities... use atan2() if you don't actually need complex arithmetic. >> >> On September 5, 2024 3:38:33 PM PDT, Bert Gunter wrote: >> >> complex(real = 0, imaginary = Inf) >> >[1] 0+Infi >> > >> >>

Re: [R] effects() extractor for a quantile reqression object: error message

2024-09-06 Thread Martin Maechler
x27;rq.object' help page) and it was "predict" that was meant there, as indeed there is a predict method (actually there are even 3 different predict() methods in package 'quantreg', and they are well documented on the ?predict.qr help page. {OTOH my guess is that there o

Re: [R] fixed set.seed + kmeans output disagree on distinct platforms

2024-09-04 Thread Martin Maechler
o ordering is implied. (Their apparent ordering may differ by platform.) Martin > On Tue, Sep 3, 2024 at 10:24 PM Iago Giné Vázquez wrote: >> Hi all, >> >> I build a dataset processing in the same way the same data in Windows than >> in Linux

Re: [R] If loop

2024-08-10 Thread martin gregory via R-help
> On 9. Aug 2024, at 10:45, CALUM POLWART wrote: > > Or use <<- assignment I think. (I usually return, but return can only > return one object and I think you want two or more > One can return multiple objects by putting them in a list and returni

Re: [R] WDI package commands timing out and not working

2024-08-09 Thread Martin Maechler
> Ivan Krylov via R-help > on Fri, 9 Aug 2024 15:23:58 +0300 writes: > В Thu, 8 Aug 2024 12:43:23 +0530 > Anupam Tyagi пишет: >> In open.connection(con, "rb") : >> URL >> 'https://api.worldbank.org/v2/en/country/OED/indicator/NY.ADJ.NNAT.GN.ZS?format=json&date=1

Re: [R] Automatic Knot selection in Piecewise linear splines

2024-07-16 Thread Martin Maechler
> Anupam Tyagi > on Tue, 9 Jul 2024 16:16:43 +0530 writes: > How can I do automatic knot selection while fitting piecewise linear > splines to two variables x and y? Which package to use to do it simply? I > also want to visualize the splines (and the scatter plot) with a

Re: [R] "--" < 0

2024-06-25 Thread Martin Maechler
> Adrian Dusa > on Tue, 25 Jun 2024 10:56:07 +0300 writes: > Dear R fellows, >> From time to time, just when I thought I knew my R, I get >> bitten by some > small things that reminds one to constantly return to the > basics. > I knew for instance that "-1" <

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

2024-06-19 Thread Martin Maechler
ly think that in June 2024 you (Ogbos) should not run "productively" an R version that is older than May 2021 (where R 4.1.0 was released) : $ R-4.1.0 --version | head 1 R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" $ R-4.1.0 --vanilla -s -e '1:10|>sum()'

[R] Altrep and translations (was " Description of error is untranslated when ....")

2024-05-14 Thread Martin Maechler
de R-core *and* at first just in a separate branch before being merged in to the main (r-devel) branch. OTOH: There may be good reasons for translations lookup being brittle in case of altrep error messages .. and hence left off purposely? Martin -- Martin Maechler ETH Zurich and R Core Te

Re: [R] Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?

2024-05-06 Thread Martin Maechler
y often more efficient, although often requiring a bit more thought than ifelse() [so, if overall efficience is almost entirely your own human time, then using ifelse() may still be a good idea... ] Martin > On Fri, May 3, 2024 at 10:30 AM Marc Girondot wrote: >> Is it what you w

Re: [R] error when trying to install {rgdal} on Windows

2024-04-30 Thread Martin Maechler
on Windows. Note that we *DO NOT WANT* screen shot images, but rather simple cut'n'paste plain text in this mailing list. Best regards, Martin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-23 Thread Martin Maechler
>>>>> Ben Bolker >>>>> on Sun, 21 Apr 2024 10:23:50 -0400 writes: > Also https://cran.r-project.org/package=Oarray (which is older and > hence possibly more stable) also maintained and written by a careful and really good person. I do recommend

Re: [R] Building Packages.

2024-03-21 Thread Martin Maechler
to see that install.packages is not the one from R. --- Concluding from your, Ben's, finding I'd guess that Posit finally decided to move away from this very unfriendly idea of sneakily replacing a base R function ? That would actually give raise to some applause.. Martin >

Re: [R] Building Packages.

2024-03-21 Thread Martin Maechler
ot;) unchanged, makes it harder to see what's going on (but also has less severe consequences; if they kept to the otherwise universal *rule* that the namespace and package must have the same objects apart from those only in the namespace, people would not even have access to R's true

Re: [R] converting MATLAB -> R | element-wise operation

2024-03-01 Thread Martin Maechler
lculations that one (mostly) comes across > in statistical computing. For the rare occasion when this > is not true the sweep() command is provided, typically > remembered once one was bitten by the lack of distinction > between row and column vectors. :) > Cheers,

Re: [R] Packages sometimes don't update, but no error or warning is thrown

2024-02-14 Thread Martin Maechler
ion that > is already installed, hence no update will happen. > Best wishes, > Berwin Yes, thank's a lot, Berwin. Indeed I've raised the fact that RStudio hides R's own install.packages() from the user and uses its own, undocumented one ... this has been

Re: [R] Help

2024-02-04 Thread Martin Møller Skarbiniks Pedersen
3, to=3, main="Normal Distribution") text(0, 0.1, latex2exp::TeX("$R^2 = 0.62$")) Regards Martin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] List of Words in BioWordVec

2024-02-03 Thread Martin Møller Skarbiniks Pedersen
On Fri, Feb 2, 2024, 01:37 TJUN KIAT TEO wrote: > Is there a way to extract list of words in BioWordVec in R > library(text) word_vectors <- textEmbed(texts = NULL, model = 'bioWordVecModel', model_type = 'wordvectors') word_list <- rownames(word_vectors$wordvectors) [[alternative

Re: [R] linear programming in R | limits to what it can do, or my mistake?

2024-01-30 Thread Martin Becker
),diag(4)), c(0,0,0,0,0,1,0,0), c(0,0,0,0,0,0,1,0), c(0,0,0,0,0,0,0,1) ) RHS <- c(640,825,580,925,0,0,0,0,1000,1000,1000) DIR <- c(rep("==",4),rep(">=",3),"=",rep("<=",3)) OBJ <- c(35,55,50,65,0,0,0,0) lp("min",OBJ,LHS,DIR,RHS) Best, Martin

Re: [R] Use of geometric mean .. in good data analysis

2024-01-22 Thread Martin Maechler
etric mean is the "best thing" to do for such positive right-skewed data in the same sense that the log-transform is the best "a priori" transformation for such data -- with the one advantage even that you need to fiddle with zeroes when log-transforming, whereas the geome

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Martin Morgan
h for S3 generics), but rather define a class (e.g., that requires vectors person and value) and implement a corresponding `xtfrm()` method. Have fun with the remainder of the advent! Another Martin From: R-help on behalf of Martin Møller Skarbiniks Pedersen Date: Thursday, December 14, 2023

[R] Suggestion for list - change reply-to

2023-12-14 Thread Martin Møller Skarbiniks Pedersen
also. Any reason to keep it to the original sender? Regards Martin __ 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 http://www.R-project.org/posting

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Martin Møller Skarbiniks Pedersen
))) } } persons <- c("alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliett", "kilo", "lima", &

Re: [R] Sorting based a custom sorting function

2023-12-14 Thread Martin Møller Skarbiniks Pedersen
th(arr) <= 1) { return(arr) } else { pivot <- arr[1] less <- arr[-1][compare_func(arr[-1], pivot) <= 0] greater <- arr[-1][compare_func(arr[-1], pivot) > 0] return(c(quicksort(less, compare_func), pivot, quicksort(greater, compare_func))) } } Regards Marti

[R] Sorting based a custom sorting function

2023-12-14 Thread Martin Møller Skarbiniks Pedersen
e # 1 Bob Medium # 2 Alice Small # 3 Charlie Large In this simple case I can just use an ordered factor but what about the poker hands situation? Regards Martin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch

Re: [R] Convert character date time to R date-time variable.

2023-12-08 Thread Martin Maechler
> Ebert,Timothy Aaron > on Thu, 7 Dec 2023 16:29:09 + writes: > Look at the lubridate package in R. Regards, Tim Absolutely *un*needed here !! - as others mention in this thread. Very simple with base R: > strptime("2020-09-17_00:00:00", format = "%Y-%m-%d_%H:%M:%S") [

Re: [R] Calling Emacs Lisp Code/Function from R

2023-11-10 Thread Martin Gregory via R-help
Hi, if you run a server in your Emacs session you can use emacsclient to send a lisp call to the server. There's an example here: https://emacs.stackexchange.com/questions/54156/how-can-i-query-emacs-from-a-separate-process/54161#54161 Regards, Martin Gregory On 11/10/23 11:18, D

Re: [R] Dependency errors for package pracma

2023-11-09 Thread Martin Maechler
th a CRAN check system that simultaneously runs other package installations and checks. I think you were slightly unlucky in the timing of your package checks/submission. Best regards, Martin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and m

Re: [R] Concordance and Kendall's tau in copula

2023-11-07 Thread Martin Maechler
= 1.4) [1] -7 or look up the formulas for tau() or its inverse 'iTau': > copClayton@tau function (theta) { theta/(theta + 2) } > copClayton@iTau function (tau) { 2 * tau/(1 - tau) } > Best regards, Martin {and yes, consider getting our &#

Re: [R] strptime with +03:00 zone designator

2023-11-06 Thread Martin Maechler
ou try to submit it to R's bugzilla? It's the first time I hear of this "Feature" of the ISO standard, but then I'm not at all a timezone, and even less an ISO standard expert. Best, Martin >> On Mon, 6 Nov 2023 at 13:18, jim holtman >> wrote: &g

Re: [R] Dynamically create a (convenience) function in a package

2023-10-30 Thread Martin Maechler
R-help (January 2007) R> fortunes::fortune(106) If the answer is parse() you should usually rethink the question. -- Thomas Lumley R-help (February 2005) R> Best, Martin > On Mon, Oct 30, 2023, 06:28 Sigbert Klinke > wrote: >> Hi, &

Re: [R] The argument 'eps.Pvalue' of `printCoefmat()`

2023-10-30 Thread Martin Maechler
nerally ... even though we *did* try some changes, but IIRC they all had their flaws and hence were not good enough to warrant a change of code. So, for now, we should at least change that part of the help page -- finally! Martin __ R-help@r-proje

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Martin Maechler
> Jin Li > on Mon, 23 Oct 2023 15:42:14 +1100 writes: > If you are interested in other validation methods (e.g., LOO or n-fold) > with more predictive accuracy measures, the function, glmnetcv, in the spm2 > package can be directly used, and some reproducible examples are

Re: [R] stopping R emails

2023-10-19 Thread Martin Maechler
e the msg copied there before you manage > to unsubscribe. > With condolences, > John Nash >From me, as well. Jim Lemon has been one of the frequent really *friendly* and patient "helpers" to many who have searched for support and help on the R mailing lists (R-h

Re: [R] Confirming MySQL Alive

2023-10-08 Thread Martin Møller Skarbiniks Pedersen
You don't need sudo to run: systemctl status On Sat, Oct 7, 2023, 17:09 Stephen H. Dawson, DSL via R-help < r-help@r-project.org> wrote: > Hi, > > > Getting some data from an older MySQL box. I had an event recently where > the MySQL box went off-line for maintenance without a prior announcement

Re: [R] save() and load(): *prefer* saveRDS() and readRDS()

2023-09-26 Thread Martin Maechler
> Jeff Newmiller via R-help > on Mon, 25 Sep 2023 18:46:02 -0700 writes: > You never created any object in R called irisdataTest. Objects in the global environment have names that are unrelated to the names of files on disk. > The load function modifies an environment to crea

Re: [R] Help with plotting and date-times for climate data

2023-09-15 Thread Martin Møller Skarbiniks Pedersen
Change geom_point(aes(y = tmax_mean, color = "blue")) to geom_point(aes(y = tmax_mean), color = "blue") if you want blue points. aes(color = ) does not set the color of the points. aes(color = ) takes a column (best if it is a factor) and uses that for different colors.

Re: [R] Regarding error in RStudio

2023-09-06 Thread Martin Maechler
utside RStudio, you definitely need to get help from the RStudio community. Hoping that helps some steps further. Best regards, Martin -- Martin Maechler ETH Zurich and R Core team __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] Time out error while connecting to Github repository

2023-09-04 Thread Martin Maechler
> siddharth sahasrabudhe via R-help > on Sun, 3 Sep 2023 09:54:28 +0530 writes: > I want to access the .csv file from my github > repository. While connecting to the Github repository I am > getting the following error: > Error in curl::curl_fetch_memory(file) : Timeo

Re: [R] [Pkg-Collaboratos] BioShapes Almost-Package

2023-09-04 Thread Martin Maechler
fter editing, or you'll lose > all your edits. But this is a good way to get started. > I think for the first few times the comments are really > helpful, but I wouldn't mind a way to suppress them. > Duncan Murdoch Me neither. A new option, not changing the d

Re: [R] [Pkg-Collaboratos] BioShapes Almost-Package

2023-09-04 Thread Martin Maechler
use it only rarely; e.g., together with ESS (Emacs Speaks Statistics) to make the initial creation or sometime a thorough updating the help pages man/*.Rd more convenient). There are different tastes and different work flows for different people. Martin > On September 3, 202

Re: [R] Book Recommendation

2023-08-28 Thread Martin Møller Skarbiniks Pedersen
The SQLite is a good database to use. https://cran.r-project.org/web/packages/RSQLite/vignettes/RSQLite.html On Mon, Aug 28, 2023, 22:12 Stephen H. Dawson, DSL via R-help < r-help@r-project.org> wrote: > > This is an academic course. The effort now is to nail down the former. I > am pushing agai

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-18 Thread Martin Maechler
high desideratum for all scientists and I hope also for all data "wranglers" etc.. Martin -- Martin Maechler ETH Zurich and R Core team > On Wed, Aug 16, 2023 at 8:11 PM Shu Fai Cheung > wrote: >> Hi All, >> >> When addressing an error in

Re: [R] Numerical stability of: 1/(1 - cos(x)) - 2/x^2

2023-08-17 Thread Martin Maechler
>>>>> Leonard Mada >>>>> on Wed, 16 Aug 2023 20:50:52 +0300 writes: > Dear Iris, > Dear Martin, > Thank you very much for your replies. I add a few comments. > 1.) Correct formula > The formula in the Subject Title was corre

Re: [R] Numerical stability of: 1/(1 - cos(x)) - 2/x^2

2023-08-16 Thread Martin Maechler
is 101" and is called "cancellation": Direct evaluation of 1 - cos(x) for small 'x' *cannot* ever be numerically accurate and suffers from cancellation. log(1+x) for small x is slightly more subtle than pure cancellation, but exactly the same reason we introdu

Re: [R] Style guide when using "R" in a title

2023-07-27 Thread Martin Maechler
ld". Using the letter 'R' as are regular word (noun) in a title is perfectly fine. Martin > On Wed, Jul 26, 2023 at 4:01 PM Wadsworth, Spencer G > [STAT] wrote: >> >> Hello, >> >> I am working on a small booklet to be use

Re: [R] change language at console

2023-07-19 Thread Martin Maechler
compatíveis" ru "несовместимые размерности" tr "uyumsuz boyutlar" zh_CN "维度不相配" zh_TW "維度不符合" > (nTrans <- length(unique(txts))) [1] 12 > (not_translated <-

Re: [R] Variable and value labels

2023-07-12 Thread Martin Maechler
> Anupam Tyagi > on Wed, 12 Jul 2023 09:18:55 +0530 writes: > Hello, > is there an easy way to do variable and value labels (for > factor variables) in base-R, without using a package. Yes, there are many. How many help pages (in R , i.e. base-R) did you consult? Very

Re: [R] printCoefmat() and zap.ind

2023-07-07 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Fri, 7 Jul 2023 18:12:24 +0200 writes: >>>>> Shu Fai Cheung >>>>> on Thu, 6 Jul 2023 17:14:27 +0800 writes: >> Hi All, >> I would like to ask two questions about prin

Re: [R] printCoefmat() and zap.ind

2023-07-07 Thread Martin Maechler
992 301.2 <2e-16 *** > #> --- > #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > ``` > However, this solution is not ideal because the numbers > of decimal places of "Estimate"

Re: [R] warnng to an error....

2023-06-19 Thread Martin Maechler
if(... class(x) == "" ..) is almost always (*) bad code. Everyone should learn about inherits() and why sane R code should use that instead. --- *) It may be ok, e.g., when `x` was very expliclitly constructed in the same part of code a bit earlier Martin > THank

Re: [R] error in arfima...

2023-06-09 Thread Martin Maechler
>>>>> akshay kulkarni >>>>> on Mon, 5 Jun 2023 14:11:12 +0000 writes: > Dear Martin, > Sad that the bug is beyond your ken... well, that's not exactly what I tried to say (and I did ask you for more output from your R session and also a

Re: [R] error in arfima...

2023-06-05 Thread Martin Maechler
> Dear Martin, > REgrets to reply this late > I am staring at a conundrum never before encountered in my experience with R: > LYGH[[201]] > [1] 45.40 3.25 6.50 2.15 > > arfima(LYGH[[201]]) > Error in .fdcov(x, fdf$d, h, nar = nar, nma = nm

Re: [R] error in arfima...

2023-06-01 Thread Martin Maechler
wrapper. In other words arfima() calls fracdiff::fracdiff() and the error happens there --- for you, but not for me, if I try to use the same data as you. I see that you must have found that too, because you mentioned View(environment(fracdiff)$.fdcov) Maybe you need to

[R] Asking about R "Security" ..

2023-05-17 Thread Martin Maechler
answered less frequently by volunteers as you, Ivan, for whom we are really very grateful. Martin __ 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 http:

Re: [R] Regex Split?

2023-05-05 Thread Martin Maechler
"w" "o" "; " "t" "h" "r" "e" "e" "!" >> gsub(pattern="[[:<:]]", "#", "One, two; three!", perl=TRUE) > [1] "#One, #two; #three!" [...] [...] Maybe this should

Re: [R] R does not run under latest RStudio

2023-04-06 Thread Martin Morgan
Posit employee. Martin Morgan From: R-help on behalf of Steven Yen Date: Thursday, April 6, 2023 at 3:20 PM To: Uwe Ligges Cc: R-help Mailing List , Steven T. Yen Subject: Re: [R] R does not run under latest RStudio The RStudio list generally does not respond to free version users. I was h

Re: [R] "prob" package alternative

2023-04-06 Thread Martin Maechler
Rtools" (for Windows): ---> https://cran.r-project.org/bin/windows/Rtools/ With best regards, Martin __ 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

Re: [R] lines through points in lattice legend

2023-01-29 Thread martin gregory via R-help
finitely not simpler. Given that your choice of points is so distinctive, why not just use the points in the legend? Regards, Martin > On 28. Jan 2023, at 10:18, Kenneth Knoblauch wrote: > > Hi, > > I'm struggling to find if there is a simple way to make the lines and points >

Re: [R] Flickering when scrolling in R graphics windows

2023-01-24 Thread Martin Maechler
> Ziyun Tang > on Sat, 21 Jan 2023 15:14:15 -0500 writes: > Hello, I have been experiencing some issues regarding scrolling with > the mouse or trackpad in R graphics windows (from the base graphics > package), which sometimes results in flickering, and wanted to see if

Re: [R] Printing special characters

2023-01-16 Thread Martin Maechler
ot;, axes=FALSE, main = "EVENT ≥ 30 sec") Note that help(pdf) contains See Also: pdfFonts, pdf.options, embedFonts, Devices, postscript. cairo_pdf and (on macOS only) quartz for other devices that can produce PDF. More details of font families and

Re: [R] Integer division

2022-12-21 Thread Martin Maechler
> truncating remainder. > On Tue, 20 Dec 2022 at 19:53, Göran Broström > wrote: >> Thanks Richard, >> >> the "rounding claim" was my mistake (as I replied to >> Martin), I should said "truncates toward zero" as you

Re: [R] Integer division

2022-12-19 Thread Martin Maechler
uses the "floored" version, as recommended by Donald Knuth and as documented on the above Wikipedia page. Martin > On December 19, 2022 7:15:01 AM PST, "Göran Broström" > wrote: >> >> >> Den 2022-12-19 kl. 15:41, skrev Martin Maec

Re: [R] Integer division

2022-12-19 Thread Martin Maechler
> Göran Broström > on Mon, 19 Dec 2022 14:22:00 +0100 writes: > I have a long vector x with five-digit codes where the > first digit of each is of special interest, so I extracted > them through >> y <- x %/% 1 > but to my surprise y contained the value -1 in

Re: [R] bgroup not rendering properly

2022-12-13 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Tue, 13 Dec 2022 11:02:23 +0100 writes: >>>>> Jinsong Zhao >>>>> on Tue, 13 Dec 2022 17:07:00 +0800 writes: >> I don Jinsong started on top and I did not see his continuation at th

Re: [R] bgroup not rendering properly

2022-12-13 Thread Martin Maechler
oup.png") # or pdf("bgroup.pdf") expression(bgroup('(',atop(x,y),')') dev.off() the resulting PNG or PDF will look fine, even on Windows in R 4.2.2. Martin >> >> and >> >> library(ggplot2) ggplot(mtcars, aes(wt, mpg

Re: [R] How to access source code

2022-12-08 Thread Martin Morgan
showMethods(LGD, includeDef = TRUE) shows the implementation of all methods on the LGD generic, and can be a useful fast track to getting an overview of what is going on. Martin Morgan From: R-help on behalf of Ivan Krylov Date: Thursday, December 8, 2022 at 11:23 AM To: Christofer Bogaso

Re: [R] if documentation

2022-12-07 Thread Martin Maechler
> PIKAL Petr > on Wed, 7 Dec 2022 07:04:38 + writes: > Hallo all Not sure if it is appropriate place but as I am > not involved in r-devel list I post here. > Documentation for Control (if, for, while, .) is missing > "if else" command. Although it can be find

Re: [R] confusion about dev.prev()

2022-12-06 Thread Martin Maechler
ppens less, .. we'd look at it to add the improvement there. Martin > Peter > On Mon, Dec 5, 2022 at 9:38 PM Ivan Krylov wrote: >> >> В Mon, 5 Dec 2022 21:28:16 +0800 >> Peter Langfelder пишет: >> >> > Open two devices, pl

Re: [R] interval between specific characters in a string...

2022-12-02 Thread Martin Morgan
You could split the string into letters and figure out which ones are �b� which(strsplit(x, "")[[1]] == "b") and then find the difference between each position, �anchoring� at position 0 > diff(c(0, which(strsplit(x, "")[[1]] == "b"))) [1] 2 4 1 6 4 From: R-help on behalf of Evan Cooch Date:

Re: [R] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-18 Thread Martin Maechler
>>>>> Iago >>>>> on Thu, 17 Nov 2022 11:53:31 +0100 writes: > Thank you Martin, > Regarding my question about `terms`, I meant the `terms` component of > the `lme` output. For example, for > fm1 <- lme(distance ~ age, data

Re: [R] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-17 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Thu, 17 Nov 2022 09:16:04 +0100 writes: >>>>> Andrew Simmons >>>>> on Tue, 15 Nov 2022 18:01:55 -0500 writes: >> This seems to be a bug. I tried creating this function in th

Re: [R] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-17 Thread Martin Maechler
onents ‘X’ and ‘terms’ specifying the denominator degrees of freedom for, respectively, t-tests for the individual fixed effects and F-tests for the fixed-effects terms in the models. and I don't think that there needs to be more explanation. (??) Martin

Re: [R] Partition vector of strings into lines of preferred width

2022-10-28 Thread Martin Morgan
> strwrap(text) [1] "What is the best way to split/cut a vector of strings into lines of" [2] "preferred width? I have come up with a simple solution, albeit naive," [3] "as it involves many arithmetic divisions. I have an alternative idea" [4] "which avoids this problem. But I may miss some existi

Re: [R] unexpected 'else' in " else"

2022-10-21 Thread Martin Maechler
than ifelse(Cnd, A, B) whenever it is appropriate, i.e., the condition Cnd is a simple TRUE or FALSE. ifelse() is very much over-used! {For the more sophisticated reader: In R, these both are function calls: `if` is a function of 3 argument with a "peculiar" syntax and the third

Re: [R] Unintended behaviour of stats::time not returning integers for the first cycle

2022-10-19 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Wed, 19 Oct 2022 10:05:31 +0200 writes: >>>>> Andreï V Kostyrka >>>>> on Tue, 18 Oct 2022 16:26:28 +0400 writes: >> Sure, this works, and I was thinking about this solution, but it seem

Re: [R] Unintended behaviour of stats::time not returning integers for the first cycle

2022-10-19 Thread Martin Maechler
I think the correction should only happen when the user asks for it, say by using a new argument 'roundYear = TRUE' (where the default remains roundYear=FALSE). Martin Maechler ETH Zurich and R Core tam > x <- ts(2:252, start = c(2002, 2), freq = 12) > d <- seq.D

Re: [R] Error in if (class(networks) == "matrix") from a function

2022-09-22 Thread Martin Maechler
i.e., I'd try to see if the fast is.matrix(.) applies to your 'networks' (and I'm guessing "yes" with high confidence ..). Martin > HTH, > Eric > On Wed, Sep 21, 2022 at 10:21 PM Chao Liu wrote: >> Dear R-Help community, >&g

Re: [R] Error generated by nlme::gnls

2022-07-28 Thread Martin Maechler
t al. ! This is indeed a very old coding bug triggered by the more strict checks in R 4.2.x. I will indeed try Bill's proposal rather than remaining with deparse by using deparse1(). "Of course", this should hopefully be fixed in the next release of nlme. Martin Maechler ETH

Re: [R] R_LIBS var needed to be set after upgrade to R 4.2.2

2022-06-02 Thread Martin Maechler
wife's computer) mainly because of lazyness as our IT staff helps me solve all problems with Fedora quickly, including lowelevel device-related ones, I think that Debian(+derivatives) has always been the exception among the Linux distros and for all the others, '--vanilla' really mean

  1   2   3   4   5   6   7   8   9   10   >