similar to: empty array indexing with dimnames (PR#2507)

Displaying 20 results from an estimated 10000 matches similar to: "empty array indexing with dimnames (PR#2507)"

2003 Jan 30
0
empty array indexing with dimnames -> erroneous error (PR#2507)
This is a bug that will not often trigger, and only happens for arrays (but not matrices) ending up with 0 dimensions: The following code also shows two 'buglets' (the first even for matrix indexing) where "drop = TRUE/FALSE" is not correctly obeyed. One can argue that since all these arrays have length zero, it shouldn't matter what dimensions they get. [But this
1997 Nov 28
3
R-alpha: Problems with dimnames and names
This message is in MIME format --_=XFMail.1.1.p0.Linux:971128122615:3052=_ Content-Type: text/plain; charset=us-ascii I have rounded up three buglets in R-0.50-a4. Two of them I can fix and a patch is supplied below. I hope this is useful for the current source (if these haven't been fixed already :) 1) cov cov() fails when it's argument is a matrix with one column and with column names
2011 May 16
1
Extracting the dimnames of an array with variable dimensions
Hi list, In a function I am writing, I need to extract the dimension names of an array. I know this can be acheived easily using dimnames() but my problem is that I want my function to be robust when the number of dimensions varies. Consider the following case: foo <- array(data = rnorm(32), dim = c(4,4,2), dimnames=list(letters[1:4], LETTERS[1:4], letters[5:6])) # What I want is to extract
2020 Feb 19
0
dimnames incoherence?
>>>>> Serguei Sokol >>>>> on Wed, 19 Feb 2020 15:21:21 +0100 writes: > Hi, > I was bitten by a little incoherence in dimnames assignment or may be I > missed some point. > Here is the case. If I assign row names via dimnames(a)[[1]], when > nrow(a)=1 then an error is thrown. But if I do the same when nrow(a) > 1 >
2004 Jul 02
2
Error:length of dimnames [2] not equal to array extent ?
Hi everyone, I have the following problem: I want to perform a LDA with the function lda(). My data object mat.data is a matrix with dimensions > dim(mat.data) [1] 1228 44 and my grouping vector grp has length 1228: > length(grp) [1] 1228 Every time I call lda(), the following error message occurs: > lda(mat.data,grp) Error in lda.default(x, grouping, ...) : length of dimnames [2]
2005 Feb 11
0
Subsetting using dimnames on S4 array-based class
Hello, I am encountering some problems when overloading the "[" operator for a new S4 class based on array. This is an example class definition: setClass("foo", representation("array"), prototype(array(NA, dim=c(3,3)), dimnames=list(age=1:3, year=10:12)) ) And this the corresponding setMethod with print estatements to see what is being passed:
2010 Mar 16
2
Dimnames of array inside loop
hello R-helpers, I have an array acuracia <- array(NA, dim = c(1, 1, A, B, C)) which is first defined and in the example above with dimensions 1x1xAxBxC. My array is then filled using 3 loops (I am not well familiar yet with lapply or sapply functions so I am still a loop-user): for (i in 1:A){ for (j in 1:B){ for (k in 1:C){ acuracia[,,i,j,k] <- correlacao / (sqrt(ac)) } } } then I
2020 Feb 21
0
dimnames incoherence?
If we change the behavior NULL--[[--assignment from `[[<-`(NULL, 1, "a" ) # gives "a" (*not* a list) to `[[<-`(NULL, 1, "a" ) # gives list("a") then we have more consistency there *and* your bug is fixed too. Of course, in other situations back-compatibility would be broken as well. Would that change the result of L <-
2005 Feb 17
1
Subsetting using dimnames on S4 array-based class
Hello, I did send this message to r-help and got no reply, no I am resubmitting here in case this was a bit too specific for the other list. Many thanks, Iago From: Iago Mosqueira <imosqueira@suk.azti.es> To: r-help@stat.math.ethz.ch Subject: Subsetting using dimnames on S4 array-based class
2007 Oct 26
1
Use of all/any
all/any coerce their arguments to logical (if possible). I've added a warning in R-devel if coercion is from something other than integer. This arose because it is easy to make a slip and write all(X) > 0 rather than all(X > 0): thanks to Bill Dunlap for bringing that to my attention. However, it has been useful in detecting quite a few other things: - indices which had been made
2020 Feb 19
2
dimnames incoherence?
>>>>> Martin Maechler >>>>> on Wed, 19 Feb 2020 18:06:57 +0100 writes: >>>>> Serguei Sokol >>>>> on Wed, 19 Feb 2020 15:21:21 +0100 writes: >> Hi, >> I was bitten by a little incoherence in dimnames assignment or may be I >> missed some point. >> Here is the case. If I assign row names
2015 Dec 17
1
array() ignores illegal non-list dimnames
Is there a reason that array() silently ignores dimnames that are not a list but matrix() gives an error? > str(matrix(11:14, 2, 2, dimnames=c("Rows","Cols"))) Error in matrix(11:14, 2, 2, dimnames = c("Rows", "Cols")) : 'dimnames' must be a list > str(array(11:14, dim=c(2, 2), dimnames=c("Rows","Cols"))) int
2017 Jun 01
2
subletting an array according to dimnames
Hi all, I have a three dimensional array with the corresponding dimension names. I would like to subset the array according to the dimension names. For example, suppose I want to extract the values corresponding to A=20, B=10, C=0. I know I can do: P2[dimnames(P2)$A==20, dimnames(P2)$B==10, dimnames(P2)$C==0] But is there a better way for doing this? Thanks for your help! Hanna >
2017 Jun 02
0
subletting an array according to dimnames
Have you tried P2["20", "10", "0"] ? Jean On Thu, Jun 1, 2017 at 3:10 PM, li li <hannah.hlx at gmail.com> wrote: > Hi all, > I have a three dimensional array with the corresponding dimension names. > I would like to subset the array according to the dimension names. For > example, > suppose I want to extract the values corresponding to A=20,
2007 Dec 14
3
Array dimnames
Dear all, Possibly a rudimentary question, however any help is greatly appreciated. I am sorting a large matrix into an array of dim(p(i),q,3). I put each entry into a corresponding matrix (1 of the 3) based on some criteria. I figure this will assist me in condensing code as I can loop through the 3rd dimension of the array instead of generating 3 separate matrices and using the same block of
2011 Nov 24
0
length of 'dimnames' [2] not equal to array extent
Hello all, I'm trying to use the user-created multinomRob to make some models for my data. While documentation for that function is fine and I think I'm using it correctly, I'm getting the following error when I try to use my lists of variables. data <- read.csv("data.csv", header=FALSE) subj1 <- data.frame(radius=data$V3[9:11], x1=data$V4[9:11], x2=data$V5[9:11],
2012 May 22
1
Naming dimnames in an array using the results of an expression
dear all i'm struggling with naming in an array diag.data is one of a series of 2x2 diagnostic testing arrays, with 'Outcome' columns (true/false) and 'Test' rows (High-risk, Low-risk), drawn from a larger list object of 'results' i can hard-code the names of the array using dimnames; diag.data<-array(c(19,2,125,50),c(2,2)) #example to run - actually comes out
2012 Aug 08
1
dimnames in array
Hello, I'm working with an array; I'm trying to make it so that an array of dim(42,2,2) has names whose length corresponds to that of the array, and am hoping someone with experience with this can see what I'm not doing correctly: data11 = array(0,c(41,2,2)) y = lsoda(x0,times,fhn$fn.ode,pars)#This is make.fhn() from colloc infer package# y = y[,2:3]
2020 Feb 22
2
dimnames incoherence?
>>>>> William Dunlap >>>>> on Fri, 21 Feb 2020 14:05:49 -0800 writes: > If we change the behavior NULL--[[--assignment from > `[[<-`(NULL, 1, "a" ) # gives "a" (*not* a list) > to > `[[<-`(NULL, 1, "a" ) # gives list("a") > then we have more consistency there *and* your bug
2010 Jul 29
0
[R-pkgs] heplots 0.9-3 and candisc 0.5-18 released to CRAN
I've just released the latest R-Forge versions of heplots 0.9-3 and candisc 0.5-18 to CRAN. They should appear there within a day or two. == heplots The heplots package provides functions for visualizing hypothesis tests in multivariate linear models (MANOVA, multivariate multiple regression, MANCOVA, etc.). They represent sums-of-squares-and-products matrices for linear hypotheses and for