Displaying 20 results from an estimated 20000 matches similar to: "Error:length of dimnames [2] not equal to array extent ?"
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
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,
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],
2009 Jul 03
3
Variable names in lattice XY-plot
Hi,
how can I get a more descriptive text
instead of the variable names in my XY-lattice plot,
according to the table below?
Variable text
acet = "Acetylaspartate Thalamus"
chol = "Choline Thalamus"
acetp = "Acetylaspartate parieoc"
ino = "Inositole Thalamus"
I could not find a solution.
Please have a look at my syntax.
Thanks a lot,
2009 Jun 17
2
Re gression by groups questions
I have a large dataset grouped by a factor and I want to perform a regression
on each data subset based on this factor. There are many ways to do this,
posted here and elsewhere. I have tried several. However I found one method
posted on the R wiki which works exactly as I want, and I like the elegance
and simplicity of the solution, but I don't understand how it works. Its
all in the formula
2009 Jun 23
1
How to exclude insignificant intercepts using "step" function
I posted this question way down at teh end of another thread realted to an
error in step, but that was stupid since it really is another matter
altogether. I should have posted it separately, as I have now done.
The code below creates a data.frame comprising three marginally noisy
surfaces. The code below (including a fix courtesy of David Winsemius that
avoids a step function error through use
2004 Sep 27
8
cannot assign dimnames
Dear list,
If anyone knows how to assign dimnames to matrices or arrays I would be most
grateful for help. I've tried various permutations of likely-looking code
but get error messages every time. I could find no example in the
documentation.
Many thanks,
Dan Bebber
Department of Plant Sciences
University of Oxford
South Parks Road
Oxford OX1 3RB
UK
Tel. 01865 275000
2013 Mar 28
2
ggplot2: less than equal sign
Hi
I am trying to add a less than equal sign to a plot. I have previously done
this using unicode but is not working in this instance. Any suggestions
would be great
thanks
example code:
library(ggplot2)
df<-data.frame(vis=c(0,0,1,1) , count=c(10,15,20,10) , grp=c(0,1,0,1))
df$grp <-factor(df$grp ,levels=c(0,1) , labels =c("x \u2265 10" , "x > 10"))
ggplot(df,
2009 Jul 23
1
Winbind issue connecting to trusted domain controllers
Hi.
The quick question: Is there a way of forcing a Samba server that is an Active Directory member server to limit lookups to it's local domain only and not all trusted domains?
The question in more detail:
I have a Samba server that is joined to my local AD domain ("css.ad.example.com"). There are other domains under ad.example.com such as lps.ad.example.com and
2011 Aug 21
1
Multiple R linear models into one Latex table
Dear community,
I had been looking for an easy way to produce latex tables from R
output. xtable() and the package apsrtable produce good outputs but they are not
exactly what I was looking for.
I wrote this code that generates regression tables from multiple R
linear models. I want to share it because it might be
useful for someone else, and because I would appreciate comments on how to
2005 Jun 10
2
Error with function lda in package MASS (dimnames not equal?)
This question appears to have been asked previously, but not answered.
the last response I can find to this previous thread is here:
http://tolstoy.newcastle.edu.au/R/help/04/07/0126.html. The asnwer was
to provide debugging info, not an answer.
So the problem is that I'm trying to use lda on my dataset. You can
download my data here:
http://northstar-www.dartmouth.edu/~jgilbert/nolda, I used
2006 May 08
1
performing functions on variables of different length
I am hoping for some assistance with a problem that has puzzled me.
Immediately below is the error messages I obtained when I tried to perform
two functions.
(A)
tapply(outcome,na.rm=T,grp,mean)
Error in tapply(outcome, na.rm = T, grp, mean) :
arguments must have same length
+++++++++++++++++++++++++++++++++++++++++++++++
(B)
library(nlme)
> anova(lme(outcome ~ grp * time,
2008 Jan 04
3
slow access to matrix dimnames
hello,
i have been trying to convert my data frames to matrices in the hopes of
speeding up some of my more complicated scripts.
to assist with this, i am trying to create a "matrix column operator"
like $:
"%$%" = function(data,field) {
as.numeric(data[,grep(field,unlist(dimnames(data)[2]))])
}
the idea here is that you can use a matrix like a dataframe:
2005 Mar 16
1
Code to replace nested for loops
Dear list members,
How can I replace the nested for loops at then end of the script
below with more efficient code?
# Begin script__________________________________________________
# Dichotomous scores for 100 respondents on 3 items with
# probabilities of a correct response = .6, .4, and .7,
# respectively
x1 <- rbinom(100,1,.6)
x2 <- rbinom(100,1,.4)
x3 <- rbinom(100,1,.7)
#
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")
2013 Feb 23
2
assign index to colnames(matrix)
Hello, I’m trying to follow the syntax of a script from a journal website. In order to create a regression formula used later in the script, the regression matrix must have column names “X1”, “X2”, etc. I have tried to assign these column names to my matrix ScoutRSM.mat using a for loop, but I don’t know how to interpret the error message. Suggestions? Thanks, Paul
1999 Dec 23
1
data.frame(I(matrix)) ? (PR#388)
I observe dificulties with using data.frame(I(matrix))
> mat <- matrix(letters, 2, 2)
> dimnames(mat) <- list(c(1:2), c("x","y"))
> mat
x y
1 "a" "c"
2 "b" "d"
> dd <- data.frame(I(mat))
> ddd
I.mat..x I.mat..y
1 a a
2 b b
3 c c
doesn't look too bad,
but,
has