Skip to content

as.ITime bug with short time format #2940

@polyjian

Description

@polyjian

Notice that data.table::as.ITime(c('xxx', '10:43')) return NA, NA below which should be a bug.

data.table::as.ITime(c('10:43'))
[1] "10:43:00"
data.table::as.ITime(c('xxx', '10:43'))
[1] NA NA
There were 11 warnings (use warnings() to see them)
data.table::as.ITime(c('xxx', '10:43:01'))
[1] NA "10:43:01"
warnings()
Warning messages:
1: In [<-.POSIXlt(*tmp*, w[nna], value = structure(list( ... :
number of items to replace is not a multiple of replacement length
2: In [<-.POSIXlt(*tmp*, w[nna], value = structure(list( ... :
number of items to replace is not a multiple of replacement length
3: In [<-.POSIXlt(*tmp*, w[nna], value = structure(list( ... :
number of items to replace is not a multiple of replacement length
4: In [<-.POSIXlt(*tmp*, w[nna], value = structure(list( ... :

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions