Displaying 20 results from an estimated 10000 matches similar to: "dimnames"
2010 Apr 26
3
Sweave
Hi everybody,
I wanted to use Sweave but I do not have the Latex package:
"LaTeX Error: File 'Sweave.sty' not found."
I cannot find it with MiKTeX :-(
Can somebody help me ?
Thanks a lot,
Jimmy
[[alternative HTML version deleted]]
2010 Apr 26
2
seed
Hi everybody,
How can I set the seed for my simulations ? Is "set.seed(123456)" alright ?
Thanks a lot,
Jimmy
[[alternative HTML version deleted]]
2010 May 18
2
Sweave counter
Dear R users,
I am using the Sweave package and I am doing some MCMC. I have a loop
function for my MCMC. Every 100 iterations, I want the number of iterations
already done to appear on my screen (but not on the final document). Is that
possible ?
Usually I can rely on
> if (i%%100==0) cat(i, "\n")
but not when using Sweave.
Thanks for your help,
Jimmy
[[alternative HTML
2010 Jun 02
2
Sweave glm.fit
Dear R users,
After running Sweave, this is what I get :
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: algorithm did not converge
There is no glm.fit function in my code.
Where does it come from ? From Sweave ? From system.time ?
Thanks for your help,
Jimmy
[[alternative HTML version deleted]]
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
2010 Jun 25
1
dimnames(x) <- dn error
Hi ,
I want to assign names to the rows in my matrix so that when I use the
'agnes' function from R cluster package , the dendogram that is produced
represents the rows of the matrix. This way I would know what elements in
the matrix are clustered together. But when I do the following,
rownames(distF) <- paste("A",dim(distF)[1])
it gives the following error;
Error in
2023 Oct 29
1
dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)
Hello,
the fix of PR18612 (https://bugs.r-project.org/show_bug.cgi?id=18612)
in r85380 (https://github.com/wch/r-source/commit/2653cc6203fce4c48874111c75bbccac3ac4e803)
caused a change in `dim<-()`. Specifically, in the past, any
`dim<-()` assignment would _always_ remove "dimnames" and "names"
attributes per help("dim"):
The replacement method changes
2001 Aug 07
1
cannot assign to NULL dimnames (PR#1042)
Full_Name: Hsiu-Khuern Tang
Version: 1.3.0
OS: GNU/Linux (Debian unstable)
Submission from: (NULL) (192.6.19.124)
Hi all,
I am not sure this is a bug rather than an intentional design, but here
goes:
If I do
> a <- matrix(1:4, nrow=2)
> dimnames(a)[[1]] <- c("a", "b")
I get the following error message because dimnames(a) is NULL:
Error: more elements
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
>
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
2023 Oct 30
2
dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)
>>>>> Henrik Bengtsson
>>>>> on Sun, 29 Oct 2023 10:42:19 -0700 writes:
> Hello,
> the fix of PR18612
> (https://bugs.r-project.org/show_bug.cgi?id=18612) in
> r85380
> (https://github.com/wch/r-source/commit/2653cc6203fce4c48874111c75bbccac3ac4e803)
> caused a change in `dim<-()`. Specifically, in the past,
2006 Dec 14
3
Delete all dimnames
Hello, how can I get rid of all dimnames so that:
$amat
Var3 Var2 Var1
8 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
7 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0
6 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0
5 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0
4 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0
3 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0
2 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0
2010 Jul 26
2
the real dimnames
Hi,
R seems to have a feature that isn't used much, which I don't really
now how to call. But, the dimnames function, can in addition to giving
names to rows/columns/dim 3 rows/dim 4 rows... can also give labels to
the dimensions themselves.
Thus, I can do:
A = matrix(1:9,3,3)
dimnames(A) = list(from=c(), to=c() )
and now, printing a prints these dimension labels nicely:
> A
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]
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
2008 May 08
3
Setting matrix dimnames in a list
Hey All,
I was wondering if I could solicit a little input on what I'm trying to
do here. I have a list of matrices, and I want to set their dimnames,
but all I can come up with is this:
x <- matrix(1:4,2)
y <- matrix(5:8,2)
z <- list(x,y)
nm <- c("a","b")
nms <- list(nm,nm)
z <- lapply(z,function(x)dimnames(x)<-nms)
As you can see, this
2006 May 12
1
Dropping dimnames doesn't matter (anymore)?
In the "old days", one way of speeding up matrix calculations was to
drop the dimnames of the matrices prior to the calculations, i.e.,
dimnames(X) <- NULL. I distinctly remember that this could have a
great impact at least in Splus 3.x (under UNIX/Linux).
I just did a small, informal test of this with a couple of functions I
use to fit plsr models, in R 2.3.0 (Linux). It
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
2011 Apr 20
1
Error in dimnames(x) for Poisson EWMA model
I am attempting to run a Poisson EWMA model using Patrick Brandt's source code. I get the following error when I run the code:
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
Dimnames(x) looks like this:
[[1]]
NULL
[[2]]
[1] "mip" "div" "nom" "unity" "mood"
2001 Oct 09
1
dimnames(X)[[2]] <- foo fails (PR#1122)
Since this works in recent S-PLUS and is not in the FAQ as a difference, I
presume it is an unintentional one. If it is intentional, this is for the
wishlist that this be removed.
S-PLUS (6.0)
> X <- matrix(1:4, 2, 2)
> dimnames(X)[[2]] <- letters[1:2]
> X
a b
[1,] 1 3
[2,] 2 4
R 1.3.1
> X <- matrix(1:4, 2, 2)
> dimnames(X)[[2]] <- letters[1:2]
Error: more