Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Should separate's 'extra' argument have a fill option? #49
Suppose I have a data frame where a column contains information that I would like to separate, but only some of the rows have the second part. Would it make sense to have an option to fill the empty cells with NAs?
My use case is college football rankings tables. In the teams column they also list the first place votes, if any, which I want saved as its own column. Right now I'm using stringr + regex to extract the votes, set the ones without votes to NA or zero, and then scrub the numeric information from the teams column.
Could this potentially be improved with separate? Something like,
My thought would be for each row, if delimiter exists, then split, otherwise col stays in col1 and col2 would be filled with NA or the desired value.