joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
219 stars 70 forks source link

do_merge_xts() unnecessarily coerces to REAL when 'x' and 'y' aren't the same type and one isn't returned #421

Open joshuaulrich opened 3 weeks ago

joshuaulrich commented 3 weeks ago

do_merge_xts() shouldn't coerce x or y to REAL if they're not the same type and one isn't returned.

lgl <- xts(rep(TRUE, 10), .Date(1:10))
int <- x + 1
# should return logical, but returns double
dbl <- merge(lgl, int, retside = c(TRUE, FALSE))

packageVersion('xts')
## [1] '0.14.0'