oracle / fastr

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

different behavior when multiply zero-column dataframe #61

Closed comicfans closed 5 years ago

comicfans commented 5 years ago
test.df <- data.frame(col1 = c(1,2))
test.df[,character(0)] * test.df$col1

GNU-R: data frame with 0 columns and 0 rows

fastR: Error in rep.int(seq_len(ncol(e1)), rep.int(nrow(e1), ncol(e1))) : invalid 'times' value

purpose for these code is to process column without worry about column existence, for example

test.df <- data.frame(col1 = c(1,2))
column.process <- 'no_such'
column.selected <-  colnames(test.df)[ column.process %in%  colnames(test.df)]
test.df[,column.selected]  <- test.df[,column.selected] * test.df$col1
#  test.df didn't change
steve-s commented 5 years ago

Hello comicfans,

thank you for another bug report. The fix is already queued in our internal system.

steve-s commented 5 years ago

Should be fixed now.