You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried running the fmap() function on data for a single individual. It would plot all data points in the same colour and no index would appear.
Both the fit_ssm and the fit_mpm worked fine and when the fit_mpm was plotted the colour of the graph was varied and the index also appeared.
I tried joining the ssm and mpm manually as following
#joining movement persistence values to location values
fmp_loc <- foieGras::join(my_ssm,my_mpm, as_sf=F)
#Then plot, color by movement persistence
ggplot(fmp_locs) +
geom_point(aes(lon, lat, colour = g)) +
scale_colour_viridis_c(limits = c(0,1))
And this worked fine.
I also tried to do all of it with the example data in the package, ellie and ellies and that also had the same problem with fmap working fine on ellies, but only giving a single colour and no index on ellie.
I have added some screenshots and a copy of the script (with ellie and ellies) below.
#fit example with 2 elephant seals
data("ellies")
fit2 <- fit_ssm(ellies, model = "crw", time.step = 24, verbose = 0)
fit2$ssm[1]
#plotting graphs
plot(fit2, what = "predicted", type = 1)
plot(fit2, what = "fitted", type = 2)
#fit example with 1 elephant seal
fit1<- fit_ssm(ellie, model = "rw", time.step = 48, verbose = 0)
plot(fit1, what = "predicted", type = 1)
plot(fit1, what = "fitted", type = 2)
#plotting graphs
plot(fit1, what = "predicted", type = 1)
plot(fit1, what = "fitted", type = 2)
#for two elephant seals
fmp2 <- fit2 %>%
grab(what = "predicted", as_sf = FALSE) %>%
select(id, date, lon, lat) %>%
fit_mpm(model = "jmpm", verbose = 0)
plot(fmp2)
#Joining ssm and mpm and plotting on a map
fmap(fit2, fmp2, what = "predicted", crs = "+proj=stere +lon_0=99 +units=km +ellps=WGS84")
#Joining ssm and mpm and plotting on a map (doesn't work on a single individual)
fmap(fit1, fmp1, what = "predicted", crs = "+proj=stere +lon_0=99 +units=km +ellps=WGS84")
The text was updated successfully, but these errors were encountered:
When I tried running the fmap() function on data for a single individual. It would plot all data points in the same colour and no index would appear.
Both the fit_ssm and the fit_mpm worked fine and when the fit_mpm was plotted the colour of the graph was varied and the index also appeared.
I tried joining the ssm and mpm manually as following
#joining movement persistence values to location values
fmp_loc <- foieGras::join(my_ssm,my_mpm, as_sf=F)
#Then plot, color by movement persistence
ggplot(fmp_locs) +
geom_point(aes(lon, lat, colour = g)) +
scale_colour_viridis_c(limits = c(0,1))
And this worked fine.
I also tried to do all of it with the example data in the package, ellie and ellies and that also had the same problem with fmap working fine on ellies, but only giving a single colour and no index on ellie.
I have added some screenshots and a copy of the script (with ellie and ellies) below.
Desktop
library(ggplot2)
library(ggmap)
library(ggsn)
library(foieGras)
library(dplyr)
#importing the data from within foiegras
data(ellie, package = "foieGras")
head(data.frame(ellie))
data(ellies, package = "foieGras")
head(data.frame(ellies))
#fit example with 2 elephant seals
data("ellies")
fit2 <- fit_ssm(ellies, model = "crw", time.step = 24, verbose = 0)
fit2$ssm[1]
#plotting graphs
plot(fit2, what = "predicted", type = 1)
plot(fit2, what = "fitted", type = 2)
#fit example with 1 elephant seal
fit1<- fit_ssm(ellie, model = "rw", time.step = 48, verbose = 0)
plot(fit1, what = "predicted", type = 1)
plot(fit1, what = "fitted", type = 2)
#plotting graphs
plot(fit1, what = "predicted", type = 1)
plot(fit1, what = "fitted", type = 2)
#for two elephant seals
fmp2 <- fit2 %>%
grab(what = "predicted", as_sf = FALSE) %>%
select(id, date, lon, lat) %>%
fit_mpm(model = "jmpm", verbose = 0)
plot(fmp2)
#Joining ssm and mpm and plotting on a map
fmap(fit2, fmp2, what = "predicted", crs = "+proj=stere +lon_0=99 +units=km +ellps=WGS84")
#for one elephant seal
fmp1 <- fit1 %>%
grab(what = "predicted", as_sf = FALSE) %>%
select(id, date, lon, lat) %>%
fit_mpm(model = "mpm", verbose = 0)
plot(fmp1)
#Joining ssm and mpm and plotting on a map (doesn't work on a single individual)
fmap(fit1, fmp1, what = "predicted", crs = "+proj=stere +lon_0=99 +units=km +ellps=WGS84")
The text was updated successfully, but these errors were encountered: