TysonStanley/tidyfast

Error in dt_pivot_wider()

markfairbanks opened this issue · 3 comments

I found a small error in dt_pivot_wider().
This part:

} else if (length(id_cols == 1)) {

Should instead be:

} else if (length(id_cols) == 1) {

Good catch. Thanks for pointing me to that. Turns out that your final else statement works with length(id_cols) == 1 and length(id_cols) > 1 so I just removed it. This is because paste(id_cols, collapse = " + ") will just print the single column if there is just one or will print multiple separated by + if there is more :)

@mtfairbanks quick question. Wanted to add you to the DESCRIPTION file as a contributor for your great addition to tidyfast. Is there a name you'd like for me to put on there?

@TysonStanley - that sounds great. My name’s Mark Fairbanks