Displaying 20 results from an estimated 10000 matches similar to: "Strange behaviour of image (PR#510)"
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
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,
2000 Mar 22
3
segmentation fault with 1D array (PR#500)
Here's a nasty one. The following has caused a segmentation
fault and possibly also a bus error.
fred <- 1:6
dim(fred) <- 6
dimnames(fred) <- list(LETTERS[1:6])
mm <- matrix(1:12, 2, 6)
mm %*% fred # segmentation fault here
In the case without the dimnames assignment the result is OK.
Cheers, Jonathan.
--please do not edit the information below--
Version:
platform =
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
2000 Oct 13
2
syntax confusion with function/non-function objects (PR#694)
I'm just back from a computer practical where we ran into
> "f" <- function(x) 2(x^2) # for 2 * x^2
This definition was taken as legitimate, although using the
function generated the error message
> f(3)
Error in f(3) : attempt to apply non-function
Am I right in thinking that in prevous versions of R this
definition would have been declared as a syntax error? Surely a
2000 Oct 13
2
Cautionary tale about c (PR#695)
This situation arose in a computer practical this morning. A
student overwrote "c" with a function. This messes up lots of
things, but it is difficult to remove the function "c" from the
global environment because it is used as a function in both "rm"
and "remove". [The solution was to reassign "c" as a number, and
then remove it.] Would it be
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 Jun 20
1
exists() and the mode argument (PR#576)
The following seems to be odd behaviour:
fred <- 1:10
mode(fred) # "numeric"
exists("fred") # TRUE
exists("fred", mode="numeric") # FALSE
Unless I have misunderstood, the final evaluation should be TRUE,
as an object called "fred" exists and its mode is "numeric". In
the same category, I have just noticed that
get("fred")
2001 Apr 30
1
Segmentation fault linked to memory? (PR#929)
Hi Everyone,
The following rather extreme claim on memory causes a
segmentation fault on my installation:
fred <- matrix(1:1200, 20, 60)
littleOP <- function(x, y)
{
z <- as.vector(x) %*% t(as.vector(y))
dim(z) <- c(dim(x), dim(y))
z
}
littleOP(fred, fred) # this is OK
littleOP(littleOP(fred, fred), fred) # whoops! Segmentation fault
What's a bit strange
2001 Apr 10
1
Segmentation fault in subscripting array of lists (PR#904)
I get a segmentation fault as follows:
> tmp <- array(list(), c(3, 4))
> tmp[[1, 2]]
NULL # as expected
> tmp[[1, 2]]$fred <- 1:10
> tmp # as expected
[,1] [,2] [,3] [,4]
[1,] "NULL" "List,1" "NULL" "NULL"
[2,] "NULL" "NULL"
2000 Oct 16
2
print problem with data frames (PR#698)
Another one from the student computer practicals: it is possible
to create a dataframe that cannot be printed. Thus
> fred <- data.frame(happy=c(TRUE, FALSE, TRUE), sad=7:9)
> tmp <- fred[c(FALSE, FALSE, TRUE, TRUE)] # no error message!
> tmp
Error in as.matrix.data.frame(x) : dim<- length of dims do not match the length of object
> print.default(tmp)
$"NA"
NULL
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
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 +
2005 Jan 11
2
Changing the ranges for the axis in image()
Dear all,
I can not find/understand the solution to this from the help pages:
Say we have the following script:
x<-matrix(c(1,1,0,1,0,1,0,1,1),3,3)
image(x)
How can I change the ranges on the vertical and horizontal axis to a
range of my own or at least place a box frame around the image if I
choose to use "axes=FALSE"?
Apologies for such a bsic question and thanks beforehand
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 Jun 17
1
save.image() (PR#212)
Jonathan Rougier <J.C.Rougier@durham.ac.uk> writes:
> 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 believe this is simply a bug. I see no reason to skip the
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 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
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
2005 Mar 03
1
image() z-values beyond zlim
Dear useRs,
When plotting with image(), I would like the z-values
that extend beyond the upper zlim to be indicated with
one colour, or preferably with som sort of hatching,
as I'm printing in black and white. By default these
values just show up as blank areas in the image. I've
tried all sorts of things, but nothing seems to work
for me.
Any solutions would be greatly appreciated.