Skip to content

Pink bands not in the right place in the check.mono plot (mrds function) #208

@LHMarshall

Description

@LHMarshall

Note check.mono is actually in mrds

Len commented:

  • I can't make sense of the plot that come from calling check.mono(hn2$ddf, plot = TRUE) in that I expect the pink bar at the top to show where one of the constraints is broken, but it looks pink everywhere. I suspect there is a bug in the chpply function, which is defined within check.mono but I have not looked into it. I can raise as a separate issue if that's helpful.

Originally posted by @lenthomas in #186

MRE

The following code uses these duiker data: DaytimeDistances.txt

DuikerCameraTraps <- read.csv(file="DaytimeDistances.txt", header=TRUE, sep="\t")
DuikerCameraTraps$Area <- DuikerCameraTraps$Area / (1000*1000)
DuikerCameraTraps$object <- NA
DuikerCameraTraps$object[!is.na(DuikerCameraTraps$distance)] <- 1:sum(!is.na(DuikerCameraTraps$distance))

library(Distance)
trunc.list <- list(left = 2, right = 15)
mybreaks <- c(seq(2, 8, 1), 10, 12, 15)
conversion <- convert_units("meter", NULL, "square kilometer")
hn2 <- ds(DuikerCameraTraps, transect = "point", key = "hn", 
          adjustment = "cos",
          nadj=2, convert_units = conversion,
          monotonicity = "none",
          cutpoints = mybreaks, truncation = trunc.list)
plot(hn2)

check.mono(hn2$ddf, n.pts=10, plot = TRUE) # gives TRUE

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    To discussRequires discussiontriageNew items to look at and decide what to do

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions