You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

splitstackshape包中Reshape函数是否存在Bug?

Potential Bug in 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
  • VarA is measured at 3 time points: 1, 2, 3
  • VarB only has measurements at time points 2 and 3
  • VarC is 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:07:09