Skip to content

separate_rows() has error when column is a factor #1058

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

Closed
al-obrien opened this issue Nov 3, 2020 · 0 comments · Fixed by #1074
Closed

separate_rows() has error when column is a factor #1058

al-obrien opened this issue Nov 3, 2020 · 0 comments · Fixed by #1074

Comments

@al-obrien
Copy link

When separating rows with a column in factor format, the following error occurs: Error in nchar(u, itype) : 'nchar()' requires a character vector

This occurred when transitioning to the 1.1.2 version of tidyr using separate_rows(); a similar issue was resolved in the prior version (1.1.1): #1014

Works fine:

df <- tibble(
  x = 1:3,
  y = c("a", "d,e,f", "g,h"),
  z = c("1", "2,3,4", "5,6")
)
separate_rows(df, y, z, convert = TRUE)

Has error: Error in nchar(u, itype) : 'nchar()' requires a character vector

df <- tibble(
  x = 1:3,
  y = factor("a", "d,e,f", "g,h"),
  z = c("1", "2,3,4", "5,6")
)
separate_rows(df, y, z, convert = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant