Skip to content

str_replace() isn't able to replace strings with NAs, since 1.1.0 #124

@filipsch

Description

@filipsch

In stringr version 1.0.0, the following worked fine:

> str_replace(c(NA, "abc", ""), pattern = "^$", NA)
[1] NA    "abc" NA   

In stringr version 1.1.0, an error is thrown:

> str_replace(c(NA, "abc", ""), pattern = "^$", NA)
Error in if (char == "$") { : missing value where TRUE/FALSE needed

Is this updated behavior intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions