When tabCol is single value in ncappc, nca.npde drops columns, resulting in only first record from being retained.
At ~line 18, replace npde[, pdecol] with npde[, pdecol, drop = FALSE] in call to lapply.
# basic case
# 0, -0.841621233572914, -0.2533471031358,
# 0.2533471031358, 0.841621233572914, 0)
res <- nca.npde(pdedata = data.frame(A = (0:5)/5, B = 1), pdecol = c("A", "B"))
res$npdeA
# [1] 0.0000000 -0.8416212 -0.2533471 0.2533471 0.8416212 0.0000000
# single column
res <- nca.npde(pdedata = data.frame(ID = 1, A = (0:5)/5), pdecol = "A")
res$npdeA
# [1] 0 0 0 0 0 0
When tabCol is single value in
ncappc,nca.npdedrops columns, resulting in only first record from being retained.At ~line 18, replace
npde[, pdecol]withnpde[, pdecol, drop = FALSE]in call tolapply.