Good evening,
I have a dataframe with 100 rows and the column headers are ID, x-coordinate and y-coordinate:
ID | X | Y |
---|---|---|
1 | 0.1 | 0.1 |
2 | 0.2 | 0.2 |
and so on. I would now like to simulate a random walk between these 100 points, but do not know how to call a row. I thought about something similar to the following:
dataframe[ID,]=dataframe[ID+1,]+sample(step,1)
However this throws the error "unused argument (alist(id = ))"
does somebody know how to fix this?
Many thanks in advance!