-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Milestone
Description
Hi Distance Folks,
Thanks for all your great work!
I noticed today that if you use a detection function with a unif key in a dsm, then the key name is not printed when printing the dsm object.
Minimal example
library(Distance)
library(dsm)
data(mexdolphins)
# try two ddfs, one unif and one hn
uni.mod <- ds(distdata, key= "unif", adjustment = "cos", truncation = 6000)
hn.mod <- ds(distdata, key = "hn", adjustment = "cos", truncation = 6000)
# fit a simple smooth of x and y
dsm.uni <- dsm(count~s(x, y), uni.mod, segdata, obsdata)
dsm.hn <- dsm(count~s(x, y), hn.mod, segdata, obsdata)
# Copmare output lines starting with "Detection function : " Note that the key name is missing for the dsm with uniform key.
dsm.uni
dsm.hn
The problem
The problem is at lines 20-22 in ddf.model.description.R - there is no case in the switch for the unif key:
key <- switch(model$ds$aux$ddfobj$type,
hn = "Half-normal",
hr = "Hazard-rate")
Presumably changing it to this would fix the problem?
key <- switch(model$ds$aux$ddfobj$type,
hn = "Half-normal",
hr = "Hazard-rate",
unif = "Uniform")
Thanks!
Metadata
Metadata
Assignees
Labels
No labels