splitstackshape包中Reshape函数是否存在Bug?
splitstackshape::Reshape() with Variable Time-Point Suffixes Hey folks, I've run into what seems like a potential bug with splitstackshape::Reshape() and wanted to get the community's input to verify this.
Here's the scenario I'm working with:
- I have wide-format data where variable names include numeric suffixes representing time points
VarAis measured at 3 time points: 1, 2, 3VarBonly has measurements at time points 2 and 3VarCis only measured at time point 3
When I use splitstackshape::Reshape() to reshape this dataset, the output doesn't align with expected behavior—it fails to correctly map each variable to its respective valid time points. In contrast, when I use the equivalent reshaping functionality in the tidyr package (specifically pivot_longer() with appropriate suffix matching logic), I get the correct output that properly associates each variable with only the time points where it was measured.
Has anyone else experienced this discrepancy? Could this be a bug in how splitstackshape::Reshape() handles variables with incomplete time-point suffixes? I can share a minimal reproducible example dataset and the exact code snippets for both packages if that would help the community dig into this further.
内容的提问来源于stack exchange,提问作者Edward

