R 的 iglu 包中用于葡萄糖分析的 MAGE 函数中的 replace() 错误
replace() error in MAGE function in R's iglu package for glucose analysis
我正在尝试使用 iglu package in R. The function always throws an error when calling the mage_ma_single()
function, which itself gets called by the mage()
function. Here's the package's function's source code which leads to an error 的 all_metrics()
函数,请参阅第 58 至 64 行。
这是我遇到的错误:
Error: Problem with mutate()
column MA_Long
.
ℹ MA_Long = replace(MA_Long, 1:long_ma, MA_Long[long_ma])
.
ℹ MA_Long
must be size 5 or 1, not 23.
这是我可以重现错误的一些示例数据:
structure(list(id = c(1, 1, 1, 1, 1), time = structure(c(1611228720, 1611229080, 1611247620, 1611249960, 1611263940), class = c("POSIXct", "POSIXt"), tzone = ""), gl = c(97L, 90L, 89L, 96L, 87L)), row.names = c(NA, 5L), class = "data.frame")
事实证明,每个 ID 至少需要 23 个观察才能使 all_metrics()(和 mage_ma_single())成功地 运行。我已经给包的作者 Irina Gaynanova 发了邮件,她会考虑尽快提供修复。
我正在尝试使用 iglu package in R. The function always throws an error when calling the mage_ma_single()
function, which itself gets called by the mage()
function. Here's the package's function's source code which leads to an error 的 all_metrics()
函数,请参阅第 58 至 64 行。
这是我遇到的错误:
Error: Problem with
mutate()
columnMA_Long
. ℹMA_Long = replace(MA_Long, 1:long_ma, MA_Long[long_ma])
. ℹMA_Long
must be size 5 or 1, not 23.
这是我可以重现错误的一些示例数据:
structure(list(id = c(1, 1, 1, 1, 1), time = structure(c(1611228720, 1611229080, 1611247620, 1611249960, 1611263940), class = c("POSIXct", "POSIXt"), tzone = ""), gl = c(97L, 90L, 89L, 96L, 87L)), row.names = c(NA, 5L), class = "data.frame")
事实证明,每个 ID 至少需要 23 个观察才能使 all_metrics()(和 mage_ma_single())成功地 运行。我已经给包的作者 Irina Gaynanova 发了邮件,她会考虑尽快提供修复。