Re: [R] install R in relative path

2016-10-19 Thread Martin Maechler
.0, R-3.0.1, ..., R-3.2.5 R-3.3.0 R-3.3.1 all in my PATH and all via symbolic links (and ESS = Emacs Speaks Statistics finds all these automagically, so I can each start easily from within Emacs). Martin Maechler ETH Zurich >  The reason I need to do this is to > send R along to

Re: [R] cdf in R give probability of random variable

2016-10-22 Thread Martin Maechler
>> barplot(px) > Um, unless of course you want the cdf as a step function, > in which case check the help page for plot for possible > values of the type= argument. and if it is not homework, (or even then ;-) just use plot(ecdf(x)) Martin Maechler, ETH

Re: [R] Rmpfr into data.frame

2016-11-07 Thread Martin Maechler
TRUE > identical(asNumeric(Pi), as.numeric(Pi)) [1] TRUE > and your case data.frame(a=as.numeric(a), b=as.numeric(b)) As author and maintainer of Rmpfr, I'm curious why you'd be interested to use high-precision numbers in plots, because even double precision is usually far from bein

Re: [R] Dealing with -Inf in a maximisation problem.

2016-11-07 Thread Martin Maechler
> William Dunlap via R-help > on Sun, 6 Nov 2016 20:53:17 -0800 writes: > Perhaps the C function Rf_logspace_sum(double *x, int n) would help in > computing log(b). It computes log(sum(exp(x_i))) for i in 1..n, avoiding > unnecessary under- and overflow. Indeed! I had t

Re: [R] using conditionals to select rows in data.table

2016-11-22 Thread Martin Maechler
Dear Carl, this came through fine, as text only ... but then I did not see any question anymore. Best regards, Martin Maechler (R core and mailing list "operator") >>>>> Carl Sutton via R-help >>>>> on Tue, 22 Nov 2016 05:38:49 + writes:

Re: [R] Log plus one transformation in R

2016-12-12 Thread Martin Maechler
> Faradj Koliev > on Mon, 12 Dec 2016 17:23:20 +0100 writes: > Hi all, How do I perform log(x+1) in R? > log1p_trans() from the package ”scales" doesn’t seem to > work for me. amazing that you did not find log1p() in base R. ___

Re: [R] R studio Problem

2016-12-15 Thread Martin Maechler
> Amelia Marsh via R-help > on Thu, 15 Dec 2016 08:05:44 + writes: > Sorry Mr Gunter. I didn't realize it. > Regards > Amelia In this case, however, it was only the 'Subject' of Amelia's posting and her own "feeling about" the problem which were wrong: As K. Elo's h

[R] Tomas Kalibera joins the R core team

2016-12-22 Thread Martin Maechler
the R Foundation in early November, https://stat.ethz.ch/pipermail/r-announce/2016/000609.html For the R core team, Martin Maechler, ETH Zurich ___ r-annou...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-ann

Re: [R] histogram first bar wrong position

2016-12-22 Thread Martin Maechler
discrete integer data. N <- rpois(100, 5) plot(table(N), lwd = 4) Histograms should be only be used for continuous data (or discrete data with "many" possible values). It's a pain to see them so often "misused" for data like the 'N' above. Martin

Re: [R] histogram first bar wrong position

2016-12-23 Thread Martin Maechler
computed the data for a histogram yourself already; so I personally would again prefer not to use hist(), but to write my own "3 line" function that returns an "histogram" object which I'd call plot(.) on. So, maybe providing such a short function maybe useful,

Re: [R] Problem installing R 2.12.1 on Mac OS X Yosemite 10.10.5

2017-01-12 Thread Martin Maechler
> David Winsemius > on Wed, 11 Jan 2017 22:45:38 -0800 writes: >> On Jan 11, 2017, at 10:20 PM, David Winsemius wrote: >> >> >>> On Jan 11, 2017, at 4:15 PM, Florence Lui wrote: >>> >>> I'm trying to download version 2.12.1 of R in order for it to be com

Re: [R] runmed {stat}

2017-01-23 Thread Martin Maechler
tically there are as many odd numbers as integers, so odd numbers should be sufficient ;-) ;-)) Martin Maechler ETH Zurich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] graphical behavior of a table of numbers

2017-01-30 Thread Martin Maechler
> Duncan Murdoch > on Sun, 29 Jan 2017 06:32:27 -0500 writes: > On 29/01/2017 12:05 AM, Jim Lemon wrote: >> Hi Richard, I think there may be something amiss in the >> plot.table function. As you note, changing the class of >> fr to array produces a more sensible plot,

Re: [R] graphical behavior of a table of numbers

2017-01-30 Thread Martin Maechler
uld > ## be less appropriate for the following example. > ## The current behavior of Axis.table makes sense in this example > tt <- as.table(array(c(10,20,30), dimnames=list(c(100, 120, 200 > tt > plot(tt) Indeed. I doubt we would want to change Axis.table(

Re: [R] RStudio: Place for Storing Options

2017-02-09 Thread Martin Maechler
ce. We would like to be able to *save*, or sometimes *set* / *reset* such options "in a scripted manner", e.g. for controlled exam sessions. Martin Maechler, ETH Zurich > On Thu, 9 Feb 2017 at 12:35 wrote: >> Hi All, >> I would like to make a backup of my

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-20 Thread Martin Maechler
> Hervé Pagès > on Tue, 14 Feb 2017 17:10:05 -0800 writes: > Hi, tapply() will work on any object 'X' that has a length > and supports single-bracket subsetting. These objects are > sometimes called "vector-like" objects. Atomic vectors, > lists, S4 objects with a "len

[R] R scripts attached to e-mails - correct MIME type ?!

2017-02-20 Thread Martin Maechler
use something you could translate as "unknown binary format" as type for their attachments if they can't guess the correct file type from the file extension. It would be interesting to know (for me) if there are modern e-mail programs / web apps which you could *teach* about the mime t

Re: [R] R scripts attached to e-mails - correct MIME type ?!

2017-02-21 Thread Martin Maechler
> peter dalgaard > on Mon, 20 Feb 2017 19:45:18 +0100 writes: > Not by the mail server as such, no, at least not for that > reason. However, T-bird likely sends .txt as text/plain > and .R as application/octet-stream (or so) and _therefore_ > the server eliminates the

Re: [R] RStudio: Place for Storing Options

2017-02-22 Thread Martin Maechler
Jeff! And for the archives: On reasonable OS's, the hidden directory/folder containing all the info is ~/.rstudio-desktop/ and if "things are broken" the recommendation is to rename that mv ~/.rstudio-desktop ~/backup-rstudio-desktop and (zip and) send along with

Re: [R] Reading S-plus data in R

2017-02-27 Thread Martin Maechler
> Richard M Heiberger > on Sun, 26 Feb 2017 15:46:07 -0500 writes: > Bill, > this looks good. Can you add it to the splus2R package? Well, the natural place would rather be the foreign package, and some of use R core members would be happy with maintaining a function with

Re: [R] Principal Coordinate Analysis of unweighted UniFrac distances on R

2017-03-14 Thread Martin Maechler
*PLEASE* do spell it correctly : "principal", *NOT* 'principle' (I've corrected it in the 'Subject' as I don't want to create another google hit for the wrong spelling ...) Martin Maechler __ R-help@r-project.org

Re: [R] Quantiles with ordered categories

2017-03-16 Thread Martin Maechler
quot; you now get "'type' must be 1 or 3 for ordered factors" > It is probably a little thing to fix, but I lack the skills to do this myself. (Really? -- After seeing the change you will agree it was easy .. ?) Thank you for the suggestion. Best regards,

Re: [R] Why is options(digits = 1) displays two digits?

2017-03-21 Thread Martin Maechler
> Gerrit Eichner > on Tue, 21 Mar 2017 10:45:13 +0100 writes: > Hi, Tal, > in print.default it says: > digits: > a non-null value for digits specifies the __minimum__ > number of __significant__ digits to be printed in values. > Maybe this clarifies your obs

Re: [R] R logo

2008-07-16 Thread Martin Maechler
> shadow. I would like to make something closed with some CG> other letters. Does anyone know how to get a similar CG> result ? If we knew an elegant one, we'd have an R function to do it ... The R Logo was done "manually" (using software) in several phases IIRC. B

Re: [R] negative P-values with shapiro.test

2008-07-16 Thread Martin Maechler
pl.Stat 31, p115-124] clearly states that X(1) < X(2) < X(3) ... < X(n) i.e., does not allow "ties" (two equal values). If the exact formula in the paper were evaluated exactly (instead with a rounded value of about 6 digits), the "exact P-value" would be exa

Re: [R] negative P-values with shapiro.test

2008-07-17 Thread Martin Maechler
>>>>> "MM" == Martin Maechler <[EMAIL PROTECTED]> >>>>> on Wed, 16 Jul 2008 18:02:47 +0200 writes: >>>>> "MC" == Mark Cowley <[EMAIL PROTECTED]> >>>>> on Wed, 16 Jul 2008 15:32:30 +1000 writes:

Re: [R] probleme with R CMD check

2008-07-18 Thread Martin Maechler
> "CG" == Christophe Genolini <[EMAIL PROTECTED]> > on Fri, 18 Jul 2008 11:14:25 +0200 writes: CG> Hi the list, CG> Back on an old problem. I thaught that was ok, but it is still not CG> working on my computer. CG> I write a toy package called packClassic. R CMD build

Re: [R] asp and ylim

2008-07-21 Thread Martin Maechler
> "DE" == David Epstein <[EMAIL PROTECTED]> > on Mon, 21 Jul 2008 09:42:35 +0100 writes: DE> Maybe what I am missing is how to set the "device DE> region" mentioned in Brian's email. Play around resizing your graphics window.. This is very instructive, with an 'asp = .' using

Re: [R] drawing segments through points with pch=1

2008-07-21 Thread Martin Maechler
> "DE" == David Epstein <[EMAIL PROTECTED]> > on Sun, 20 Jul 2008 15:40:34 +0100 writes: DE> What I don't like about type="b", also suggested by Paul DE> Smith, is that the segments do not go right up to the DE> little circles---a gap is left, which I don't like. The gap

Re: [R] asp and ylim

2008-07-21 Thread Martin Maechler
>>>>> "DE" == David Epstein <[EMAIL PROTECTED]> >>>>> on Mon, 21 Jul 2008 14:32:47 +0100 writes: DE> A really great answer to my concerns! I'll get hold of the Paul DE> Murrell book, and see how far I can get. DE> O

Re: [R] Large number of dummy variables

2008-07-22 Thread Martin Maechler
HaroldD> post is what would be best for now, me thinks. Yes. BTW, you mentioned SparseM's "OLS with sparse matrices". The problem there is the same as with 'Matrix': You must somehow get your sparse X matrix and the best currrent tools to that, AFAIK, are the ones in

Re: [R] S4 : setGeneric for classical methods

2008-07-23 Thread Martin Maechler
> "CG" == Christophe Genolini <[EMAIL PROTECTED]> > on Tue, 22 Jul 2008 19:04:37 +0200 writes: CG> Prof Brian Ripley <[EMAIL PROTECTED]> a écrit : >> On Tue, 22 Jul 2008, [EMAIL PROTECTED] wrote: >> >>> Hi the list (well, half of the list, only the one who >>> ar

Re: [R] Write lower half of distance matrix only

2008-07-26 Thread Martin Maechler
ts / methods that were exactly written for the purpose? I strongly recommend to make your matrix into a "dist" object (or a "dissimilarity" object -- the latter from package 'cluster', using function daisy(.)) ! > m <- matrix(1:25,5); m <- m + t(m); diag(m) <

Re: [R] S4 : setGeneric for classical methods

2008-07-26 Thread Martin Maechler
>>>>> "CG" == Christophe Genolini <[EMAIL PROTECTED]> >>>>> on Sat, 26 Jul 2008 12:12:12 +0200 writes: CG> Martin Maechler <[EMAIL PROTECTED]> a écrit : >>>>>>> "CG" == Christophe

Re: [R] S4 : setGeneric for classical methods

2008-07-28 Thread Martin Maechler
>>>>> "CG" == Christophe Genolini <[EMAIL PROTECTED]> >>>>> on Sun, 27 Jul 2008 09:27:34 +0200 writes: CG> Martin Maechler <[EMAIL PROTECTED]> a écrit : >>>>>>> "CG" == Christophe Genolini <

Re: [R] R command history -- can it be like Matlab's?

2008-07-30 Thread Martin Maechler
ject.org/ ) for many months now. l> In R GUI, there is no such functionality. l> Any thoughts on making R work my productivity? leaving R GUI for ESS :-) :-) For Windows, there's a very nice package of Emacs, bundled with ESS (and AucTeX, *the* recommended LaTeX plugin for E

Re: [R] allocMatrix limits

2008-08-01 Thread Martin Maechler
> 2147483647, max long int is 9223372036854775807) Well, Brian gave you all info: Did you really carefully read ?Memory-limits ?? BTW: The package 'Matrix' has many facilities to work with sparse matrices; and these facilities are used in "lme4

Re: [R] allocMatrix limits

2008-08-01 Thread Martin Maechler
>>>>> "VK" == Vadim Kutsyy <[EMAIL PROTECTED]> >>>>> on Fri, 01 Aug 2008 07:35:01 -0700 writes: VK> Martin Maechler wrote: >> VK> The problem is in array.c, where allocMatrix check for VK> "if ((double)nrow * (

Re: [R] source a script file straight from a subversion repository

2008-08-04 Thread Martin Maechler
e big advantage that there exist no (!) user logins on that machine at all, and hence no compromised user ssh information can be misused to break in. *and* you can use source(...)! Martin Maechler, ETH Zurich __ R-help@r-project.org mailing list https://stat.e

Re: [R] Long Range Dependence: Hurst exponent estimation

2008-08-05 Thread Martin Maechler
on methods ? o fracdiff -- has been the first package to do so, o fArma -- reimplementation (from the "Rmetrics" suite) of fracdiff and much more o longmemo -- has FEXPest () of Beran Martin Maechler, ETH Zurich tiu> Thanks in advance, Tolga tiu&g

Re: [R] ecdf manipulation

2008-08-16 Thread Martin Maechler
c/library/stats/R/ecdf.R always has the (R-devel version of the) ecdf code; you may also want to study the stepfun code in stepfun.R (same directory) which is made use of by ecdf and its methods. Martin Maechler, ETH Zurich > If not then does anyone have any suggestions? > Thanks

Re: [R] bug in lme4?

2008-08-20 Thread Martin Maechler
> <[EMAIL PROTECTED]> > on Wed, 20 Aug 2008 03:03:29 +0100 writes: > Dear all, > I found a problem with 'lme4'. Basically, once you load the package 'aod' (Analysis of Overdispersed Data), the functions 'lmer' and 'glmer' don't work anymore: > library(lme4) > (fm1

Re: [R] permutation cycles

2008-08-26 Thread Martin Maechler
r than the function that Barry Rowlingson had sent me back in April which exactly solves the problem of finding the "cycle decomposition" of permutation vector p[]: cycles <- function(p) { ## From: Barry Rowlingson < at Lancaster ac UK> ## To: Martin Maechler < at

Re: [R] Tidying up code - Warning message: deparse may be incomplete

2008-08-29 Thread Martin Maechler
out tidying up code, by adding a DM> warning that following it will delete all of your comments. I think DM> you're better off writing it in a tidy way in the first place, or using DM> a smart editor to reformat it. R retains enough information to write a DM&g

[R] ESS "highlighting" turned off .. {Re: Tidying up code ...}

2008-08-29 Thread Martin Maechler
>>>>> "PD" == Peter Dalgaard <[EMAIL PROTECTED]> >>>>> on Fri, 29 Aug 2008 15:52:15 +0200 writes: PD> Martin Maechler wrote: >> I strongly agree with your last paragraph, >> and I have always thought that we sh

Re: [R] Density estimates in modelling framework

2008-08-29 Thread Martin Maechler
like: hw> dmodel <- density(~ a + b, data = mydata) hw> predict(dmodel, newdata) hw> This isn't how sm or KernSmooth or base density hw> estimation works. Are there other packages that do hw> density estimation? Or is there some reason that this h

Re: [R] give all combinations

2008-09-02 Thread Martin Maechler
has been "standard R" for quite a while now. As others have mentioned in this thread (different branch of same thread-tree), for permutations, one can typically easily get what one wants via expand.grid() or outer() [or mapply() .. ]. For that reaso

Re: [R] cluster a distance(analogue)-object using agnes(cluster)

2008-09-04 Thread Martin Maechler
t just daisy(iris2, metric = "gower") daisy() is in cluster which has been a recommended R package "forever". So the solution (here, not in general!) is to stay with package 'cluster' and use daisy() before agnes(). Regards, Martin Maechler, ETH Zurich

Re: [R] Validity check when setting slot

2009-08-10 Thread Martin Maechler
> "RG" == Renaud Gaujoux > on Mon, 10 Aug 2009 17:19:12 +0200 (SAST) writes: RG> Hi, RG> I'm wondering if the following behaviour is normal: RG> setClass('A', representation(number='numeric'), RG> validity=function(object){ RG> if( obj...@number < -1 ) return("I

Re: [R] Coding problem: How can I extract substring of function call within the function

2009-08-14 Thread Martin Maechler
le experience. If we translate this to the teaching of R, I come -- very strongly, indeed -- to the same conclusion as Gabor, that you should call your functions differently, e.g. 'Mean' or 'mean2' {{or ;-) 'meanGA', the Georgia version of mean ;-)}} so the trai

Re: [R] robust method to obtain a correlation coeff?

2009-08-25 Thread Martin Maechler
7;ve been a bit appalled to read that nobody else gave this (in my view *the correct* !) answer. Leaving away NA's via na.omit() or similar is more general, but for cor() definitely less flexible! Martin Maechler, ETH Zurich JK> --- On Mon, 8/24/09, Christian Meesters JK> wrot

Re: [R] math symbol + value of a variable in legend.

2009-08-27 Thread Martin Maechler
p", legend = c(as.expression( bquote(mu[1] == .(m1)) ), as.expression( bquote(mu[2] == .(m2)) )), lty = 1:2) ## ## or, if you really need to have the subscript as a *variable* as well: ## i1 <- 11; i2 <- 20 legend("topright", legend = c(as.expressio

Re: [R] Help on efficiency/vectorization

2009-08-27 Thread Martin Maechler
> "MO" == Moshe Olshansky > on Wed, 26 Aug 2009 23:36:22 -0700 (PDT) writes: MO> You can do MO> for (i in 1:ncol(x)) {names <- rownames(x)[which(x[,i]==1)];eval(parse(text=paste("V",i,".ind<-names",sep="")));} you can, but after install.packages("fortunes") > require("f

Re: [R] Best R text editors?

2009-08-31 Thread Martin Maechler
", "Articles", "Presentations" and "Reference Cards". Further, on the "Getting Help" tab, there are also links to the ESS section of the R- Wiki and the Emacs - Wiki. Martin Maechler, ETH Zurich __ R-he

Re: [R] Google style

2009-09-02 Thread Martin Maechler
ll think it has C-like meaning. You will read > x + y > + z; > as one statement, not two. (Actually you could argue that in R there are > three statements there, but the third one is empty). > This is harmful in the

Re: [R] Best R text editors?

2009-09-02 Thread Martin Maechler
tions' Menu there's now a check-box entry " C-x/C-c/C-v Cut and Paste (CUA) " ((which still is "off" by default ;-)) but the person used to German instead of Chinese can just click that and also click " Save Options " on the same menu and have the de

Re: [R] Problem with locfit( ... , family="hazard")

2009-09-04 Thread Martin Maechler
: > missing value where TRUE/FALSE needed > I am guessing this may be a missing parameter needed by persp() but I > cannot figure out what to offer. well, it should give a better error message, if it really needs another argument . A reproducible example *would* be ver

Re: [R] Google's R Style Guide (has become S3 vs S4, in part)

2009-09-08 Thread Martin Maechler
3Foo to emphasize that it was a constructor, but in my own > code I use S3Foo(). Realizing that, as Henrik has now also pointed out, > I'm far from perfect, the use of as.numeric() combines validity checking > and coercion, which I think is not usually a good th

Re: [R] sparse vectors

2009-09-08 Thread Martin Maechler
> "Robin" == Robin Hankin > on Tue, 08 Sep 2009 14:58:49 +0100 writes: Robin> Hi guys Robin> thanks for this, it works fine, but I'm not sure the Matrix package does Robin> what I want: >> a = sparseMatrix(i=c(20, 30, 10), j=rep(1, 3), x=c(2.2, 3.3, 4.4))

Re: [R] local sequence function

2009-09-14 Thread Martin Maechler
this would be much to slow, because the real vector is s> much larger. Can you point me in the right direction? direction? Ok, something along > lapply(lapply(split(v, cumsum(is.na(v))), `[`, -1L), seq_along) $`1` integer(0) $`2` [1] 1 2 $`3` [1] 1 $`4` [1] 1 2 3 -- Martin Mae

Re: [R] Location of Packages?

2009-09-14 Thread Martin Maechler
> "iw" == ivo welch > on Mon, 14 Sep 2009 12:03:59 -0400 writes: iw> Sorry, one more: on OSX, I deleted my old 2.9.2 R.app, and installed the 64 iw> bit version of 2.9.0. I then did an "install.packages("car")" under my new iw> 2.9.0. It seems to have worked, but alas,

Re: [R] How to extract data.frame columns using regex?

2009-09-17 Thread Martin Maechler
> "SH" == Schalk Heunis > on Thu, 17 Sep 2009 11:15:16 +0200 writes: SH> I think this is what you want: >> df <- data.frame(x1=1:11,x2=2:12,x3=3:13,y=4:14) >> grep('^x',names(df)) SH> [1] 1 2 3 SH> The returned indexes refer to the column positions, so you could d

Re: [R] R wiki link ?

2010-02-11 Thread Martin Maechler
ttp://wiki.r-project.org/ been corrupted? I >> can find >> http://rwiki.sciviews.org that works. PhGr> Yes, the problem is known. I have to fix it. and it has been fixed, late yesterday, thanks to Stefan Theussl's kind and swift cooperation

Re: [R] biclust package

2010-02-26 Thread Martin Maechler
> "UweL" == Uwe Ligges > on Fri, 26 Feb 2010 17:24:43 +0100 writes: UweL> On 26.02.2010 17:04, linda garcia wrote: >> Dear all, >> I am using biclust package for biclustering. I wanted to >> know how can I extract my clusters from the object? >> >> >> lib

Re: [R] fisher.test gives p>1

2010-03-04 Thread Martin Maechler
using the very latest version of R-devel (svn revision >= 51204) :-) "Of course", the above is just the result of rounding error propagation in an extreme case. I've now simply replaced PVAL by max(0, min(1, PVAL)) in the one place it seems sensible. Martin Maechler

Re: [R] r code to generate interaction columns

2010-03-10 Thread Martin Maechler
ge using Lasso-like methods {{instead of Randomforest; and Trevor Hastie has quite a host of examples where glmnet methods perform better than Randomforest.}} can make use of "Matrix sparse matrices" like that. ] Read help(model.matrix) and also look at the examples th

Re: [R] nice log-log plots

2010-03-15 Thread Martin Maechler
t; for JL> us, for even when I made up some data, the plot.loglog JL> function didn't work because of this. Have you tried install.packages("sfsmisc") library(sfsmisc) example(eaxis) ## and then ?eaxis I think this is what you need (in a more flexible way than a plot.loglog

Re: [R] lokern package

2009-07-02 Thread Martin Maechler
> "RV" == Ravi Varadhan > on Thu, 2 Jul 2009 10:51:03 -0400 writes: RV> Dear Martin, I have been playing a lot with the RV> glkerns() function in the "lokern" package for RV> "automatic" smoothing of time-series data. This kernel RV> smoothing approach of Gasser and M

Re: [R] Question regarding package submission to CRAN

2009-07-18 Thread Martin Maechler
> "VG" == Vikneswaran Gopal > on Fri, 17 Jul 2009 08:51:55 -0700 writes: VG> It usually gets uploaded within a day if it passes all VG> the checks run by Kurt Hornik. Then the Windows version VG> gets built within the next 24 hours as well. Vik Jim "usually", yes indeed.

Re: [R] S4 method dispatch with inheritance

2009-07-20 Thread Martin Maechler
> "MH" == Michael Hahsler > on Mon, 20 Jul 2009 08:57:28 -0500 writes: MH> Hi, I'm trying to create a new S4 class (myMatrix) which MH> for now just extends dgCMatrix (from package MH> Matrix). Then I want to use "[" which is defined in MH> Matrix. MH> Out of the

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread Martin Maechler
> "MartinMo" == Martin Morgan > on Mon, 20 Jul 2009 18:57:33 -0700 writes: MartinMo> L L writes: >> Ok, I could solve also the latter problem by defining show.myclass function in >> the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE >> file.

Re: [R] Searching for specific values in a matrix

2009-07-28 Thread Martin Maechler
hat needs a little extra care, as it either returns TRUE or a character vector. In sum, I'd strongly suggest you use %~% <- function(x,y) isTRUE(all.equal(x,y)) Martin Maechler, ETH Zurich and R Core Team BertG> Bert Gunter Genentech Nonclinical Biostatistics BertG> -Or

Re: [R] dumping data objects

2009-07-29 Thread Martin Maechler
by the user" and indeed is only used to produce the correct binary code used by the C internal dump() code, > .deparseOpts(control="S_compatible") [1] 128 as you had demonstrated in your first message. Can you propose an amendment to the help page

Re: [R] A hiccup when using anova on gam() fits.

2009-07-29 Thread Martin Maechler
e last one goes anova() -> anova.lm() -> anova.lmlist() ## and then "happens to work" with a gam() fit... ## For that reason, even here, anova(fit3. , fit2) # << note the "." ## is to be preferred in my view -- Martin Maechler, ETH Zurich -- RT>

Re: [R] check for new files in a given directory

2009-07-30 Thread Martin Maechler
e the platform-dependent > system() function. Should this argument be added to R's dir() and > list.files() functions? Yes, I think it "should" -- exactly because I also like to work without system() here. I will not implement it myself though, as I nowadays build R

Re: [R] Which CRAN mirror is the fastest ?

2009-07-30 Thread Martin Maechler
> Barry Rowlingson > on Thu, 30 Jul 2009 09:59:47 +0100 writes: > 2009/7/30 Uwe Ligges : >> Hard to lee, you have to try out, I fear. >> >> The speed you see highly depends on the connection from your country to >> others, but of course, there are also some mirror

Re: [R] How to stop an R script when running JGR on a Linux/SuSE system

2009-08-03 Thread Martin Maechler
misconfigured mailer en route to one PD> of our subscribers (disobeys Errors-To: and mails sender PD> instead). The logical consequence would seem to be to PD> unsubscribe mailingli...@versanet.de. I've done that now. Sorry I hadn't been around earlier. Martin Mae

Re: [R] .... running JGR on a Linux/SuSE system

2009-08-03 Thread Martin Maechler
uot;. But there are quite a few others (I do not really know from personal experience), see, e.g., all the projects (listed on the left hand side) of http://www.r-project.org/GUI [...] BK> Bernd Martin Maechler, ETH Zurich __ R-he

Re: [R] diagonal LDA and QDA

2009-08-03 Thread Martin Maechler
in MASS, and it cG> seems it does not support this. IIRC, this in several packages, e.g., function diagDA() in package 'sfsmisc'. Regards, Martin Maechler ETH Zurich __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Rank of matrix

2009-08-04 Thread Martin Maechler
ing this back to a topic more fit to R-help : The package 'Matrix' (typically part of R, since R 2.9.0), has a function rankMatrix() whose options {and implementation; just type 'rankMatrix' !} show you a bit about the problematics. Regards, Martin Maechler, ETH Zurich _

Re: [R] R User Group listings

2009-08-06 Thread Martin Maechler
> "FrL" == Friedrich Leisch > on Thu, 6 Aug 2009 11:38:03 +0200 writes: > On Sat, 01 Aug 2009 08:30:50 -0400, > Prof John C Nash (PJCN) wrote: >> Better ideas should prevail. There is now a wiki page at >> http://wiki.r-project.org/rwiki/doku.php?id=rugs:r_user_groups

Re: [R] Why is 0 not an integer?

2009-08-07 Thread Martin Maechler
> [1] Inf >> 1.0/-0.0 > [1] -Inf Yes, indeed! Finally something interesting in this boring thread ! A few of us have agreed in the past that indeed, it would be preferable if identical() *did* reflect this difference. I'm going to discuss this -- it's abo

Re: [R] plotting huge data

2009-08-07 Thread Martin Maechler
to answer the original question: Please note that R has had for a while the very nice and useful smoothScatter() function, written exactly for such cases, but also for cases that are closer to "huge": E.g. still working fast for n <- 1e6 Martin Maechler, ETH Zurich _

Re: [R] where do I send typos?

2010-03-26 Thread Martin Maechler
but a question of improving the documentation which may be of more general R developer interest. Thanks in advance, for your reports. Martin Maechler, ETH Zurich (and R Core) IG> --- On Fri, 26/3/10, Xu Wang wrote: >> From: Xu Wang >> Subject: [R] where

[R] logit() etc {was "Re: glmer with non integer weights"}

2010-04-19 Thread Martin Maechler
> "EC" == Emmanuel Charpentier > on Sun, 18 Apr 2010 11:29:29 +0200 writes: EC> Le vendredi 16 avril 2010 à 00:15 -0800, Kay Cichini a EC> écrit : >> thanks thierry, >> >> i considered this transformations already, but variance >> is not stabilized and/or norm

Re: [R] ecdf

2010-04-21 Thread Martin Maechler
> "DW" == David Winsemius > on Mon, 19 Apr 2010 10:49:51 -0400 writes: DW> The OP wrote me privately to say that the errant documantation was at: >> http://lib.stat.cmu.edu/S/Harrell/help/Hmisc/html/ecdf.html DW> That is a rather old bit of information. It dates back to

Re: [R] implementation of matrix logarithm (inverse of matrix exponential)

2009-09-28 Thread Martin Maechler
stion still remain if it's okay to change the default method, as the state of the art advances. For the matrix functions expm(), logm(), etc., I'd say "yes", the default should be allowed to change. Martin Maechler, ETH Zurich DB> On Sun, Sep 27, 2009 at 11:44 AM, Charl

Re: [R] else if statement error

2009-10-05 Thread Martin Maechler
a <- if(ini == 1) 3 else if(ini > 1 && b > 2) 5 else 6 As I say on many occasions: ifelse() is useful and nice, but it is used in many more places than it should {BTW, not only because of examples like the above}. Martin Maechler, ETH Zurich (*) &quo

