-
Notifications
You must be signed in to change notification settings - Fork 422
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
Reproducible example using tidyr 0.6.3.9000:
df <- data.frame(col1=character(0))
tidyr::extract(df, col1, into="col2", regex="(whatever)")
Expected behaviour: should return an empty data.frame with a new empty column "col2".
Actual behaviour: fails with error:
Error in names(l) <- enc2utf8(into) : 'names' attribute [1] must be the same length as the vector [0]
Why it should be fixed: this makes an otherwise valid pipeline fail when the result of a filter happens to be empty. This requires boiler-plate to guard against empty data when programming with extract.
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior