similar to: Inconsistent behaviour of is.vector? (PR#1052)

Displaying 20 results from an estimated 60000 matches similar to: "Inconsistent behaviour of is.vector? (PR#1052)"

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 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 =
2002 Oct 11
1
Odd outcome of attr with environments (PR#2148)
Hi everyone, I think the following error is slightly odd: > fred <- new.env() > happy <- function() fred > happy() <environment: 0x8a425b8> > attr(happy(), "foo") <- 1:10 Error: invalid (NULL) left side of assignment But naturally this works > attr(fred, "foo") <- 1:10 > fred <environment: 0x8a425b8> attr(,"foo") [1] 1
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
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
2002 Jan 04
2
Problem with "missing" in "local" (PR#1241)
Hi everyone, I encountered unexpected behaviour when calling "missing" within a "local" environment, namely fred <- function(x, y) { x <- as.vector(x) local({ dontwantme <- 1:100 if (missing(y)) print("No \"y\" today") }) x } whereupon I get > fred(1:10) Error in eval(expr, envir, enclos) : "missing" illegal use of
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 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 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,
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
1999 Oct 08
1
dimnames and subscripting (PR#293)
I am not sure that this is a bug, but it was unexpected -- of course my expectations are fallible, eg column ordering in model.matrix()! When an array is subscripted the names of the dimnames list are lost (v 64.1). fred <- array(1:12, 2:4, list(A = letters[1:2], B = letters[3:5], C = letters[6:9])) dimnames(fred) dimnames(fred[1, , ]) dimnames(fred[1, , , drop=FALSE]) In the first
2002 May 03
1
Behaviour of environment(foo)<- (PR#1509)
Hi Everyone, I've noticed that setting the environment of a function from a package actually creates a copy of that function in .GlobalEnv and sets the environment on this copy: > find(.profile) [1] "package:newblips" > environment(.profile) <- bb1$getEnv() # this is an environment > find(.profile) [1] ".GlobalEnv" "package:newblips" I
1999 Oct 26
1
dodgy list operation (PR#298)
I can generate a segmentation fault as follows, where I would expect a syntax error: fred <- as.list(1:10) lapply(fred, "[[") platform sparc-sun-solaris2.5.1 arch sparc os solaris2.5.1 system sparc, solaris2.5.1 status status.rev 0 major 0 minor 64.1
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 07
2
Core dump with "parse" (PR#2120)
Hi everyone, The following code may not be very sensible, but it generates a core dump. The same happens in R-1.5.1. Cheers, Jonathan. arrow:dma0jcr% R-1.6.0 R : Copyright 2002, The R Development Core Team Version 1.6.0 (2002-10-01) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()'
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
2003 Mar 27
1
Deprecated component in plot.histogram (PR#2696)
Hi everyone, As "intensities" is deprecated as a synonym for "density" in the output of hist it would be a good idea to replace its occurence with "density" in plot.histogram, where we currently have y <- if (freq) x$counts else x$intensities Note that, to add to the confusion, x$density is also referred to in plot.histogram. Cheers, Jonathan.
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 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,