oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
623 stars 64 forks source link

different dimnames drop behavior when using as.logical in compare expression #40

Closed comicfans closed 5 years ago

comicfans commented 5 years ago

following code result an variable with different dimnames between fastR and GNU-R

 lhs <- array(TRUE,dim=c(2,3))
 rhs <- array(FALSE,dim=c(2,3),dimnames=list(c('y1','y2'),c('x1','x2','x3')))
dimnames(as.logical(lhs) == rhs)

fastR:

NULL

GNUR:

[[1]]
[1] "y1" "y2"

[[2]]
[1] "x1" "x2" "x3"

but if change code a little like this

temp <- as.logical(lhs)
dimnames (temp == rhs)

fastR preserve rhs dimnames as GNU-R

steve-s commented 5 years ago

Hi comicfans,

thanks for the report. We can reproduce and are working on a fix.

steve-s commented 5 years ago

Should be fixed in ab133d37208ecde4a90e6aef2e95936c7faaf405