similar to: array() ignores illegal non-list dimnames

Displaying 20 results from an estimated 10000 matches similar to: "array() ignores illegal non-list dimnames"

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 >
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
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,
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 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
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]
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
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
2018 Mar 17
2
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
Created a new data set with 3 numeric variable to find correlation CR1<- mar%>% as_data_frame%>% select(AGE, OLD_CAR_PURCHASE_YRS, Total.Spend.With.AA) had to convert it to a data frame, code: as.matrix(as.data.frame(CR1)) Now i need to run a correlation plot for these 3 variables: corrplot(CR1, method = "circle") But i am getting this error: Error in
2018 Mar 17
0
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
I'm assuming you are using the corrplot package. If so, your data object does need to be a matrix, not a data frame. Since it's already a data frame, your line of code: as.matrix(as.data.frame(CR1)) doesn't need the as.data.frame function, but more importantly, you didn't assign the result to anything: as.matrix() does not work in place. CR1 <- as.matrix(CR1) Now try. If
2011 Nov 21
1
readDGE: Error in colnames/length of dimnames not equal to array extent
Hello, all, I'm a new R user (new to any programming language in general, really), so I apologize if this is easy/has already been answered (I've attempted searching online but did not understand the pages I found). My data is stored in text files with the headers LANE, RNA_NAME, SEQ, and SEQCNT. I've been using x = "filename.txt" y = aggregate(x$SEQCNT, list(x$RNA_NAME),
2018 Mar 17
0
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
That does clarify for me that you're missing a step: I didn't clearly follow your description at first. corrplot expects a correlation matrix, not your original data. You need to use cor() first. That's pretty clear in the documentation. See for instance the examples: data(mtcars) M <- cor(mtcars) corrplot(M) Sarah On Sat, Mar 17, 2018 at 12:00 PM Shivi Bhatia <shivipmp82 at
2007 Aug 18
1
Suspected memory leak with R v.2.5.x and large matrices with dimnames set
Hi - Admittedly, this may not be the most sophisticated memory profiling performed, but when using unix's top command, I'm noticing a notable memory leak when using R with a large matrix that has dimnames set. To allow people to reproduce the problem I'm seeing, I've added a small (< 50 lines) code snippet at the end of this email. I'm seeing this
2007 Aug 18
1
Suspected memory leak with R v.2.5.x and large matrices with dimnames set
Hi - Admittedly, this may not be the most sophisticated memory profiling performed, but when using unix's top command, I'm noticing a notable memory leak when using R with a large matrix that has dimnames set. To allow people to reproduce the problem I'm seeing, I've added a small (< 50 lines) code snippet at the end of this email. I'm seeing this
1998 Sep 09
2
diag() losing dimnames
Using diag() to extract the diagonal of a matrix loses all but the first dimname (R 0.62.3). The problem seems to be in [ ]: > > x <- matrix(1:9,3,3) > dimnames(x) <- list(c("a", "b", "c"), c("a", "b", "c")) > x a b c a 1 4 7 b 2 5 8 c 3 6 9 > diag(x) a NA NA 1 5 9 > x[c(1,5,9)] a NA NA 1 5 9 > Paul
2008 Mar 15
3
empty array
Hi the list Is it possible to create an empty matrix ? I do not mean an matrix with a single value that is NA (which is not empty) but a real empty one, with length=0. I do not understand why we have length(numeric()), length(factor()) and length(character()) to zero, and length(array()) to one... Any rason for that ? Thanks Christophe
2012 Aug 13
4
dimnames in an array(I'll be grateful if this message will be passed to all list users)
Hello, I'm hoping someone with a wide experience with R may be able to see what the program is trying to tell me. I've got an array: y1=rnorm(41,0.2) y2=rnorm(41,0.2) y3=rbind(y1,y2) data11<-array(0,c(41,2,2)) data11[,1,]=y3 data11[,2,]=y3 rownames(data11)<-rownames(data11, do.NULL = FALSE, prefix = "Obs.") colnames=c("V","R")
2018 Mar 17
3
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
Hi Sarah, Thank you for your help. I tried using CR1<-as.matrix(CR1) but gives error Error in corrplot(CR1, method = "circle") : The matrix is not in [-1, 1]!. I am using a corrplot library. Please find the reproducible example: dput(head(CR1,10)) structure(c(26L, 46L, 39L, 38L, 47L, 59L, 56L, 61L, 43L, 60L, 78L, 63L, 2L, 58L, 8L, 1L, 1L, 9L, 11L, 2L, 1037500L, 46747L, 346300L,
2012 Jun 19
1
weird --no 'dimnames' attribute for array-- error for R lordif package
Hi All, ? I am trying to use the lordif package in R and can't figure out the reason for the above error when I try to run the calctheta() function. ################## # read data using foreign package - must be Stata 11 or earlier racedata<- read.dta("race.dta")??? # item responses resp.data<-racedata[,-c(1:2)] # grouping variable is in the second column
2010 Oct 06
1
replaces a matrix of "NA"s in an array with the previous matrix with numbers
Dear list, Does anyone know if there is a function that replaces a matrix of "NA"s in an array with the previous matrix with numbers? For example, I have an array ab <- array(dim=c(3,3,15),dimnames=list(rows=1:3,cols=1:3,dim=times)) . Select out put from the array is: , , dim = 0.478356969557745 cols rows 1 2 3 1 0.4921053 0 0.5078947 2 0.0000000 0