similar to: exists() and the mode argument (PR#576)

Displaying 20 results from an estimated 40000 matches similar to: "exists() and the mode argument (PR#576)"

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 =
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
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 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 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 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
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 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
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
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
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
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
2001 Aug 14
1
Inconsistent behaviour of is.vector? (PR#1052)
Hi everyone, I have noticed that is.vector returns FALSE if I attach attributes: > x <- c(a = 1, b = 2) > attributes(x) $names [1] "a" "b" > is.vector(x) [1] TRUE > attr(x, "fred") <- "happy" > attributes(x) $names [1] "a" "b" $fred [1] "happy" > is.vector(x) [1] FALSE This seems inconsistent to me,
1999 Feb 10
1
Function parsing (PR#118)
Is anyone else concerned with the way in which the R function parser relocates comments that occur after condional expressions in functions to before, i.e. fred <- function(x) { # wonder what x is like if (x>0) stop("Sorry non-positive x only") # that showed x big-time! x } but then fred is parsed and stored as "fred" <- function (x) { # wonder what x is