Skip to content

Commit

Permalink
small update to format_data
Browse files Browse the repository at this point in the history
Merge branch 'staging'

# Conflicts:
#	DESCRIPTION
  • Loading branch information
ianjonsen committed Jan 13, 2025
2 parents ce5d028 + ba08cd2 commit 83e4493
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: aniMotum
Title: Fit Continuous-Time State-Space and Latent Variable Models for Quality Control of Argos Satellite (and Other) Telemetry Data and for Estimating Changes in Animal Movement
Version: 1.2-07
Date: 2024-11-07
Version: 1.2-08
Date: 2025-01-13
Authors@R:
c(
person(given = "Ian",
Expand Down
3 changes: 3 additions & 0 deletions R/format_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ format_data <- function(x,
}
}

## In case all format_data-added variables already exist in x
xx <- x

## determine if there are extra variables in x
xt.vars <- names(x)[!names(x) %in% c(id, date, lc, coord, epar, sderr)]

Expand Down
3 changes: 3 additions & 0 deletions R/sim_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ sim_fit <-
if(!what %in% c("fitted", "predicted"))
stop("only `fitted` or `predicted` locations can be simulated from a model fit")

if(any(sapply(fit$ssm, function(x) x$pm) == "mp"))
stop("'mp' process model fit(s) detected\n tracks can only be simulated from SSM fits using either the 'rw' or 'crw' process models")

if(!is.null(start)) {
start <- data.frame(lon = start[1], lat = start[2])
st1 <- st_as_sf(start, coords = c("lon","lat"), crs = 4326) |>
Expand Down

0 comments on commit 83e4493

Please sign in to comment.