-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with manually added colours #104
Comments
I am also having this issue! Did you happen to find a solution? |
I ended up manually entering the colour values and was not able to use this
method.
It is less than ideal, but it worked in the end.
It was necessary to have a correct count of the values in the moveStack(),
and then manually entering the colour code in frames_spatial(path_colours =
c("blue","blue","red".....))
…On Mon, May 9, 2022 at 9:28 PM swforrest ***@***.***> wrote:
I am also having this issue! Did you happen to find a solution?
—
Reply to this email directly, view it on GitHub
<#104 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKFEXHOEKXXCWEKVN43GHQDVJHJWBANCNFSM5ICTNFGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I have found another hacky solution, but which might be a bit more straightforward to implement: I then used the 'na.locf' function from the 'zoo' package, which replaces NAs with the previous value appearing in the vector, and fills forward. This obviously assumes that the behavioural state at the NA time step is the same as the previous time step (or earlier if multiple consecutive NAs), but for something like sex then this would be fine. I used this after the align move step:
|
I am attempting to create an animation of animal movement from a CSV file.
The file is brought into R Studio, converted to a dataframe, and duplicate data is removed.
The data is then divided into the three animal types and sex and each of the converted to a move class object using df2move().
The move object is then assigned a colour using something like AnimalTypeSex$colour = "pink".
Move objects are then converted to a moveStack using moveStack() and the times are aligned using align_move().
The issue arises when using frames_spatial() and this error pops up:
Error in
$<-.data.frame
(*tmp*
, "tail_colour", value = c("#FFD2D2", :replacement has 99 rows, data has 100
carFS = frames_spatial(AnimalsAligned, map_service = "osm", map_type = "terrain_bg",
trace_show = FALSE,path_fade = F, path_legend = F, path_colours = NA)%>%
add_labels(x="Longitude", y="Latitude")%>%
add_timestamps(AnimalsAligned, type="label")%>%
add_progress()
Is there a way to deal with the replacement has 99 rows, data has 100 issue?
There is no issue if the colour attribute is not used, but then all tracks are randomly coloured.
The text was updated successfully, but these errors were encountered: