similar to: R-beta: dimnames(obj)[..] <- .... works in S but not in R

Displaying 20 results from an estimated 50000 matches similar to: "R-beta: dimnames(obj)[..] <- .... works in S but not in R"

2017 Dec 22
0
Unexpected dimnames attribute returned by cbind/rbind
Hi, > m5 <- cbind(integer(5), integer(5)) > m5 [,1] [,2] [1,] 0 0 [2,] 0 0 [3,] 0 0 [4,] 0 0 [5,] 0 0 > dimnames(m5) NULL No dimnames, as expected. > m0 <- cbind(integer(0), integer(0)) > m0 [,1] [,2] > dimnames(m0) [[1]] NULL [[2]] NULL Unexpected dimnames attribute!
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 <-
2003 Jan 30
1
empty array indexing with dimnames (PR#2507)
On Thu, 30 Jan 2003 maechler@stat.math.ethz.ch wrote: > This is a bug that will not often trigger, and only happens for arrays > (but not matrices) ending up with 0 dimensions: The bug is a missing else branch of an if condition at line 431 of subset.c. I don't think the buglets are wrong. You don't drop length 0 dimensions. If you did, the object would be of the wrong length.
2015 Apr 30
0
dimnames returned by function apply
>>>>> Fischer, Bernd <b.fischer at dkfz-heidelberg.de> >>>>> on Wed, 29 Apr 2015 20:22:44 +0200 writes: > Dear all, > I noticed that the dimnames returned by apply are different in the new release. > In the following example. The returned row-names are c(?S?,?T?), but shouldn?t they be c(?X?,?Y?) as in the old release? Not quite :
2023 Oct 31
1
dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)
Hi Martin, Henrik, I actually like this change. Makes a lot of sense IMO that dim(x) <- dim(x) be a no-op, or, more generally, that foo(x) <- foo(x) be a no-op for any setter/getter combo. FWIW S4Arrays::set_dim() does that too. It also preserves the dimnames if the right value is only adding or dropping outermost (ineffective) dimensions: ??? > x <- array(1:6, dim=c(2,3,1),
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
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
2009 Sep 02
1
Problem at subsetting matrix by using dimnames
Given: > mitest <- matrix(1:16,ncol=4) > dimnames(mitest)[[1]] <- c("a","b","c","d") > dimnames(mitest)[[2]] <- c("a","b","c","d") > mitest a b c d a 1 5 9 13 b 2 6 10 14 c 3 7 11 15 d 4 8 12 16 I can do: > mitest[cbind(c(1,2,3),c(2,3,2))] [1] 5 10 7 but using the names does not
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"
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]
1998 Jan 16
1
data.frame(...) not constructing "1:n" row.names [diff. S <--> R]
[I think Doug Bates has already alluded to this, somewhere..] In R, data.frame( ... ) does not construct row.names whereas in S, it does: R: > data.frame(x=1:2,y=3:4) x y [1,] 1 3 [2,] 2 4 > row.names(data.frame(x=1:2,y=3:4)) NULL S-plus: > data.frame(x=1:2,y=3:4) x y 1 1 3 2 2 4 > row.names(data.frame(x=1:2,y=3:4)) [1] "1" "2"
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
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
1999 Dec 22
0
Apply dimnames (PR#385)
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1251336619-945861747=:5357 Content-Type: TEXT/PLAIN; charset=US-ASCII While fiddling with apply I noticed that there appears to be an error in the dimnames, which actually
2016 Jun 10
0
collapsing list of NULLs dimnames into a NULL
Hi, Here are two different ways to create a 0 x 0 logical matrix: m1 <- matrix(nrow=0, ncol=0) m1 # <0 x 0 matrix> m2 <- as.matrix(data.frame()) m2 # <0 x 0 matrix> Surprisingly: identical(m1, m2) # [1] FALSE That's because of their dimnames: dimnames(m1) # NULL dimnames(m2) # [[1]] # NULL # # [[2]] # NULL More
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
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 >
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,
2007 Sep 27
0
Unnecessary extra copy with matrix(..., dimnames=NULL) (Was: Re: modifying large R objects in place)
As others already mentioned, in your example you are first creating an integer matrix and the coercing it to a double matrix by assigning (double) 1 to element [1,1]. However, even when correcting for this mistake, there is an extra copy created when using matrix(). Try this in a fresh vanilla R session: > print(gc()) used (Mb) gc trigger (Mb) max used (Mb) Ncells 136684 3.7
2008 Dec 03
1
Matrix dimnames crash (PR#13361)
In Windows XP, the matrix() function crashes the program when 'dimnames' is an empty list: matrix(1:4, nrow=2, dimnames=list()) # R has encountered a problem and needs to close ... This bug is specific to WinXP, as Linux64 handles this situation more gracefully: matrix(1:4, nrow=2, dimnames=list()) Error in matrix(1:4, nrow = 2, dimnames = list()) : invalid type