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
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
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:
>>
;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
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
>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
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
> 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
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
> "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
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
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, "-
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) } "
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
> 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(
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
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
> "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.
___
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
> 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",
> "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
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 <
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
> 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.
>>
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
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
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
> 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
>>>>> 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:
>
>>>>> 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
>>>>> "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
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
) 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
__
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://
> 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
>> 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
> 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
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)
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
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
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
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
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
__
_" 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
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 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
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
patialPoints"
>> object="Raster", xy="vector"
>> object="RasterLayer", xy="matrix"
>> object="RasterStackBrick", xy="matrix"
>>
>> And now...?
> selectMethod(xyValues,
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
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
(!("..." %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(
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
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:
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 ... }
>>
>
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
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
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
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
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
> "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
> "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
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
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
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
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
> "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
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
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
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
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
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
"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
> "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,
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,
>>
>>
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)
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
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
>>>>> "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
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
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
> "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
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
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
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
_
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
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=','
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
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
> "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
> "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,
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
> "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))
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
:
> 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
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
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
", "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
> "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
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
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
501 - 600 of 823 matches
Mail list logo