diff --git a/R/00_global_variables.R b/R/00_global_variables.R index bcace92..928b2a0 100644 --- a/R/00_global_variables.R +++ b/R/00_global_variables.R @@ -1,5 +1,5 @@ globalVariables( names = c( - "walk_number","x","y","value","name" + "walk_number","x","y","value","name", "cum_sum","cum_prod" ) ) diff --git a/R/gen-brown-motion-geometric.R b/R/gen-brown-motion-geometric.R index f3b0ce3..49324c2 100644 --- a/R/gen-brown-motion-geometric.R +++ b/R/gen-brown-motion-geometric.R @@ -131,7 +131,9 @@ geometric_brownian_motion <- function(.num_walks = 25, .n = 100, dplyr::select(name, t, value) |> purrr::set_names("walk_number", "x", "y") |> dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_sims)) |> - dplyr::arrange(walk_number, x) + dplyr::arrange(walk_number, x) |> + rand_walk_helper(.value = initial_value) |> + dplyr::select(-cum_sum, -cum_prod) } attr(res, "n") <- .n diff --git a/R/gen-brown-motion.R b/R/gen-brown-motion.R index f279d64..aa3b326 100644 --- a/R/gen-brown-motion.R +++ b/R/gen-brown-motion.R @@ -113,7 +113,9 @@ brownian_motion <- function(.num_walks = 25, .n = 100, .delta_time = 1, dplyr::select(name, t, value) |> purrr::set_names("walk_number", "x", "y") |> dplyr::mutate(walk_number = factor(walk_number, levels = 1:num_sims)) |> - dplyr::arrange(walk_number, x) + dplyr::arrange(walk_number, x) |> + rand_walk_helper(.value = initial_value) |> + dplyr::select(-cum_sum, -cum_prod) } # Return ----