# 3-dimensional array
x1 <- array(c(1, 2, 3, 3, 2, 1, 5, 2, 3, 9, 8, 7, -1, -5, -6, 2, 3, 0, -1, 0, 2, -1, -2, 0),
dim = c(3, 4, 2)
)
generate_indices(x1, k = 4)
# matrix
x2 <- matrix(c(1, 2, 3, 3, 2, 1, 5, 2, 3, 9, 8, 7), nrow = 3, ncol = 4)
generate_indices(x2, k = 4)
# using additional parameter for tf::tfb
curves <- sim_model_ex1(n = 10)
generate_indices(
curves = curves,
k = 20,
bs = "bs",
m = c(3,2), # additional parameter for tfb
penalized = FALSE # additional parameter for tfb
)
Run the code above in your browser using DataLab