DistanceDevelopment / dsims

New simulation R library
1 stars 2 forks source link

NA values in population #73

Closed LHMarshall closed 1 year ago

LHMarshall commented 2 years ago

Unsure of the source of this but causes a fatal error

> set.seed(348)
> survey.UE <- run.survey(sim.UE)
 Error in .local(obj, ...) : NA values in coordinates
17 .stop("NA values in coordinates")
16. .local(obj, ...)
15. coordinates(as.matrix(obj))
14. coordinates(as.matrix(obj))
13. .local(obj, ...)
12. coordinates(coords)
11. coordinates(coords)
10. sp::SpatialPoints(pop[, c("x", "y")])
9. is(coords, "SpatialPoints")
8. sp::SpatialPointsDataFrame(sp::SpatialPoints(pop[, c("x", "y")]), 
pop) at calc.perp.dists.R#70
7. calc.perp.dists(population, line.transect) at Survey.LT.R#59
6. .local(object, ...)
5. run.survey(survey, region = object@design@region) at generic.functions.R#38
4.run.survey(survey, region = object@design@region) at Simulation.R#264
3. .local(object, ...)
2. run.survey(sim.UE) at generic.functions.R#38
1. run.survey(sim.UE)

Browse[2]> pop[1583:1587,]
      individual        x         y Region.Label scale.param
4100        1583 140443.9 -753637.1        inZ_N         500
5100        1584 228771.0 -699821.7        inZ_N         500
NA          1585       NA        NA        inZ_N         500
11100       1586 174252.7 -731348.3        inZ_N         500
12100       1587 226102.1 -702950.7        inZ_N         500
LHMarshall commented 1 year ago

Duplicate #80