diff --git a/R/helpers.R b/R/helpers.R index 1e61930..00856b6 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -578,7 +578,7 @@ NULL #' @rdname rand_walk_column_names #' #' @export -rand_walk_column_names <- function(.rand_data, .dim_names) { +rand_walk_column_names <- function(.rand_data, .dim_names, .num_sims, .t) { # Set column names rand_steps <- stats::setNames(.rand_data, .dim_names) rand_steps <- purrr::map(rand_steps, \(x) dplyr::as_tibble(x)) |> @@ -588,14 +588,13 @@ rand_walk_column_names <- function(.rand_data, .dim_names) { rand_steps, \(x) x |> unlist(use.names = FALSE)) |> dplyr::as_tibble() - + # Combine into a tibble rand_steps <- dplyr::tibble( - walk_number = factor(num_sims), - step_number = 1:t + walk_number = factor(.num_sims), + step_number = 1:.t ) |> dplyr::bind_cols(rand_steps) - + return(rand_steps) } -} diff --git a/man/rand_walk_column_names.Rd b/man/rand_walk_column_names.Rd index 91eb828..f177781 100644 --- a/man/rand_walk_column_names.Rd +++ b/man/rand_walk_column_names.Rd @@ -4,7 +4,7 @@ \alias{rand_walk_column_names} \title{Get Column Names} \usage{ -rand_walk_column_names(.rand_data, .dim_names) +rand_walk_column_names(.rand_data, .dim_names, .num_sims, .t) } \arguments{ \item{.rand_data}{A data frame from which column names are to be extracted.}