Думаю, вам не нужно там конвертировать в matrix
. (даже если вы используете as.matrix
, а не matrix
, зная, что он изменит числа на символы).
Поскольку вам нужно только значение vol
, рассмотрите sapply
library(geometry)
sapply(data, function(x)
convhulln(x[, c("x", "y", "z")], output.options = TRUE)$vol)
данные
data <- list(structure(list(x = c(-51.03725, -44.30373, -32.74437, -24.88931,
-32.68951, -43.83451), y = c(63.31324, 69.68717, 70.62483, 64.95135,
62.78665, 62.0002), z = c(69.57604, 80.75729, 83.41063, 79.86515,
81.20307, 76.79511), Subject_id = c(10037L, 10037L, 10037L, 10037L,
10037L, 10037L), Gender = c("female", "female", "female", "female",
"female", "female"), Points = 36:41), class = "data.frame", row.names = c("37",
"38", "39", "40", "41", "42")), structure(list(x = c(-51.03725,
-44.30373, -32.74437, -24.88931, -32.68951, -43.83451), y = c(63.31324,
69.68717, 70.62483, 64.95135, 62.78665, 62.0002), z = c(69.57604,
80.75729, 83.41063, 79.86515, 81.20307, 76.79511), Subject_id = c(10037L,
10037L, 10037L, 10037L, 10037L, 10037L), Gender = c("female",
"female", "female", "female", "female", "female"), Points = 36:41),
class = "data.frame", row.names = c("37", "38", "39", "40", "41", "42")))