Re: [R] What exactly is an dgCMatrix-class. There are so many attributes.

2017-10-21 Thread Martin Maechler
applies indeed: In principle all these matrices should work like regular numeric matrices, just faster with less memory foot print if they are really sparse (and not just formally of a sparseMatrix class) ((and there are quite a few more niceties in the package)) Martin Maechler (here, maintainer

Re: [R] nls() and loop

2017-10-21 Thread Martin Maechler
ghtly enhancing the nice model-visualizing plot, you already now get in R when you run example(SSasymp) or example(SSasympOrig) (but unfortunately, they currently use 'lwd = 0' to draw the asymptote which shows fine on a PDF but not on a typical my screen graphics device.) Ma

Re: [R] What exactly is an dgCMatrix-class. There are so many attributes.

2017-10-21 Thread Martin Maechler
Fri, Oct 20, 2017 at 3:22 PM, David Winsemius >> wrote: >> >>> >>> > On Oct 20, 2017, at 11:11 AM, C W wrote: >>> > >>> > Dear R list, >>> > >>> > I came across dgCMatrix. I

Re: [R] What exactly is an dgCMatrix-class. There are so many attributes.

2017-10-21 Thread Martin Maechler
>>>>> David Winsemius >>>>> on Sat, 21 Oct 2017 09:05:38 -0700 writes: >> On Oct 21, 2017, at 7:50 AM, Martin Maechler wrote: >> >>>>>>> C W >>>>>>> on Fri, 20 Oct 2017 15:51:

Re: [R] Syntax for fit.contrast (from package gmodels)

2017-10-23 Thread Martin Maechler
> Sorkin, John > on Sun, 22 Oct 2017 22:56:16 + writes: > David, > Thank you for responding to my post. > Please consider the following output (typeregional is a factor having two levels, "regional" vs. "general"): > Call: > glm(formula = events ~ type, fam

Re: [R] read.table(..., header == FALSE, colClasses = )

2017-10-24 Thread Martin Maechler
ovoke a warning. Once you have read (and understood) the above part of the help page, it becomes, easy, no? > tt <- read.table(textConnection("a 3.14"), colClasses = > c("character","numeric")) > t2 <- read.table(textConnection("a 3.14"), &g

Re: [R] run r script in r-fiddle

2017-10-30 Thread Martin Maechler
> Suzen, Mehmet > on Mon, 30 Oct 2017 11:16:30 +0100 writes: > Hi Frank, You could upload your R source file to a public > URL, for example to github and read via RCurl, as source > do not support https as far as I know. well... but your knowledge is severely (:-) outdat

Re: [R] run r script in r-fiddle

2017-10-31 Thread Martin Maechler
and install a current version of R, and not waste any more bandwidth and R-help readers' time, wouldn't we ? > On 30 October 2017 at 15:51, Martin Maechler > wrote: >>>>>>> Suzen, Mehmet on Mon, 30 Oct 2017 >>>>>>> 11:16:30

Re: [R] run r script in r-fiddle

2017-11-01 Thread Martin Maechler
no_ guarantee for that, and unfortunately I think there's much software there where authors don't care (or don't want) to use a "truly" free software licence such as (*) https://github.com/datacamp/datacamp-light/blob/master/LICENSE.md Best, Martin Maechler > On 31

Re: [R] [R-pkgs] Release of ess 0.0.1

2017-11-10 Thread Martin Maechler
ON file: This package ess is named to match the European Social Survey (ESS). It is unrelated to the Emacs Speaks Statistics (ESS) project, an emacs-based Integrated Development Environment hosted at https://ess.r-project.org and last but not least we have thought of 'reserving' ESSR

Re: [R] ggtern and bquote...

2017-12-04 Thread Martin Maechler
the R syntax for indexing/subsetting is used here, i.e. x[i] for LaTeX x_i Last but not least, if Levent really needs bquote() [i.e. substitute()] then, a final as.expression(.) may be needed : identical(as.expression(quote(a == 1)), expression( a == 1)) # -->

Re: [R] max and pmax of NA and NaN

2018-01-15 Thread Martin Maechler
ode. Note that for these reasons, often NaN and NA should not be differentiated, and that's reason why using is.na(*) is typically sufficient and "best" -- it gives TRUE for both NA and NaN. Martin Maechler ETH Zurich __ R-help@r-project.o

Re: [R] Problem with geterrmessage()

2018-02-23 Thread Martin Maechler
ryCatch() instead of try() and then such things can be done considerably less obscurely. Best, Martin Maechler, ETH Zurich -- *) Using 'T' instead of 'TRUE' (of 'F' instead of 'FALSE' *is* unsafe): a previous 'T <- 0' will change what yo

Re: [R] Possible Improvement to sapply

2018-03-13 Thread Martin Maechler
> $ : int [1:5, 1:2] 2 0 0 0 0 0 2 0 0 0 > $ : int [1:5, 1:2] 3 0 0 0 0 0 3 0 0 0 > Bill Dunlap > TIBCO Software > wdunlap tibco.com<http://tibco.com> Yes, indeed, thank you Bill! I sometimes marvel at how much the mental capacities of R core are underesti

Re: [R] Possible Improvement to sapply

2018-03-14 Thread Martin Maechler
se the above grep from Emacs (via 'M-x grep') or even better via a TAGS table and M-x tags-query-replace I should be able to do the changes pretty quickly... and will start looking into that later today. Interestingly and to my great pleasure, the first part of the 'Sub

Re: [R] Fwd: the same function returning different values when called differently..

2018-03-14 Thread Martin Maechler
between R objects 'obj1' and 'obj2', as all.equal() is generic and has a list method (which works recursively) the "output may be huge, but then if there is huge number of differences you would have found yourself anyway, and will not need all.equal() Martin Maechler ETH Zu

Re: [R] Hacked

2018-04-17 Thread Martin Maechler
uot;mailer daemon" error b) it probably did go to the spammers: a legitimate user would have replied to me. Martin Maechler ETH Zurich (= provider of all the r-*@r-project.org mailman mailing lists) > On Tue, Apr 17, 2018 at 11:37 AM, Ulrik Stervbo

Re: [R] Question "breakdown point" --> robust statistics

2018-04-20 Thread Martin Maechler
be anything (-> arbitrary extreme outliers). There's the CRAN task view on robust statistical methods: https://cran.r-project.org/web/views/Robust.html Martin Maechler ETH Zurich > -- > Olivier Crouzet > Assistant Professor > @LLING UMR6310 - Université de Nan

Re: [R] Error : 'start' contains NA values when fitting frank copula

2018-04-21 Thread Martin Maechler
or the next release of the copula package... but am a bit hesitant to complicate (and slowdown) the current code by adding an extra check for this situation. Martin Maechler ETH Zurich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see ht

Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-02 Thread Martin Maechler
K. Dovik > Bergen, NO yes, indeed, or -- even nicer for a time series: using 'type = "c"' which many people don't know / have forgotten about: ttt <- ts(rpois(12, lambda = 8), start = c(2000, 1), freq = 4) plot (ttt, type = "c") points(ttt, col = ifelse

Re: [R] Converting a list to a data frame

2018-05-03 Thread Martin Maechler
Beautiful use of do.call() and lapply(), two of the most versatile and important functions from the base R toolbox. Congratulations! Martin Maechler R Core Team > -Original Message- > From: R-help On Behalf Of David L Carlson > Sent: Wednesday, May 2, 2018 3:51 PM > To:

Re: [R] Comparing figures?

2018-05-07 Thread Martin Maechler
e pdf(*, compress=FALSE) actually also setting 'encoding=.' and 'paper=.', see the R sources at https://svn.r-project.org/R/trunk/tests/reg-plot.R and the check (source at https://svn.r-project.org/R/trunk/tests/Makefile.common) basically is using R CMD Rdiff .p

Re: [R] par(mfrow=c(3,4)) problem

2018-05-30 Thread Martin Maechler
> Sarah Goslee > on Wed, 30 May 2018 05:03:56 -0400 writes: > Hi, > You're mixing base plot and ggplot2 grid graphics, which as you've > discovered doesn't work. > Here's av strategy that does: > https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html

Re: [R] mysterious rounding digits output

2018-05-30 Thread Martin Maechler
> Ted Harding > on Thu, 31 May 2018 07:10:32 +0100 writes: > Well pointed out, Jim! > It is infortunate that the documentation for options(digits=...) > does not mention that these are *significant digits* > and not *decimal places* (which is what Joshua seems to wan

Re: [R] verInd= and HorInd= arguments to pairs() function

2018-06-07 Thread Martin Maechler
label.pos >text.panel(xlp, ylp, labels[i], cex = cex.labels, > font = font.labels) > } > } > else if (i < j) > localLowerPanel(as.vector(x[, j]), as.vector(x[, > i]), ...) &g

Re: [R] verInd= and HorInd= arguments to pairs() function

2018-06-08 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Thu, 7 Jun 2018 18:35:48 +0200 writes: >>>>> Gerrit Eichner >>>>> on Thu, 7 Jun 2018 09:03:46 +0200 writes: >> Hi, Chris, had the same problem (and first thought it was >> my

Re: [R] verInd= and HorInd= arguments to pairs() function

2018-06-08 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Fri, 8 Jun 2018 11:13:24 +0200 writes: [..] >> Thank you, Chris, for the report and >> Gerrit for your proposed fix !! >> >> It looks good to me, but I will test some more (also

Re: [R] verInd= and HorInd= arguments to pairs() function

2018-06-08 Thread Martin Maechler
>>>>> Gerrit Eichner >>>>> on Fri, 8 Jun 2018 12:55:31 +0200 writes: > Am 08.06.2018 um 12:02 schrieb Martin Maechler: >>>>>>> Martin Maechler >>>>>>> on Fri, 8 Jun 2018 11:13:24 +0200 writes: >

Re: [R] Do there need to be the same number of y-values for each x-value when using tapply?

2018-07-08 Thread Martin Maechler
The answer to your Q is surely a "no": That's exaxtly the point of tapply that the number of y values may vary. The msg tells you that the x & y full vectors must have the same length. Hoping that helps. Martin [[alternative HTML version deleted]]

Re: [R] SQL Database

2018-07-26 Thread Martin Maechler
> Doran, Harold > on Wed, 25 Jul 2018 14:57:13 + writes: > I'm doing some work now to learn which SQL database > package is the most optimal for the task I am working on. Hmm... we would have a problem with optimize() and optim() if this was optimal << more optima

Re: [R] Plot Rect Transparency

2018-07-27 Thread Martin Maechler
> Duncan Murdoch > on Thu, 28 Jun 2018 20:57:19 -0400 writes: > On 28/06/2018 5:29 PM, Jeff Reichman wrote: >> R-Help >> >> >> >> Is there a way to make a rectangle transparent (alpha=0.1??) >> >> >> >> plot(c(100, 200), c(300, 450), type=

Re: [R] Safeguarded Newton method for function minimization

2017-04-19 Thread Martin Maechler
> J C Nash > on Tue, 18 Apr 2017 13:32:52 -0400 writes: > Recently Marie Boehnstedt reported a bug in the nlm() > function for function minimization when both gradient and > hessian are provided. Indeed, on R's Bugzilla here : https://bugs.r-project.org/bugzilla/sh

Re: [R] R-3.4.0 and survival_2.41-3 ..

2017-04-25 Thread Martin Maechler
.y.0") release of R and **not** re-use packages {inside R-x.y.z} that were installed with R-x.(y-1).z' .. and of course Uwe is right: We should ask others to do it _and_ do it ourselves. Anyway it _is_ considerably more important for the 3.4.0 release. Martin Maechler ETH Zurich (and

Re: [R] The effect of tolerance in all.equal()

2017-04-25 Thread Martin Maechler
> Ashim Kapoor > on Tue, 25 Apr 2017 14:02:18 +0530 writes: > Dear all, > I am not able to understand the interplay of absolute vs relative and > tolerance in the use of all.equal > If I want to find out if absolute differences between 2 numbers/vectors are > big

Re: [R] [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Martin Maechler
> Ramnik Bansal > on Sat, 20 May 2017 08:52:55 +0530 writes: > Taking this question further. > If I use a complex number or a numeric as an operand in logical > operations, to me it APPEARS that these two types are first coerced to > LOGICAL internally and then THIS lo

[R] Error in readRDS(dest) (was Re: Error with installed.packages with R 3.4.0 on Windows)

2017-05-23 Thread Martin Maechler
> Patrick Connolly > on Tue, 23 May 2017 20:47:22 +1200 writes: > On Mon, 22-May-2017 at 05:43AM -0400, Martin Morgan wrote: > |> On 05/22/2017 05:10 AM, Patrick Connolly wrote: > |> >Apparently it isn't harmless. > |> > > |> >>install.packages("withr") > |> >

Re: [R] Missing dependencies in pkg installs

2017-06-22 Thread Martin Maechler
> David Winsemius > on Wed, 21 Jun 2017 18:04:13 -0700 writes: >> On Jun 21, 2017, at 1:39 PM, Conklin, Mike (GfK) wrote: >> >> I have a Ubuntu server with an R installation that has 384 packages installed. We are trying to replicate the system on a Red Hat Enterprise

Re: [R] getting error while trying to make dendogram based on gene expression

2017-06-23 Thread Martin Maechler
> Yogesh Gupta > on Wed, 21 Jun 2017 13:42:15 +0900 writes: > I am trying to make dendogram based on gene expression matrix , but getting > some error: > I > countMatrix = read.table("count.row.txt",header=T,sep='\t',check.names=F) > colnames(countMatrix) >

Re: [R] [Rd] setReplaceMethod creates 'object' in the userworkspace

2017-06-27 Thread Martin Maechler
> Jonathan Fritzemeier > on Fri, 23 Jun 2017 16:15:30 +0200 writes: > Hi, > I recognized that the function 'setReplaceMethod' is creating a > character vector in the user workspace having the name (e.g. "newClass") > of the class used as value. If you can sort out a mi

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-18 Thread Martin Maechler
upid. the text file itself >>> is 4GB >>> so cannot upload it to bugzilla, and from the >>> R_AllocStringBugger error >>> in the previous message, i think most or all of it needs to be >>> there to >>> trigger the seg

Re: [R] axis() after image.plot() does not work except if points() is inserted between

2017-07-25 Thread Martin Maechler
arts of the help page, I see that there is a 'graphics.reset' argument which you can set to TRUE in such a case: image.plot(D, col=rev(heat.colors(128)),bty="n", xlab="Lines", ylab="Columns", cex.lab = 0.5, zlim= range(D, na.rm=TRUE),

Re: [R] Superscript and subscrib R for legend x-axis and y-axis and colour different subjects in longitudinal data with different colours

2017-07-31 Thread Martin Maechler
> Hi Rosa > something like > plot(1,1, sub=expression(lambda^"2")) > So with your example, do you want something like > plot(c(1:5), CRP7raw[1,], type = "n", xlim=c(1,5), ylim=c(-10,5) , > xlab="Day in ICU", > ylab="CRP (mg/dL)", > sub = mtext(expression(lambda^2))) OOps! E

Re: [R] Superscript and subscrib R for legend x-axis and y-axis and colour different subjects in longitudinal data with different colours

2017-07-31 Thread Martin Maechler
>>>>> PIKAL Petr >>>>> on Mon, 31 Jul 2017 09:11:18 + writes: > Hi Martin see in line >> -Original Message- From: Martin Maechler >> [mailto:maech...@stat.math.ethz.ch] Sent: Monday, July >> 31, 2017 10:52 A

Re: [R] Generating samples from truncated multivariate Student-t distribution

2017-08-02 Thread Martin Maechler
in your case) >> I am posting plain text here: good .. and please do always on these lists Martin Maechler, ETH Zurich & R Core >> >>> library(tmvtnorm) >>> meann = c(55, 40, 50, 35, 45, 30) >>> covv = matrix(c( 1, 1, 0, 2, -1, -

Re: [R] define a list with names as variables

2017-08-04 Thread Martin Maechler
n package 'stats') just to help people to write more nicely readable code: Your function f() below then becomes a simple one-liner: f <- function(foo, bar) setNames(list(bar), foo) Martin Maechler ETH Zurich and R Core > Giovanni > On Fri, Aug 4, 2017 at 12:13 P

Re: [R] Help creating the IBM Randu function

2017-08-14 Thread Martin Maechler
> Richard M Heiberger > on Mon, 14 Aug 2017 14:36:40 -0400 writes: > Please look at ?datasets::randu > for David Donoho's translation of RANDU into R. Thanks a lot, Rich, for pointing to this: Indeed, the RANDU aka 'randu' data set has been part of R since the last millenn

Re: [R] Fwd: Find maxima of a function

2017-08-29 Thread Martin Maechler
rge-correctly EM algorithm. After install.packages("nor1mix") require("nor1mix") ?norMixMLE Martin Maechler, ETH Zurich > On Sun, 27 Aug 2017 16:01:59 +0300 Ismail SEZEN > wrote: >> Dear Niharika, >> >> As I said before, the

Re: [R] Optimize code to read text-file with digits

2017-09-08 Thread Martin Maechler
> peter dalgaard > on Fri, 8 Sep 2017 16:12:21 +0200 writes: >> On 8 Sep 2017, at 15:51 , Martin Møller Skarbiniks >> Pedersen wrote: >> >> On 8 September 2017 at 14:37, peter dalgaard >> wrote: >>> >>> On 8 Sep 2017, at 14:03 , peter dalgaard

Re: [R] Error messages using nonlinear regression function (nls)

2017-10-20 Thread Martin Maechler
ly, the same source file, /src/library/stats/R/zzzModels.R also defines the SSfpl() == 4-parameter logistic model and there, the 'init' function needs to do the same scaling to (0, 1) and does it much nicer, indeed (anti)symmetrically. I'm looking into using that in SSlogis

Re: [R] Error messages using nonlinear regression function (nls)

2017-10-20 Thread Martin Maechler
> Cheers > Petr >> -Original Message- >> From: Martin Maechler [mailto:maech...@stat.math.ethz.ch] >> Sent: Friday, October 20, 2017 1:04 PM >> To: PIKAL Petr >> Cc: Wall, Wade A ERDC-RDE-CERL-IL CIV ; r-

Re: [R] x-axis tick marks on log scale plot

2016-05-20 Thread Martin Maechler
> Brian Smith > on Thu, 19 May 2016 11:04:55 -0400 writes: > Thanks all !! On Thu, May 19, 2016 at 9:55 AM, Ivan > Calandra wrote: >> Hi, >> >> You can do it by first plotting your values without the >> x-axis: plot(x,y,log="xy", xaxt="n") >> >> an

Re: [R] if else condition - help

2016-05-23 Thread Martin Maechler
der of magnitudes better, and - for the simple case you were shown to use logical indexing, i.e., calls à lax[x > k] <- .. In summary: Use ifelse() much less -- notably if writing functions/code which should scale ! Martin Maechler ETH Zurich

Re: [R] asking for large memory - crash running rterm.exe on windows

2016-05-28 Thread Martin Maechler
> Ben Bolker > on Sat, 28 May 2016 15:42:45 + writes: > Anthony Damico gmail.com> writes: >> >> hi, here's a minimal reproducible example that crashes my >> R 3.3.0 console on a powerful windows server. below the >> example, i've put the error (not crash) th

Re: [R] Getting Rid of NaN in ts Object

2016-05-28 Thread Martin Maechler
> Perfect! > Exactly what I was looking for. > Thanks > Lorenzo > On Fri, May 27, 2016 at 01:50:03PM +0200, Christian Brandstätter wrote: >> Hi Lorenzo, >> >> Try: >> >> tt[is.nan(tt)] <- NA >> tt <- na.omit(tt) >> or simply na.omit(tt) as it omits both NA and NaN (and *does* keep the 'ts'

Re: [R] Making an if condition variable ?

2016-06-01 Thread Martin Maechler
> Jim Lemon > on Thu, 2 Jun 2016 13:03:01 +1000 writes: > Hi ce, > a<-10 > condition<-expression("a>0") > if(eval(parse(text=condition))) cat("a>0\n") While this may answer the question asked, the above is *not* good advice, excuse me, Jim : > fortune(106) If the a

Re: [R] stats package

2016-06-03 Thread Martin Maechler
;)) [1] "base" "compiler" "datasets" "graphics" "grDevices" "grid" [7] "methods" "parallel" "splines" "stats" "stats4""

Re: [R] Install R version 3.3 on Debian server

2016-07-18 Thread Martin Maechler
has sections about this, notably https://cloud.r-project.org/bin/linux/debian/ will tell you how to tell your debian system to get R from CRAN as opposed from the debian repositories. > Thanks in advance You are welcome, Martin Maechler > Sincelerly, > Mbr

Re: [R] ... distribution based on mean values and quantiles in R?

2016-07-19 Thread Martin Maechler
se: to fit very skewed distributions, given two quantiles and the mean only, and the approach taken by the "poweRlawyers", namely to minimize the KS (Kolmogorov-Smirnoff) decrepancy seems a good start to me. Martin Maechler, ETH Zurich > Jim > On Tue, Jul 19, 2016 a

Re: [R] readline issue with 3.3.1

2016-07-21 Thread Martin Maechler
orted when R was compiled against readline >= 6.0 (Ctrl-G always worked). (PR#16603) So we had hoped that change (fixing a bug you *should* have been able to see with readline 6.2, as well) would work correctly in all versions of readline >= 6.0, but evidently it did not in yours. M

Re: [R] C/C++/Fortran Rolling Window Regressions

2016-07-21 Thread Martin Maechler
ry reliable implementations (based on QR) indeed. For a year or so now, there's the bare bone .lm.fit() which is even one order of magnitued factor faster than lm.fit() at least for simple cases, see the final example on the ?.lm.fit help page. Martin Maechler (who had added .lm.fit() to R )

Re: [R] readline issue with 3.3.1

2016-07-24 Thread Martin Maechler
>>>>> Ralf Goertz >>>>> on Fri, 22 Jul 2016 10:15:36 +0200 writes: > Am Thu, 21 Jul 2016 18:07:43 +0200 schrieb Martin Maechler > : >> Ralf Goertz on Wed, 20 Jul 2016 >> 16:37:53 +0200 writes: >>> I install

Re: [R] Estimators for non-normal data

2016-07-25 Thread Martin Maechler
Multivariate Analysis' - for more specific help and expertise, I strongly recommend the dedicated R-SIG-robust mailing list (instead of R-help), --> https://stat.ethz.ch/mailman/listinfo/r-sig-robust Best regards, Martin Maechler, ETH Zurich > [[alternative HTML v

Re: [R] lm() silently drops NAs

2016-07-26 Thread Martin Maechler
of the CRAN packages and some of the "teaching setups" would do that (and if you do that, the lm() and t.test() calls above give an error). Of course, there's much more to say about this, quite a bit of which has been published in scientific papers and books.. Martin Maechler

Re: [R] lm() silently drops NAs

2016-07-30 Thread Martin Maechler
>>>>> peter dalgaard >>>>> on Tue, 26 Jul 2016 23:30:31 +0200 writes: >> On 26 Jul 2016, at 22:26 , Hadley Wickham >> wrote: >> >> On Tue, Jul 26, 2016 at 3:24 AM, Martin Maechler >> wrote: >>

Re: [R] No "number of days" format for 'difftime'?

2016-08-08 Thread Martin Maechler
> Loris Bennett > on Mon, 8 Aug 2016 14:12:47 +0200 writes: > Loris Bennett writes: >> Thanks for the link, John. However, there is a hyphen missing. It >> should be: >> >> http://www.dummies.com/how-to/content/how-to-read-errors-and-warnings-in-r.html >>

[R] Diethelm Wuertz (founder 'Rmetrics')

2016-08-10 Thread Martin Maechler
y leave their son, Fabian, and their daughter-in-law Viktoria. Our thoughts are with them. Sincerely, Martin Maechler, ETH Zurich (Seminar for Statistics) Adrian Trapletti, Uster Metrics __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] Error while fitting gumbel copula

2016-08-10 Thread Martin Maechler
here http://bit.ly/MRE_R (nice to remember: MRE = Minimal Reproducible Example) or here http://adv-r.had.co.nz/Reproducibility.html then we will be glad to help you, notably I as maintainer of the package 'copula' which you are using (without saying so). With regards, Martin Maechler

Re: [R] Error while fitting gumbel copula

2016-08-23 Thread Martin Maechler
16 at 4:28 PM, Isaudin Ismail > wrote: >> Dear Dr. Martin, >> >> I'm glad that you replied to my queries. >> >> As advised, I have prepared the following: MM: I'm including (cut'n'pasting) my commented and augmented version he

Re: [R] loading .rda file

2016-08-30 Thread Martin Maechler
> Jeff Newmiller > on Tue, 30 Aug 2016 09:36:05 -0700 writes: > You cannot. However, you can load the file into a dedicated environment to keep those names separated from your global environment. e.g. [1] yes, that's my "famous" only-allowed use of attach() : attach() an rda-f

Re: [R] Fitting Mixture distributions

2016-09-08 Thread Martin Maechler
arting value': The help page shows how to use kmeans() for "somewhat" reliable starts; alternatively, I'd recommend using cluster::pam() to get a start there. I'm glad to hear about experiences using these / comparing these with other approaches. Martin -- Martin Maechle

Re: [R] Have help list filters changed recently

2016-09-09 Thread Martin Maechler
> Marc Schwartz > on Thu, 8 Sep 2016 22:29:38 -0500 writes: >> On Sep 8, 2016, at 7:35 PM, Bert Gunter wrote: >> >> To all: >> >> r-help has been holding up a lot of my recent messages: Have there >> been any changes to help list filters that caused this? Is

Re: [R] about data problem

2016-09-21 Thread Martin Maechler
> Joe Ceradini > on Tue, 20 Sep 2016 17:06:17 -0600 writes: > read.csv("your_data.csv", stringsAsFactors=FALSE) > (I'm just reiterating Jianling said...) If you do not have very many columns, and want to become more efficient and knowledgeable, I strongly recommend alternativ

Re: [R] "R": Redefine default parameter values for help.start()

2015-04-17 Thread Martin Maechler
> paul > on Thu, 16 Apr 2015 18:58:12 + writes: > Because of the setup of R in cygwin, help.start() requires > the following parameter values: > help.start(browser="cygstart",remote=R.home()) > Is it possible to make these values the default? You are building R

Re: [R] list server problem?

2015-04-20 Thread Martin Maechler
er behavior: If an e-mail "may have been lost", rather send it again. As some say: Better error on the safe side. Martin Maechler ETH Zurich > Thanks! > Ivan > -- > Ivan Calandra, ATER > University of Reims Champagne-Ardenne > 51100 Reims, France

Re: [R] How numerical data is stored inside ts time series objects

2015-04-22 Thread Martin Maechler
> Paul > on Wed, 22 Apr 2015 01:39:16 + writes: > William Dunlap tibco.com> writes: >> Use the str() function to see the internal structure of most >> objects. In your case it would show something like: >> >> > Data <- data.frame(theData=round(sin(1:38),1))

Re: [R] cbind question, please

2015-04-24 Thread Martin Maechler
> Steve Taylor > on Thu, 23 Apr 2015 23:32:00 + writes: > This works for me... > get0 = function(x) get(x,pos=1) > sapply(big.char, get0) Note that get0() is a _ somewhat important for efficient code _ new function since R 3.2.0 so you'd rather call your functions di

Re: [R] does segfault mean (always) a bug?

2015-05-06 Thread Martin Maechler
namely directly call .C(), .Fortran(), .Call() or similar (.Internal(), .External(),..) it is typically easy to trigger segfaults, and then the bug is in the user's R code. Variations of the above involve using the inline package, or other interfaces to C/C++/... code, libraries, etc: The bug ma

Re: [R] Transformation of the circular variable into linear variable

2015-05-06 Thread Martin Maechler
details to you, and many such e-mail interfaces behaving like Windows programs, that e-mail software may choose the MIME type (it uses for the attachments it puts into the e-mail it sends in your behalf) depending on the file extension. So, from the naive user's point of view with his only e-mail

Re: [R] does segfault mean (always) a bug?

2015-05-06 Thread Martin Maechler
you ask for help here or another public forum. (I would also think it to be polite to the maintainer who has volunteered her/his code to be used by you if you give him an opportunity to see, comment and fix the problem) Martin Maechler ETH Zurich __ R-

Re: [R] does segfault mean (always) a bug?

2015-05-08 Thread Martin Maechler
r. With thanks to Bill and Pavel, Martin Maechler ETH Zurich > I made the file KE.rda containing the Matrix objects K and > E constructed in calc.diffusion.kernel by adding a save() > call just before where R dies in the original example: > K = lam$values[1] * I - M &g

Re: [R] package implementing continuous binomial?

2015-05-08 Thread Martin Maechler
ght make some of the coding of the pdf and cdf more simple. Well. To: David Winsemius Subject: Re: [R] package implementing continuous binomial? In-Reply-To: <5425134b-6aa1-4246-bcd4-d4be4be23...@comcast.net> References: <554ac75a.8070...@gmail.com> <5425134b-6aa1-4246-bcd

[R] The R Foundation announces new mailing list 'R-package-devel'

2015-05-21 Thread Martin Maechler
f the list on R-devel, archived at https://stat.ethz.ch/pipermail/r-devel/2015-May/071208.html For the R foundation, Martin Maechler, Secretary General ___ r-annou...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-ann

Re: [R] S4 / operator "[" : Compatibility issue between lme4 and kml

2015-06-05 Thread Martin Maechler
e result follows. Dear Christophe, can you please specify the exact sessionInfo() ? (after loading both kml and lme4). 'Matrix' has been updated on CRAN very recently, and 'lme4' is about to be update very soon, so this *is* a somewhat interesting and important problem,

Re: [R] S4 / operator "[" : Compatibility issue between lme4 and kml

2015-06-05 Thread Martin Maechler
>>>>> Martin Maechler >>>>> on Fri, 5 Jun 2015 11:33:46 +0200 writes: >>>>> Christophe Genolini >>>>> on Fri, 5 Jun 2015 00:36:42 -0700 writes: >> Hi all, >> There is a compatibility issue between the p

Re: [R] is.na for S4 object

2015-06-05 Thread Martin Maechler
> Martin Morgan > on Thu, 4 Jun 2015 10:33:37 -0700 writes: > On 06/04/2015 10:08 AM, cgenolin wrote: >> Hi the list, >> >> I have a variable y that is either NA or some S4 object. I would like to >> know in which case I am, but it seems taht is.na does not work w

Re: [R] S4 / operator "[" : Compatibility issue between lme4 and kml

2015-06-05 Thread Martin Maechler
> Christophe Genolini > on Fri, 5 Jun 2015 00:36:42 -0700 writes: > Hi all, > There is a compatibility issue between the package 'lme4' and my package > 'kml'. I define the "[" operator. It works just fine in my package (1). If I > try to use the lme4 package, then it

Re: [R] mismatch between match and unique causing ecdf (well, approxfun) to fail

2015-06-08 Thread Martin Maechler
means you are sure that your data frame only contains "classical numbers" (no factors, no 'Date's, no...). In such a case, transform your data frame to a numerical matrix *once* preferably using data.matrix() instead of just as.matrix() but in this case it should not matter. The

Re: [R] 'class(.) == **' [was 'Call to a function']

2015-06-24 Thread Martin Maechler
7;!=" or %in% ...) in too many places; though it may work fine in your test cases, it is wrong to be used in generality e.g. inside a function you provide for more general use, and is best replaced with the use of inherits() / is() everywhere "out of principle". Martin Maechler ET

Re: [R] : Ramanujan and the accuracy of floating point computations - using Rmpfr in R

2015-07-14 Thread Martin Maechler
n, and only then start evaluating "the arithmetic". But that *does* look like implementation of Maple/Mathematica/... in R and that seems silly; rather R should interface to Free (as in "speech") aka "open source" symbolic math packages such as Pari, ma

Re: [R] indices of mismatch element in two vector with missing values

2015-07-29 Thread Martin Maechler
ays works: x == y & is.na(x) == is.na(y) seq(x)[!(x == y & is.na(x) == is.na(y))] With output : > x <- c(NA, 1:7) > y <- c(11:17, NA) > ## now this > seq(x)[ - which(x == y) ] ## gives not what you expect integer(0) > ## But logical indexing always

Re: [R] How to have NLME return when convergence not reached

2014-12-03 Thread Martin Maechler
ducible example. If OTOH, it is your nonlinear function that "goes haywire", the implicit blame on nlme would not be warranted. Martin Maechler, ETH Zurich and R Core team > On Tue, Dec 2, 2014 at 1:59 PM, Ramiro Barrantes > wrote: >> Thanks so much for your re

[R] The R Foundation - New board

2014-12-16 Thread Martin Maechler
only made possible by the dedicated work of many thousands of volunteers and their contributions in several ways, including to become supporting (or ++) members of the R foundation! Martin Maechler ___ r-annou...@r-project.org mailing list https://stat.ethz.

[R] Do NOT use ifelse() if you can use if(.) else . [was "Checking .."]

2014-12-23 Thread Martin Maechler
expr min lq mean median uq max neval cld r1 <- ifelse(z > 3, x, y) 4466 4971.5 5498.928 5244 5673.5 31705 1000 b r2 <- if (z > 3) x else y 171 212.0 265.241264 291.0 3130 1000 a > i.e., roughly a factor of 20 times mo

Re: [R] Links to vignettes in the base packages

2015-01-14 Thread Martin Maechler
t.ethz.ch/R-manual/ (which I think is one of the oldest still working R related "web pages" ... and yes, it shows its age :-) > If not, is it feasible to make them available? The drawback of the above is that you see the future versions of the manuals and I agree that it

Re: [R] two-sample KS test: data becomes significantly different after normalization

2015-01-14 Thread Martin Maechler
> Monnand > on Wed, 14 Jan 2015 07:17:02 + writes: > I know this must be a wrong method, but I cannot help to ask: Can I only > use the p-value from KS test, saying if p-value is greater than \beta, then > two samples are from the same distribution. If the definition

Re: [R] sparse matrix from vector outer product

2015-01-15 Thread Martin Maechler
> Philipp A > on Wed, 14 Jan 2015 14:02:40 + writes: > Hi, > creating a matrix from two vectors a, b by multiplying each combination can > be done e.g. via > a %*% t(b) > or via > outer(a, b) # default for third argument is '*' really the best (most e

Re: [R] "Negative length vectors are not allowed" error

2015-01-20 Thread Martin Maechler
rmultinom(), rnorm(), ...] so we, the maintainer of 'arules' Michael Hahsler (BCC'ed: use maintainer("arules") to find such an e-mail address), and myself can look if and how that limitation might be lifted. Best regards, Martin Maechler, ETH Zurich __

Re: [R] Re-order levels of a categorical (factor) variable

2015-01-22 Thread Martin Maechler
does *not* work... (as I first thought). However, slightly shorter and easier and maybe even easier to remember than z$x <- factor(as.character(z$x), levels = c(levels(z$x)[3:1])) ## def. level order is z$x <- factor(z$x, levels = levels(z$x)[3:1]) ## def. level order Martin Maec

Re: [R] Sum function and missing values --- need to mimic SAS sum function

2015-01-26 Thread Martin Maechler
> Jim Lemon > on Mon, 26 Jan 2015 11:21:03 +1100 writes: > Hi Allen, How about this: > sum_w_NA<-function(x) ifelse(all(is.na(x)),NA,sum(x,na.rm=TRUE)) Excuse, Jim, but that's yet another "horrible misuse of ifelse()" John Fox's reply *did* contain the "proper" solution

Re: [R] the less-than-minus gotcha

2015-02-02 Thread Martin Maechler
> All the more reason to use = instead of <- Definitely not! (As you were told, there are other drawbacks). R does not have to look like C, it *is* different in many ways. If you use a decent IDE for R, you get spaces around ' <- ' for free: Both in ESS and in Rstudio, you can use "[Alt] -"

  1   2   3   4   5   6   7   8   9   >