16EAGLE / moveVis

An R package providing tools to visualize movement data (e.g. from GPS tracking) and temporal changes of environmental data (e.g. from remote sensing) by creating video animations.
http://www.movevis.org
GNU General Public License v3.0
131 stars 20 forks source link

frames_spatial() cropping issue? #118

Open WhitneyH1317 opened 1 year ago

WhitneyH1317 commented 1 year ago

When I run frames_spatial I get the following error:

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'crop': unable to find an inherited method for function ‘xmax’ for signature ‘"data.frame"’

I've read in a csv and run the following code: move_data2 <- df2move(data2[1:30, ], proj = proj_string, x = "longitude", y = "latitude", time = "Time.Stamps")

align move_data to a uniform time scale, fix for inconsistent data

m <- align_move(move_data2, res = 60, unit = 'mins') ext <- extent(m) ext@xmin <- ext@xmin - (ext@xmin0.003) ext@xmax <- ext@xmax + (ext@xmax0.003)

create spatial frames for a certain map service

get_maptypes() frames <- frames_spatial(m, path_colours = c("red"), map_service = "carto", map_type = "dark", alpha = 0.5, ext = ext) %>% add_labels(x = "Longitude", y = "Latitude") %>% # add some customizations, such as axis labels add_northarrow() %>% add_scalebar() %>% add_timestamps(type = "label") %>% add_progress()

I've tried making sure other spatial libraries aren't also loaded, in case there's a "crop" issue between packages, but that didn't help. I've tried looking in the source code and am having trouble seeing where the extent() command is or how to solve this. Any advice?

JoChambon commented 1 year ago

Hi, reinstalling the package from github with devtools rather than install.packages() solved this issue. devtools::install_github("16EAGLE/moveVis")