Skip to content

replace_time error with repeating time values #66

@gcpoole

Description

@gcpoole

replace_time has an issue with repeating values.

This is fine:

> c("01:30", "02:30", "3:30") |> textclean::replace_time()
[1] "one thirty"   "two thirty"   "three thirty"

Repeated value at beginning and end gets correct answer, with warning:

> c("01:30", "02:30", "3:30", "01:30") |> textclean::replace_time()
[1] "one thirty"   "two thirty"   "three thirty" "one thirty"  
Warning message:
In as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 2 has 3 rows but longest item has 4; recycled with remainder.

Repeated value in middle puts results in wrong order, with warning:

> c("01:30", "02:30", "3:30", "01:30", "2:30") |> textclean::replace_time()
[1] "one thirty"   "two thirty"   "three thirty" "two thirty"   "one thirty"  
Warning message:
In as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 2 has 4 rows but longest item has 5; recycled with remainder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions