TysonStanley / tidyfast

Fast and efficient alternatives to tidyr functions built on data.table #rdatatable #rstats
https://tysonbarrett.com/tidyfast/
187 stars 4 forks source link

Error in dt_pivot_wider() #16

Closed markfairbanks closed 4 years ago

markfairbanks commented 4 years ago

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) {
TysonStanley commented 4 years ago

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 :)

TysonStanley commented 4 years ago

@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?

markfairbanks commented 4 years ago

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