Skip to content
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

frames_spatial() cropping issue? #118

Open
WhitneyH1317 opened this issue Jul 7, 2023 · 1 comment
Open

frames_spatial() cropping issue? #118

WhitneyH1317 opened this issue Jul 7, 2023 · 1 comment

Comments

@WhitneyH1317
Copy link

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@xmax
0.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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants