Subset capthist by trapcovnames?

21 views
Skip to first unread message

dsto...@gmail.com

unread,
Apr 17, 2025, 7:23:23 PMApr 17
to secr
Hi Murray,

I've been trying to subset my capthist object so I can run some models on a focal area of my large study area. I am wanting to subset by a trap covariate but can only find code for doing this for traps based on x, y. Is it possible to subset based on a trap covariate in my capthist? 

In my capthist below, I'm wanting to subset to the area within a mining lease, where mine = Inside.

> str(catN)
 'capthist' num [1:32, 1:103, 1:333] 0 0 0 0 0 0 0 0 0 0 ...
 - attr(*, "dimnames")=List of 3
  ..$ : chr [1:32] "B1" "B2" "B3" "B5" ...
  ..$ : chr [1:103] "1" "2" "3" "4" ...
  ..$ : chr [1:333] "1" "2" "3" "4" ...
 - attr(*, "covariates")='data.frame': 0 obs. of  0 variables
 - attr(*, "traps")=Classes ‘traps’ and 'data.frame': 333 obs. of  2 variables:
  ..$ x: int [1:333] 658639 658125 654691 657917 657166 657646 658632 658730 658556 657670 ...
  ..$ y: int [1:333] 8442140 8443160 8457120 8456760 8443150 8444150 8442650 8441600 8443660 8447660 ...
  ..- attr(*, "detector")= chr "count"
  ..- attr(*, "usage")= num [1:333, 1:103] 0 0 0.82 0 0 0 0 0.07 0 0 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:333] "GC001" "GC002" "GC003" "GC004" ...
  .. .. ..$ : chr [1:103] "1" "2" "3" "4" ...
  ..- attr(*, "covariates")='data.frame': 333 obs. of  2 variables:
  .. ..$ LType        : chr [1:333] "Woodland" "Woodland" "Woodland" "Rehabilitation" ...
  .. ..$ Mine         : chr [1:333] "Outside" "Outside" "Inside" "Inside" ...
  ..- attr(*, "spacex")= num 1
  ..- attr(*, "spacey")= num 3
  ..- attr(*, "spacing")= num 415
 - attr(*, "session")= chr "2023"
 - attr(*, "inject.time")= num [1:192] 0 0 0 0 0 0 0 0 0 0 ...

Thanking you in advance for your consideration.

Dani

Murray Efford

unread,
Apr 17, 2025, 8:07:16 PMApr 17
to dsto...@gmail.com, secr
subset.capthist has a traps argument, as you probably found. That can be set to any logical vector of suitable length, including one derived from covariates of the traps attribute.

--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/secrgroup/17eb5254-719a-4ab3-8bda-e6e97950647en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages