Re: [R] Revolution Analytics reading SAS datasets

2011-02-11 Thread Martin Maechler
on R-help, please. At first, note that R is GNU R, and R-help has been about R as a Free ("Libre") Software, for all its many years and hundreds of thousands of messages. Revolutions's product may be fine for some, in some situations, but supporting non-Free parts of it, really

Re: [R] "hubers" function in R MASS library : problem and solution

2011-02-04 Thread Martin Maechler
stimate no-longer-scale-equivariant. huberM() *has* an s argument for specifying the scale estimate, so you could use it as huberM(a, s = max(mad(a), 1e-6)) if you want. Note that your sample 'a' is constructed in a way that all scale-equivariant 50%-breakpoint robust estimate

Re: [R] better way to iterate matrix multiplication?

2011-02-01 Thread Martin Maechler
ly when the matrix is non-singular, whereas the `%^%` in package expm should work reliably in all cases. Also for (much) smaller powers than n=10'000 the cpu time needed is more comparable. Martin Maechler, ETH Zurich EV> Am 01.02.2011 17:16, schrieb Ben Bolker: >>

Re: [R] Preparing dataset for glmnet: factors to dummies

2011-02-01 Thread Martin Maechler
;s model.matrix() (as that produces only standard, i.e., dense matrices). The functionality of model.Matrix() has been moved out of the Matrix package into the package 'MatrixModels', and that package also provides -- somewhat experimental -- functionality for fitting GLMs with sparse mode

Re: [R] Meaning of pterms in survreg object?

2011-01-31 Thread Martin Maechler
reference. The reference to see what's posted or not are the mailing list archives "proper", https://stat.ethz.ch/pipermail/r-help/ , and they are available directly from the https://stat.ethz.ch/mailman/listinfo/r-help url at the bottom of every posting ... Martin Maechler, ETH

Re: [R] Positive Definite Matrix

2011-01-31 Thread Martin Maechler
>I think the bottom line can be summarized as > follows: > 1. Give up on Cholesky factors unless you have a > matrix you know must be symmetric and strictly positive > definite. (I seem to recall having had problems with chol > even with matrices that were theor

Re: [R] Sparse matrix multiplication

2011-01-29 Thread Martin Maechler
rnorm(1e4), 100,100)) system.time(B. <- .bdiag(Blis)) # 1.28 sec system.time(cc <- A %*% B.) # 1.7 sec class(cc)# "dgeMatrix" .. i.e. dense ## and depending on the context you may revert to traditional unclassed matrices ## via c2 <- as(cc, "matrix") >> T

Re: [R] Positive Definite Matrix

2011-01-29 Thread Martin Maechler
> Prof Brian Ripley > on Sat, 29 Jan 2011 21:00:19 + (GMT) writes: > On Sat, 29 Jan 2011, David Winsemius wrote: >> >> On Jan 29, 2011, at 12:17 PM, Prof Brian Ripley wrote: >> >>> On Sat, 29 Jan 2011, David Winsemius wrote: >>> On Jan

Re: [R] agnes clustering and NAs

2011-01-28 Thread Martin Maechler
23371 dissimilarity matrix, stored as a double precision matrix (on a 64-bit platform) that's an object of size 4.4 GBytes, not very convenient to work with. as dissimilarity object it will only be about half of that size, but that's still ``a bit large''.. As I said above, for such

Re: [R] "cannot allocate vector of size ..." in RHLE5 PAE kernel

2011-01-17 Thread Martin Maechler
> "MZ" == Mauricio Zambrano > on Mon, 17 Jan 2011 11:46:44 +0100 writes: MZ> Dear R community, MZ> I'm running R 32 bits in a 64-bits machine (with 16Gb of Ram) using a MZ> PAE kernel, as you can see here: MZ> $ uname -a MZ> Linux mymachine 2.6.18-238.el5PAE #1 SM

Re: [R] Problem with timeSequence {timeDate} - wrong end date

2011-01-07 Thread Martin Maechler
t(r1) > } > and "res" is the object returned in both cases (I believe). Thank you, Joshua. Note that "R 2.12.1 patched" and "R 2.13.0 unstable" have this fixed (since yesterday) and hence will no longer "overshoot". Also, the next rele

Re: [R] defining a formula method for a weighted lm()

2011-01-06 Thread Martin Maechler
40 45 50 55 60 > sapply(lapply(strsplit(Astr, "-"), as.numeric), `[[`, 2) [1] 29 34 39 44 49 54 59 64 > sapply(lapply(strsplit(Astr, "-"), as.numeric), mean) [1] 27 32 37 42 47 52 57 62 Or use the 2-row matrix and apply(*, 1) to that : > sapply(strsplit(Astr, "-

Re: [R] Removing rows with earlier dates

2010-12-29 Thread Martin Maechler
th Day > 31 37 279 7.4 76 5 31 > 61 NA 138 8.0 83 6 30 > 92 59 254 9.2 81 7 31 > 12385 188 6.3 94 8 31 > 15320 223 11.5 68 9 30 Hmm, yes, but " FUN = function(x) { max(x) } "

Re: [R] Any functions to manipulate (merge, cut, remove) hclust objects? (maybe through phylo?)

2010-12-29 Thread Martin Maechler
r-project :) Cool. Actually, now I think the merge() is the much easier part than the cutree() / as.hclust.dendrogram() one. But also that should not be very hard. As I'm officially in vacation at the moment, I may have some fun helping with these... Martin > On Wed, Dec 29, 2010 at 1:4

Re: [R] Any functions to manipulate (merge, cut, remove) hclust objects? (maybe through phylo?)

2010-12-29 Thread Martin Maechler
> Tal Galili > on Wed, 29 Dec 2010 13:32:26 +0200 writes: > Hello Martin, > Thank you for replying. > I have two needs: > 1) To merge two dendrograms into one. > 2) To then run cutree on it (which works on hclust, but >not on dendrogram). Well, but cut(

Re: [R] R-code to generate random rotation matrix for rotation testing

2010-12-29 Thread Martin Maechler
ro vector. Consequently: Your procedure must rather be 1) Y0 <- Y - mY 2) Z0 <- Q' %*% Y0 3) Z <- Z0 + mY and to make this work with data matrices Y, Z, the mean vector mY must either be a matrix with constant columns or the result of as.vector()ing such a matrix. Reg

Re: [R] Any functions to manipulate (merge, cut, remove) hclust objects? (maybe through phylo?)

2010-12-29 Thread Martin Maechler
am, but that doesn't TG> enable me to turn it back into an hclust object. Why should you "turn it back" ? What do you want to use them for The intent of the "dendrogram" has been that it is more flexible (and more general) than "hclust" and can be printed, pl

Re: [R] sum with times

2010-12-20 Thread Martin Maechler
> "RRJ" == Ronaldo Reis Junior > on Sun, 19 Dec 2010 12:10:54 -0200 writes: RRJ> Hi, Forget, the chron package work with this No, don't forget, rather solve the problem: Date / dateTime classes are "native R entities"; extension package 'chron' objects are not. ___

Re: [R] package survey

2010-12-20 Thread Martin Maechler
top of your JS> head) is there some way of sending the code for all JS> functions in particular package to a ".r" file from the JS> command line with one or two lines of code? Note that only the source package contains the real source code. What you g

Re: [R] Numbers in a string

2010-12-17 Thread Martin Maechler
> Petr Savicky > on Wed, 15 Dec 2010 14:21:37 +0100 writes: > On Wed, Dec 15, 2010 at 11:08:06AM -0200, Henrique > Dallazuanna wrote: >> Try this: >> >> gsub("[^0-9]", "", "AB15E9SDF654VKBN?dvb.65") > Consider also > strsplit("AB15E9SDF654VKBN?dvb.65",

Re: [R] Perl "cut" equivalent in R

2010-12-10 Thread Martin Maechler
> "SL" == Steve Lianoglou > on Mon, 6 Dec 2010 14:21:59 -0500 writes: >>> if(FALSE) { stuff your don't want executed          } >>> >> > Switching a block of code off/on with editing a single >> character may be done using 0/1 instead of FALSE/TRUE. SL> Or even

Re: [R] How to catch both warnings and errors?

2010-12-09 Thread Martin Maechler
d result. ##' ##' @title tryCatch both warnings and errors ##' @param expr ##' @return a list with 'value' and 'warning', where ##' 'value' may be an error caught. ##' @author Martin Maechler tryCatch.W.E <- function(expr) { W <

Re: [R] robustbase problem [bug?] in adjbox function.

2010-12-08 Thread Martin Maechler
s problem corrected, and actually we'd be very happy if you could stress test this version. A release is planned soon, and actually only delayed by a careful modification of the Qn() finite sample correction ... as the new version corrects a long-standing typo in the decimal digits of the consistenc

Re: [R] Troubles using postscript(family = "ComputerModern")

2010-12-01 Thread Martin Maechler
> David Winsemius > on Mon, 29 Nov 2010 09:46:08 -0500 writes: > On Nov 29, 2010, at 9:00 AM, pilchat wrote: >> Hi guys, >> >> to make it easier, here is a simple case with the same issues. I use >> the short function below to make the attached PS file. >>

Re: [R] An empty grey diagram

2010-11-22 Thread Martin Maechler
plot (len ~ dose, data=ToothGrowth) abline(lm(len ~ dose, data=ToothGrowth)) and you can see {if you use a fixed-width font in your e-mail, it "springs into your eyes"} how nicely the formula notation of graphics alings with the same in models. If the abov

Re: [R] Rmpfr question

2010-10-16 Thread Martin Maechler
ope I'm not doing your home work here. The correct solution of course is > a <- sin(mpfr(10, 230)^22) > b <- log(mpfr(171, 230)/10) > c <- exp(mpfr(42, 230)/100) > (d <- 173746*a + 94228*b - 78487*c) 1 'mpfr' number of precision 230 bits [1] -1.3418189578296

Re: [R] name ONLY one column // empty.dimnames() in 'sfsmisc'

2010-09-29 Thread Martin Maechler
ollection). Excerpt from its help page: > empty.dimnames package:sfsmisc R Documentation > Empty Dimnames of an Array. > Description: > `Remove' all dimension names from an array for compact printing. > Usage: > empty.dimnames(a) > Ar

Re: [R] Problem with cat() == A related question

2010-09-15 Thread Martin Maechler
> 3 8 13 18 23 > 4 9 14 19 24 > 5 10 15 20 25 Yes. A (slightly more general and efficient) version is > sfsmisc::empty.dimnames( matrix(1:40, 5,8) ) 1 6 11 16 21 26 31 36 2 7 12 17 22 27 32 37 3 8 13 18 23 28 33 38 4 9 14 19 24 29 34 39 5 10 15 20 25 30

Re: [R] approxfun-problems (yleft and yright ignored)

2010-09-11 Thread Martin Maechler
>>>>> Duncan Murdoch >>>>> on Sat, 11 Sep 2010 11:23:02 -0400 writes: > On 11/09/2010 11:13 AM, Martin Maechler wrote: >>>>>>> Duncan Murdoch >>>>>>> on Sat, 11 Sep 2010 10:32:38 -0400 writes: >

Re: [R] approxfun-problems (yleft and yright ignored)

2010-09-11 Thread Martin Maechler
>>>>> Duncan Murdoch >>>>> on Sat, 11 Sep 2010 10:32:38 -0400 writes: > On 11/09/2010 10:04 AM, Martin Maechler wrote: >>>>>>> "SW" == Samuel Wuest >>>>>>> on Thu, 26 Aug 2010 14:34:26 +0100

Re: [R] approxfun-problems (yleft and yright ignored)

2010-09-11 Thread Martin Maechler
>>>>> "MM" == Martin Maechler >>>>> on Sat, 11 Sep 2010 16:04:37 +0200 writes: >>>>> "SW" == Samuel Wuest >>>>> on Thu, 26 Aug 2010 14:34:26 +0100 writes: SW> Hi Greg, SW> thanks for the sug

Re: [R] approxfun-problems (yleft and yright ignored)

2010-09-11 Thread Martin Maechler
ou've submitted (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14377) and which does *not* show any bug: > range(y.out) [1] 0.000 0.9816907 Of course, I do believe that you've seen the above problems, -- on 64-bit Mac ? as you report in sessionInfo() ? -- but I cannot rep

Re: [R] Using library and lib.loc

2010-09-03 Thread Martin Maechler
) in your Rprofile or you can set R_LIBS in yourRenviron and there are variations and combinations of the above. See ?Startup to learn about Rprofile and Renviron settings. Martin Maechler, ETH Zurich o> Thanks, o> Olivier __

Re: [R] Why is vector assignment in R recreates the entire vector ?

2010-09-03 Thread Martin Maechler
performed. NM> ... NM> I brought this up in r-devel a few months ago. yes, thank you Norm, for the pointer. Indeed this whole topic really belongs to R-devel not R-help. Martin Maechler NM> You can read my posting, NM> and the various replies, at NM> http://

Re: [R] Documenting S4 Methods

2010-08-25 Thread Martin Maechler
> Dario Strbenac > on Wed, 25 Aug 2010 13:00:03 +1000 (EST) writes: > I'm in the process of converting some S3 methods to S4 methods. > I have this function : > setGeneric("enrichmentCalc", function(rs, organism, seqLen, ...){standardGeneric("enrichmentCalc")}) > se

Re: [R] How to make 'step' faster?

2010-08-20 Thread Martin Maechler
>> Also, the datasets I am working with contain very few non-zero >> entries. Can a sparse function specification be used on step? GS> I don't think this is possible at the moment in R, but several people, GS> including Doug Bates and Martin Maechler, are working on

Re: [R] Learning ANOVA

2010-08-16 Thread Martin Maechler
> Liaw, Andy > on Mon, 16 Aug 2010 08:22:33 -0400 writes: > From: Stephen Liu >> >> Hi JesperHybel, >> >> Thanks for your advice. >> >> >If you're trying to follow the youtube video you have a >> typing mistake here: >> >> >InsectSprays.aov

Re: [R] Function to Define a Function

2010-08-10 Thread Martin Maechler
00,0.2,1000) >> res2 >> > Try this: > mdlChooser <- function(type = c("one", "two")) { > one <- function(x,N0,r) N0*exp(x*r) > two <- function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r)) > type <- match.arg(type)

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Martin Maechler
S (the book!), I think even in its first edition. Even more reliable (probably) would be to use the (recommended) 'boot' package and use bootstrap confidence intervals, i.e., boot.ci() there. Martin Maechler, ETH Zurich __ R-help@r-project.org ma

Re: [R] Documenting different OO-aproaches in R as a package?

2010-07-28 Thread Martin Maechler
t;legacy" applications) and S4, and concentrate on these rather than fostering even more alternatives. Everything else has been by contributed by R users who were not happy with S4 ... at the time at least ... Note that in the last several R releases, S3 <-> S4 "interoparability&q

Re: [R] easy debugging

2010-07-28 Thread Martin Maechler
gt; equated >> [1] 111.00 112.06 112.90 113.80 115.00 116.20 117.00 118.00 120.00 >> 120.00 120.00 >> > Note that for the particular question, pmin(120, equated) is more efficient than any of the other versions you've mentioned. Martin Maechler, ETH Zurich

Re: [R] Installing the Zoo *package*

2010-07-28 Thread Martin Maechler
rtran, C++, etc functions (sometimes called a "DLL", notably in Windows) which in R is loaded by dyn.load() or library.dynam() -- typically implicitly when a package is loaded containing compiled code. As you declare yourself an "R newbie", one of the early steps will be to use p

Re: [R] A problem about the package "lme4" in R-2.11.1

2010-07-14 Thread Martin Maechler
ommands you then enter? Please provide the result of sessionInfo(), as well. I'm pretty sure you have some version mismatch (versions of R, and lme4 and the Matrix package, probably). Martin Maechler, ETH Zurich NC> Sincerely, NC> Joe __

Re: [R] [R-pkgs] New package "list" for analyzing list surveyexperiments

2010-07-14 Thread Martin Maechler
_" is currently used as separator between package name and package version in some contexts, and allowing "_" be part of the package name itself may need more changes in the R project infrastructure (including package repositories and their tools !!) than we (R Core) would want to unde

Re: [R] Matrix Column Names

2010-07-13 Thread Martin Maechler
abbreviate(vnames, 8) or variations of that such as vnames <- abbreviate(vnames, 8, method="both.sides") or also vnames <- abbreviate(vnames, 8, strict=FALSE) DN> Many thanks! you're welcome! Martin Maechler, ETH Zurich _

Re: [R] Fast String operations in R ? Cost of String operations

2010-07-06 Thread Martin Maechler
re not fast enough for your task at hand? Please read and adhere to the posting guide, see the footer of *every* R-help message, cited below... ((and then work, and may be then ask a more specific question)) Martin Maechler, ETH Zurich __ R-help@r-project

Re: [R] question concerning VGAM

2010-07-05 Thread Martin Maechler
tat.ethz.ch/mailman/listinfo/r-help --- PLEASE do read the posting guide http://www.R-project.org/posting-guide.html --- and provide commented, minimal, self-contained, reproducible code. Hmm, and which part of the two lines above did you not understand? example(vglm) already contains u

Re: [R] S4 classes and debugging - Is there a summary?

2010-07-02 Thread Martin Maechler
patialPoints" >> object="Raster", xy="vector" >> object="RasterLayer", xy="matrix" >> object="RasterStackBrick", xy="matrix" >> >> And now...? > selectMethod(xyValues,

Re: [R] vlmc - "In vlmc(traffic.clusters.stationary, cutoff = i) : alphabet with >1-letter strings; trying to abbreviate"

2010-06-30 Thread Martin Maechler
vc <- vlmc(a, cutoff=5, quiet = TRUE) or vc <- vlmc(a, cutoff=5, code1char = FALSE) > I have looked at the documentation plus > Mchler M. and Bhlmann P. (2004) Variable Length Markov Chains: > Methodology, Computing, and Software. _J. Computational and > Graph

Re: [R] R and LINGO?

2010-06-17 Thread Martin Maechler
e. (It has one short section on interfaces to commercial software, "CPLEX", mentioned to also solve mixed integer problems) b> Any help or suggestions would be appreciated. You are welcome! Martin Maechler, ETH Zurich b> Brwin338 b> [[alternative HTML version

Re: [R] Lattice: How to color the data points in splom() according to the panel they are plotted?

2010-06-14 Thread Martin Maechler
(!("..." %in% names(formals(panel pargs <- pargs[intersect(names(pargs), names(formals(panel)))] With the above change, a user could use a panel function with (i,j) arguments, and e.g. say Cmat <- outer(1:6,1:6, function(i,j) rainbow(

[R] R-help "spam" detection; please help the moderators

2010-06-01 Thread Martin Maechler
h digits. We hereby ask those among you who use a freemail account to please no longer post via nabble. Thank you for your support of R-help, *the* "community mailing list" of the R project since even before that project existed "formally", namely since 1997-04-01, today 13 ye

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-05-19 Thread Martin Maechler
Just a small correction to what I've said ... see below >>>>> "MM" == Martin Maechler >>>>> on Tue, 18 May 2010 10:00:20 +0200 writes: >>>>> David Winsemius >>>>> on Mon, 17 May 2010 17:44:00 -0400 writes:

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Martin Maechler
ill not be reinstalled. > > cheers > > milton > > On Tue, May 18, 2010 at 12:49 PM, Martin Maechler < > maech...@stat.math.ethz.ch> wrote: > >> { I've modified the subject; I can't stand it hitting square into >> my face ... } >> >

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Martin Maechler
IST. These are *PACKAGES* ! Why do you think are you talking about the function install.packages() --- To answer the question you did want to ask: Do not be afraid: Depedencies are only installed when needed, i.e., no package will be downloaded and installed if it alread

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-05-18 Thread Martin Maechler
stall into the (or "a") library where Matrix is installed. For those who only use one library, this will not be a concern. Others could use the fact that MacOSX is a kind of Unix and you can simply "symlink" Matrix (from the R standard library) into the library into which you want to

[R] Accidental misuse of 'R-packages' list

2010-05-18 Thread Martin Maechler
good rule is to not mention a pacakge more than once a year, and much less than that for all packages with only minor changes. Martin Maechler, ETH Zurich >>>>> "MY" == Matt Young >>>>> on Wed, 12 May 2010 08:23:24 -0700 writes: MY> Lot of

Re: [R] Cluster procedure using geographical neighborhood

2010-05-07 Thread Martin Maechler
ties, 'w' is weight factor and d~(u,v) is e.g. the geodesic distance between u and v. I'm CC'ing this to the R-help mailing list, as I think you could get more advice from there. Martin Maechler, ETH Zurich DS> However if I do that the procedure hclust () does not wo

Re: [R] 'matplot' for matrix with NAs: broken lines

2010-05-06 Thread Martin Maechler
orate, using your example (below)? I found Gabor's answer appropriate, I really cannot see why matplot() should behave differently here... Martin Maechler TS> >> From: ggrothendi...@gmail.com >> Date: Wed, 5 Ma

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

[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] 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

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] 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] 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] 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] 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] Symmetric Matrix classes

2010-01-19 Thread Martin Maechler
Scanning for 'Matrix' in old R-help e-mail, I found > "GA" == Gad Abraham > on Fri, 27 Nov 2009 13:45:00 +1100 writes: GA> Hi, GA> I'd like to store large covariance matrices using Matrix classes. GA> dsyMatrix seems like the right one, but I want to specify just the

Re: [R] sparseM and kronecker product_R latest version

2010-01-12 Thread Martin Maechler
98)) identical(D, D.) ##--> TRUE ## and, e.g., > Dk <- kronecker(D, Diagonal(x=5:2)) > identical(Dk, D %x% Diagonal(x = 5:2)) [1] TRUE > dim(D) [1] 113289 36698 > dim(Dk) [1] 453156 146792 > Regards, Martin Maechler, ETH Zurich

Re: [R] Strange behaviour of as.integer()

2010-01-11 Thread Martin Maechler
nite* precision not just arbitrary precision, or then *symbolic* computation, as I assume the following does MT> However, Wolfram Alpha will return the correct answer: MT> http://tr.im/1plus1equals2 BTW: I see that I seem to have forgotten to upload the somewhat n

Re: [R] sparseM and kronecker product_R latest version

2010-01-11 Thread Martin Maechler
ssia As a side note: As co-author of R package 'Matrix' in to which we have put a large amount of work and which is nowadays a recommended package (i.e., also part of every R distribution), I do wonder why you don't use 'Matrix' for sparse matrix computing in R. Best regar

Re: [R] Problem with expand.grid

2009-12-23 Thread Martin Maechler
"y" "t" "Batch" "T" ... ..$ dimnames:List of 7 .. ..$ y: chr "y=4.75587" "y=4.84510" "y=5.04139" "y=4.85733" ... .. ..$ t: chr "t= 0" "t= 48" "t=144" "t=192&qu

Re: [R] Odp: Loop counter used in variable

2009-12-15 Thread Martin Maechler
> "PP" == Petr PIKAL > on Tue, 15 Dec 2009 09:03:11 +0100 writes: PP> Hi PP> r-help-boun...@r-project.org napsal dne 15.12.2009 00:25:10: >> >> Hi All, >> >> I need to run muliple lm functions. My independent variables are called >> dataset$x1, x2, x3,

Re: [R] fast matrix-vector multiplication

2009-12-14 Thread Martin Maechler
and a data frame. With > library(Matrix) > example(sparse.model.matrix) you get a few (small sample) examples. Martin Maechler, ETH Zurich GC> -Gray GC> On Monday, December 14, 2009, parkbomee wrote: >> >> >> Hi all, >> >>

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)

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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] 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] 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] 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

<    1   2   3   4   5   6   7   8   9   >