Displaying 20 results from an estimated 20000 matches similar to: "save.image() (PR#212)"
1999 Mar 25
1
plot.formula and pch= (PR#149)
I'm not sure exactly where to point my finger with this one, but there
is a nasty surprise to the unsuspecting user.
There is no check on the length of the vector passed in the pch=
argument to plot, it is just recycled as necessary:
plot(1:10,1:10,pch=1:2)
gives alternating circles and triangles.
The nasty bits come up especially with plot.formula:
x<-1:10;y<-1:10
1999 Nov 03
1
Dimnamenames (PR#257)
I've just started digging into Andreas's old report:
> a <- array(0,c(2,2,2));
> dimnames(a)<-list(hansi=1:2, pepi=c("a","b"), karli=3:4)
> dimnames(a[,,1]) # losing component names
[[1]]
[1] "1" "2"
[[2]]
[1] "a" "b"
Now, this would be fairly easily fixed (I think) which would also make
it compatible with S3.
1999 Jun 17
0
save.image()
Would it be reasonable to suggest adding an `all' flag to save.image(),
i.e.
"save.image" <-
function (f = ".RData", all.names = F)
eval(substitute(save(list = ls(all.names = all.names), file = f)),
.GlobalEnv)
I only ask because I keep losing my .First() function. I would like to
start R in a particular directory and have it configure according to the
First()
1999 Aug 18
2
diag()
I would like to suggest a slight modification to diag(). In the case
where x is a matrix with both row names and column names the same, it
would be reasonable if the resulting vector also had those names. I often
use diag() on variance matrices, where this modification is helpful.
The modification requires replacing
if (is.matrix(x) && nargs() == 1)
return(c(x)[1 +
2002 Nov 22
4
Small change to plot.xy
Hi everyone,
Is there any reason why we should not automatically coerce a factor
supplied as an argument to col in a plotting function? The following
modification (to R-1.6.1) seems pretty harmless
> plot.xy
function (xy, type, pch = 1, lty = "solid", col = par("fg"),
bg = NA, cex = 1, ...)
{
if (is.factor(col))
col <- codes(col)
2000 Mar 01
1
"is.qr" definition (PR#465)
Might it be possible to tighten the definition of "is.qr". I
noticed that after I mistakenly typed
example(lm) # make lm object named lm.D9
qr.Q(lm.D9)
which exhausted the heap memory and produced two warning
messages. As an object of class "lm" has a "qr" component,
"is.qr" failed to detect that "lm.D9" was not a "qr" object. The
2001 Apr 11
5
replicating lists
Hi Everyone,
At the moment it is not possible to replicate complex lists, but only
simple ones:
> rep(list(fred = 1:10), 10) # works fine
> rep(list(fred = 1:10, happy = "squash"), 10)
Error in rep(list(fred = 1:10, happy = "squash"), 10) :
Unimplemented feature in rep
There is nothing in ?rep that suggests that the latter should not work,
and I think it would
2002 Oct 08
3
hash argument of new.env()
Hi everyone,
There is no mention in ?new.env (R-1.6.0) of what the effect of setting
the hash argument of new.env() actually does. What does it mean in
performance terms to say that "the environment will be hashed"?
Thanks, Jonathan.
--
Jonathan Rougier Science Laboratories
Department of Mathematical Sciences South Road
University of Durham
1999 Aug 25
2
Error in ?text (PR#256)
Just a minor point, but the adj argument in ?text is described wrongly
(0.64.1). Perhaps the following might be added to the details.
Values of 0, 0.5, and 1 specify left/top, middle and right/bottom,
respectively. The default is for centred text, ie \code{adj = c(0.5,
0.5)}.
Cheers, Jonathan.
Jonathan Rougier Science Laboratories
Department of
1999 Nov 04
2
New codes() methods
Hi Everyone,
Can I suggest a couple of new `codes' methods. I know codes is a bit
dodgy (at least, according to the comments in codes.factor), but for what
it's worth I like to extract codes from data frames of factors, for which
the following two functions (which operate recursively) are helpful:
"codes.default" <-
function(x)
{
if (is.list(x))
lapply(x, codes)
2000 Feb 01
2
Segmentation fault in recursion, 0.90.1 (PR#409)
The following gives an immediate segmentation fault, v 0.90.1
"fred" <- function(x) { print(x); Recall(x-1)}
fred(0) # segmentation fault at recursion 831
Obviously this recursion is non-terminating, but shouldn't it be caught
and reported at some limit? In 0.64.1 we had
Error: protect(): stack overflow
at recursion 831. Cheers, Jonathan.
Jonathan Rougier
2002 Feb 20
1
Pivoting in chol
Hi Everyone,
I have modified my version of R-1.4.1 to include choleski with pivoting
(like in Splus). I thought R-core might consider including this in the
next version of R, so I give below the steps required to facilitate
this.
1. Copied Linpack routine "dchdc.f" into src/appl
2. Inserted line F77_SUBROUTINE(dchdc) in src/appl/ROUTINES
3. Inserted "dchdc.f" into
1999 Feb 17
1
dim enquiry
This is a minor question, but is there any difference between the two
objects
fred <- structure(1:10, dim = c(2,5))
and
fred <- structure(1:10, .Dim = c(2,5))
Should I be using one rather than the other? Thanks, Jonathan.
Jonathan Rougier Science Laboratories
Department of Mathematical Sciences South Road
University of Durham Durham DH1 3LE
1999 Jan 14
1
libraries
Am I right in thinking that there a discrepancy between the ?library
documentation and the library() function? If I have a library called
"patches", then according to the documentation (0.62.4) patches/R should
contain source files like fred.R and george.R, but in practice the library
only loads if both fred.R and george.R are given in a file called patches
in the R subdirectory of
2000 Nov 10
1
Modification to cov and cor
Can I suggest that in cov and cor the lines
if (is.data.frame(x))
x <- as.matrix(x)
if (is.data.frame(y))
y <- as.matrix(y)
be replaced by
if (is.data.frame(x))
x <- data.matrix(x) # coerce logical and factors
if (is.data.frame(y))
y <- data.matrix(y) # likewise
This would allow things like
> data(iris)
> cor(iris)
which
2002 Mar 15
1
Thought on crossprod
Hi everyone,
I do a lot of work with large variance matrices, and I like to use
"crossprod" for speed and to keep everything symmetric, i.e. I often
compute "crossprod(Q %*% t(A))" for "A %*% Sigma %*% t(A)", where
"Sigma" decomposes as "t(Q) %*% Q". I notice in the code that
"crossprod", current definition
> crossprod
function (x,
2002 Aug 20
1
NA and help page for "&" and "|"
Hi everyone,
Can I suggest an addition to the help page for logical AND and OR,
indicating the behaviour of NA (which is currently not mentioned at
all). I think something simple like an extra paragraph in Details, eg
\code{NA} is a valid logical object. Where a component of \code{x} or
\code{y} is \code{NA}, the result will be \code{NA} if the outcome is
ambiguous. In other words \code{NA
1999 Jul 20
2
tensor() function and sets
Hi Everyone,
To complete the outer() and kronecker() functions in the base, may I
suggest the following tensor() function, which allows the multiplication
of arrays through sets of conformable dimensions. I am happy to write a
help page if required.
The code also needs a setdiff() function which prompts me to ask: what
about simple set functions? I expect many of us have written our own
2000 Jan 04
2
set functions
I wonder if we might also include an "equiv" function along with the other
set functions (ie "union", "intersect", etc), perhaps along the lines of
"equiv" <- function(x, y) all(c(match(x, y, 0)>0, match(y, x, 0)>0))
(which I think might be the quickest implementation). I use this type of
function quite frequently: is there some reason why it is
2000 Jan 04
2
set functions
I wonder if we might also include an "equiv" function along with the other
set functions (ie "union", "intersect", etc), perhaps along the lines of
"equiv" <- function(x, y) all(c(match(x, y, 0)>0, match(y, x, 0)>0))
(which I think might be the quickest implementation). I use this type of
function quite frequently: is there some reason why it is