Re: [R] Creating a sparse matrix from a file

2009-10-27 Thread Martin Maechler
PP> Hi all, PP> I used sparseM package for creating sparse Matrix and PP> followed below commands. I'd strongly recommend to use package 'Matrix' which is part of every R distribution (since R 2.9.0). PP> The sequence of commands are: >> ex <- read.table('fileName',sep=','

Re: [R] Creating a sparse matrix from a file

2009-10-27 Thread Martin Maechler
MM. <- tcrossprod(M) # == MM' := M %*% t(M) M.1 <- M %*% rep(1, ncol(M)) stopifnot(identical(drop(M.1), rowSums(M))) They were just for illustrative purposes, to show how and that you can work with the created sparse matrix 'M'. Regards, Martin Maechler, ETH Zurich

Re: [R] operations on sparse matrices, and dense intermediary steps

2009-10-27 Thread Martin Maechler
C, might be to special case M[i,] , M[i,j] etc for the special case where i (and j) is just of length 1. }} Thank you for the reproducible code, and thanks in advance for your improvement patches or other propositions... Best regards, Martin Maechler, ETH Zurich _

Re: [R] User input when running R code in batch mode

2009-10-27 Thread Martin Maechler
big R, but I think > littler is designed for this kind of thing. yes, and it was historically the first, and maybe still the most efficient way to do so. The "big R" way is to use 'Rscript' which comes with R, e.g., Rscript --vanilla -e 'cat("a string pl

Re: [R] Creating a sparse matrix from a file

2009-10-28 Thread Martin Maechler
ly implemented very sub-optimally. I'm busy for the rest of today with other duties, but am looking forward to receive **reproducible** code from you, by tonight. Also, please do not forget to also show the result of sessionInfo() ! Martin Maechler, PP> Thanks PP> Pallavi

Re: [R] Problem building R 2.10.0 - Matrix package

2009-11-12 Thread Martin Maechler
> "TA" == Thomas Adams > on Mon, 02 Nov 2009 11:04:30 -0500 writes: TA> All: TA> Attached is the output file from building R 2.10.0 on RedHat Linux. I TA> have never previously experienced any problems when building R from TA> source with new releases. But, now I get

Re: [R] Problem building R 2.10.0 - Matrix package

2009-11-13 Thread Martin Maechler
Thank you, Russ, but ... > "RPH" == R P Herrold > on Thu, 12 Nov 2009 14:13:26 -0500 (EST) writes: >>> "TA" == Thomas Adams TA> Attached is the output file from building R 2.10.0 on RedHat Linux. I TA> have never previously experienced any problems when building R f

Re: [R] Relase positive with log and zero of negative with 0

2009-11-18 Thread Martin Maechler
e more useful for what I guess the OP wants the trafo to use for... or then, if you think further and want a - monotone - continuous and even smooth (once-differentiable) log-like transformation then consider using the u.log() function I have written some 13 years ago, (inspired by coffebreak disc

Re: [R] Bessel function with large index value

2009-11-20 Thread Martin Maechler
>>>>> "DS" == David Scott >>>>> on Sat, 21 Nov 2009 02:29:38 +1300 writes: DS> This is a reply to my own question. I thought I had found an answer but DS> it seems not so (some analysis follows below). Maybe Martin Maechler or DS

Re: [R] How to display an image on RGL plot?

2009-11-26 Thread Martin Maechler
7;ve seen this once in the past, and also there, it was the Nabble interface (!) Personally I'd really prefer people would use regular subscriptions and regular e-mail for posting to the R mailing lists. Martin Maechler, ETH Zurich, provider of the major R mailing lists

Re: [R] shorten str() output for long list

2009-12-04 Thread Martin Maechler
width = width, envir = envir, max.list) DW> (defensive programming requires to use 'max.list=max.list' in the line above.) David, I know you as a smart R user. If you provide patches against the *sources* , i.e. https://svn.r-project.org/R/trunk/src/library/utils/R/str.R

Re: [R] Regularized gamma function/ incomplete gamma function

2009-12-12 Thread Martin Maechler
he difference ratio as approximate differential ratio) below: For a = 1.25, and x = 0.2, e.g. : > sapply(10^-(3:9), function(e) diff(qgamma(.2 + c(-e,e), sh = 1.25))/(2*e)) [1] 1.675105 1.675103 1.675103 1.675103 1.675103 1.675103 1.675103 > 1/dgamma(qgamma(0.2, sh = 1.25), sh = 1.25)

<    1   2   3   4   5   6   7   8   9   >