Displaying 20 results from an estimated 6000 matches similar to: ".Alias and memory"
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 +
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)
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 Jan 22
1
backsolve... --> class()es for special matrices ?
>>>>> "JonR" == Jonathan Rougier <J.C.Rougier@durham.ac.uk> writes:
JonR> ... By the way, I have `solve'
JonR> methods for triangular matrices and variance matrices -- would
JonR> you be interested?
{ Jonathan, I hope it's okay if I CC this to R-devel;
this must be of a wider interest }
Ye.e..s;
for triangular ones,
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 Mar 11
3
R and kron
I note that the CRAN at .at land still refers to 0.63.2. Is this just a
typo? I don't want to download a whole lot only to find I still have it!
Does 0.63.3 live elsewhere?
And I note the new function kronecker - very useful but can it be applied
to non-numerics as in factors, data frames etc preserving the class,
levels and names?
John
1999 Mar 11
3
R and kron
I note that the CRAN at .at land still refers to 0.63.2. Is this just a
typo? I don't want to download a whole lot only to find I still have it!
Does 0.63.3 live elsewhere?
And I note the new function kronecker - very useful but can it be applied
to non-numerics as in factors, data frames etc preserving the class,
levels and names?
John
1999 Dec 07
4
Finding indices with a certain property
I want the indices i for which x[i] < 0 (say):
> x <- c(1, -1, 3, 3, -2)
> where.negative(x)
[1] 2 5
Surely where.negative is something simple, but how?
G?ran
--------------------------------------------------------------
G?ran Brostr?m
Department of Statistics tel: +46 90 786-5223
Ume? University fax: +46 90 786-6614
S-90187 Ume?, Sweden
1999 Dec 07
2
Reply to list policy
I wonder if it isn't time to change the reply-to-list policy of R-help
and adopt the alternative convention of replying to the author and asking
him/her to summarize to the list.
Recently R-help has been too busy for me to keep up with. There were
quite a few identical responses in the "Finding indices with a certain
property" thread, rather than an extended discussion. I think
1999 Dec 21
2
generating a sequence
Hi everyone
I'm trying to generate a vector of the form
a <- c(1,2,3,4,1,2,3,1,2,1) where n = 5
in a general way, where n can be any positive integer.
I've run out of ideas. Does anyone have any suggestions?
Thanks
Karen
Karen Kotschy
Centre for Water in the Environment
University of the Witwatersrand
Johannesburg
Tel: 011 716-2218
1999 Dec 21
2
generating a sequence
Hi everyone
I'm trying to generate a vector of the form
a <- c(1,2,3,4,1,2,3,1,2,1) where n = 5
in a general way, where n can be any positive integer.
I've run out of ideas. Does anyone have any suggestions?
Thanks
Karen
Karen Kotschy
Centre for Water in the Environment
University of the Witwatersrand
Johannesburg
Tel: 011 716-2218
1999 Jun 14
2
Include file changes
I think we are long overdue for a revision of the header files used in R.
This is going to be especially important for a clean build of the CORBA
and R/Java stuff which I have been looking over Duncan's shoulder at.
It will also let us integrate some of the features Duncan has had to
find creative ways around and also to let us integrate things like the
PROBLEM buffer problem.
I would propose
1999 Sep 20
3
image legend
Dear R users,
Does anyone have a function for putting a legend on an image
plot? I couldn't locate an R equivalent of image.legend....has
anyone written such a thing?
kind regards
andy
---------------------------------------------------------------------
J. Andy Royle, U.S. Fish and Wildlife Service - Office of Migratory
Bird Management; 11510 American Holly Drive , Laurel, MD
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)
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
2000 May 19
7
variance of a scalar (PR#546)
I was surprised to find that the variance of a scalar, using
var(), is NA. Surely this should be zero?
Cheers, Jonathan.
--please do not edit the information below--
Version:
platform = sparc-sun-solaris2.7
arch = sparc
os = solaris2.7
system = sparc, solaris2.7
status = Patched
major = 0
minor = 99.0
year = 2000
month = February
day = 9
language = R
Search Path:
.GlobalEnv,
2001 Jan 09
3
Inconsistent behaviour in solve (PR#805)
I find this a bit puzzling ...
> solve(matrix(c(5, 2, 3, 1), 2, 2), c(Inf, 3))
[1] NaN Inf
> solve(matrix(c(5, 2, 3, 1), 2, 2)) %*% c(Inf, 3)
[,1]
[1,] -Inf
[2,] Inf
I would expect the answer to be c(-Inf, Inf), so why has the -Inf
been replaced by NaN in solve?
Cheers, Jonathan.
--please do not edit the information below--
Version:
platform = sparc-sun-solaris2.7
arch = sparc
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
2000 Apr 06
2
Strange behaviour of image (PR#510)
The following commands
z <- matrix(seq(0, 1, len=1000))
image(z, 1, z, zlim=c(0, 1), col=gray(1:10/10))
appear to violate the image functionality as described on the
help page. As I understand it, by specifying a zlim of c(0, 1)
and a colour vector of length 10, the colours should correspond
to the intervals (0, 0.1), (0.1, 0.2), ..., (0.9, 1.0), this
being 10 equally-spaced intervals on (0,