Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lapply can't handle the IDate class (but apply can) #1315

Closed
gwerbin opened this issue Sep 9, 2015 · 0 comments
Closed

lapply can't handle the IDate class (but apply can) #1315

gwerbin opened this issue Sep 9, 2015 · 0 comments
Assignees
Milestone

Comments

@gwerbin
Copy link

gwerbin commented Sep 9, 2015

The issue seems to be somewhere in converting from a plain vector to a list.

Compare:

sapply(as.IDate("2015-05-03"), identity)
# Error in as.Date.default(x, ...) : 
  do not know how to convert 'x' to class “Date”

traceback()
#10: stop(gettextf("do not know how to convert '%s' to class %s", 
#                   deparse(substitute(x)), dQuote("Date")), domain = NA)
#9: as.Date.default(x, ...)
#8: as.Date(x, ...)
#7: as.IDate(as.Date(x, ...))
#6: as.IDate.default(NextMethod())
#5: as.IDate(NextMethod())
#4: as.list.IDate(X)
#3: as.list(X)
#2: lapply(X = X, FUN = FUN, ...)
#1: sapply(as.IDate("2015-05-03"), identity)

with

apply(cbind(as.IDate("2015-05-03")), 1, identity)
# [1] 16558
@gwerbin gwerbin changed the title sapply can't handle the IDate class lapply can't handle the IDate class (but apply can) Sep 9, 2015
@arunsrinivasan arunsrinivasan added this to the v1.9.6 milestone Sep 17, 2015
@arunsrinivasan arunsrinivasan self-assigned this Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants