Distance Function #41
spsanderson
started this conversation in
Ideas
Replies: 1 comment
-
A 1D distance function is operational. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Distance Function(s)
Vector Function
The vector
distance()
function should compute the point to point distance of any one of 1D, 2D or 3D Random Walks. Each function has attributes that will indicate it's dimension. For example:This would allow any function to make use of any of the underlying information. Here we would choose
$dimension
to see that it is a 1, 2 or3D random walk.One and Two Dimensional Random Walks
I think these should work in the following manner:
rw30()
and pipes it out todistance()
distance
will create a vector of point to point distances traveled.distance()
function would be the basis for adistance_augment()
function which would augment distance to the passed data.frame/tibble.y
can default toy
but can take an argument of a column name to pass. We would only take the distance of the randomly generated variabley
as a default, otherwise for 1D and 2D walks.y
can be specified likecum_sum
orcum_prod
This introduces a problem of how should the distance function be written, should there be multiple
.y
parameters or should an...
argument be provided to a select function likedpyr::select(...)
, or, one could provide a list of columns like.y = c(y1, y2, y3)
Here is some sample code:
Beta Was this translation helpful? Give feedback.
All reactions