Skip to content
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

14.4.3 Diagnosing widening problems #1606

Open
BioinfGuru opened this issue Dec 8, 2023 · 0 comments
Open

14.4.3 Diagnosing widening problems #1606

BioinfGuru opened this issue Dec 8, 2023 · 0 comments

Comments

@BioinfGuru
Copy link

Hey,

Great book... love it!

I'm just learning this part of the book and there seems to be a strange behaviour of too_few() with delim = "-" when included on a debugged data frame: the full string is added to column x. It caused me a lot of confusion when studying this section. I'm not sure if this is my lack of understanding or not, but it might be appropriate to add a warning to remove the line of code too_few = "debug" after debugging.

df <- tibble(x = c("1-1-1", "1-1-2", "1-3-1", "1-3-2", "1-1-1")) #debugged
df |> 
  separate_wider_delim(
    x,
    delim = "-",    # <- unexpected behaviour
    names = c("x", "y", "z"),
    too_few = "debug"
  )

df <- tibble(x = c("a10.1.2022", "b10.2.2011", "e15.1.2015")) # debugged
df |> 
  separate_wider_delim(                   
    x,
    delim = ".",    # <- expected behaviour
    names = c("code", "edition", "year"),
    too_few = "debug"
  )

Regards,
Kenneth

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

No branches or pull requests

1 participant