Problems running secr

130 views
Skip to first unread message

FERNANDO CESAR CASCELLI DE AZEVEDO

unread,
Nov 5, 2023, 6:06:29 PM11/5/23
to unmarked
Dear Secr users,
I am estimating the densities of giant armadillos in one location (Atlantic Forest reserve) using secr 4.6. My data set contains 19 occasions of 20 days each. When I try to load my data, everything seems correct. However, when I try to creat a count type trap file, I get a message error saying: "Error in make.capthist(captures = large.cap, traps = large.trap, fmt = "trapID") : failed to match some capture locations to detector sites"

Does anyone know how to fix this problem? See the script I am using, my trap and my capture file below (thank you in advance for your help, Fernando!):

large.cap<-read.csv("large.cap_tatus.csv", header = TRUE)
large.cap

large.trap<-read.csv("large.trap_tatus.csv", header = TRUE)
large.trap

head(large.trap)#view top rows of the trap file for large sampling frame
head(large.cap)#view top rows of the capture file for large sampling frame

# Create a count type trap file for large sampling frame.
large.trap<-read.traps(data=large.trap, detector = 'count')
large.trap

# Create a capture history object with the capture and trap data.
all.data.large<- make.capthist(captures = large.cap,
                               traps = large.trap,
                               fmt="trapID") # Note that data is in the trapID format

# Visualize data graphically
plot(all.data.large) #Show all cameras and captures
head(traps(all.data.large)) #view the first few traps

trap file (large.trap):
x y
B1P1 761211 7839805
B1P2 757393 7838443
B1P3 759777 7840349
B2P1 758410 7835853
B2P2 756362 7837140
B2P3 758608 7834030
B3P1 753898 7829031
B3P2 754707 7832350
B3P3 757031 7830154
B4P1 758833 7832575
B4P2 761582 7831769
B4P3 758818 7830233
B5P1 751886 7822126
B5P2 751716 7823767
B5P3 753279 7823861
B6P1 754256 7825148
B6P2 755633 7826728
B6P3 754540 7823165
B7P1 761725 7826740
B7P2 758001 7826690
B7P3 761162 7828387
B8P1 756960 7818634
B8P2 754999 7820478
B8P3 753198 7821346
B9P1 758937 7820424
B9P2 760526 7820835
B9P3 761148 7824173
B10P1 752805 7815080
B10P2 750658 7817694
B10P3 752927 7818015
B11P1 756868 7813213
B11P2 755446 7814523
B11P3 757150 7816907
B12P1 760008 7819217
B12P2 758501 7816923
B12P3 760097 7817618
B13P1 750713 7813412
B13P2 747328 7812075
B13P3 747334 7815821
B14P1 751586 7812221
B14P2 754589 7813465
B14P3 753193 7812432
B15P1 757082 7810918
B15P2 756279 7809606
B15P3 759819 7809079
B16P1 759289 7811787
B16P2 761837 7815251
B16P3 760114 7814340
B17P1 749723 7808789
B17P2 747112 7810525
B17P3 749728 7811302
B18P1 753551 7807858
B18P2 755482 7807811
B18P3 752501 7809140

capture file (large.cap)
Session ID Occasion trapID
1 13 5 B11P3
1 15 13 B11P3
1 9 12 B13P2
1 14 11 B15P1
1 3 11 B16P1
1 8 5 B16P1
1 11 11 B16P1
1 4 10 B16P2
1 4 13 B16P2
1 5 13 B18P3
1 1 16 B2P2
1 10 16 B2P3
1 2 16 B4P3
1 6 3 B4P3
1 12 3 B8P3
1 7 1 B9P1

Murray Efford

unread,
Nov 5, 2023, 7:28:02 PM11/5/23
to unmarked
Fernando
It would be better to post on a list for spatial capture-recapture...
I think this is a quirk of .csv input. It works fine for me when I construct text input files from the data in your post, or when I add a column header for trapID in the csv trap file, e.g.
ID,x,y
B1P1,761211,7839805
B1P2,757393,7838443
...

Then
large.trap <- read.csv("largetrap.csv", header = TRUE)
large.trap <- read.traps(data = large.trap, detector = 'count', trapID = "ID")

Murray

P.S. You have only one recapture, and that is not a spatial recapture, so the data in your example are not suitable for spatial capture-recapture.

________________________________________
From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of FERNANDO CESAR CASCELLI DE AZEVEDO <faze...@ufsj.edu.br>
Sent: 06 November 2023 12:06
To: unmarked
Subject: [unmarked] Problems running secr
--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com<mailto:unmarked+u...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/0ab8fdf7-5571-4629-bc92-49c1340f163an%40googlegroups.com<https://groups.google.com/d/msgid/unmarked/0ab8fdf7-5571-4629-bc92-49c1340f163an%40googlegroups.com?utm_medium=email&utm_source=footer>.

FERNANDO CESAR CASCELLI DE AZEVEDO

unread,
Nov 6, 2023, 12:04:01 PM11/6/23
to unma...@googlegroups.com
Thank you Murray for your help and comments.

Best,



Prof. Fernando Cesar Cascelli de Azevedo

Laboratório de Ecologia de Vertebrados

Programa de Pós-Graduação em Ecologia

Departamento de Ciências Naturais



De: unma...@googlegroups.com <unma...@googlegroups.com> em nome de Murray Efford <murray...@otago.ac.nz>
Enviado: domingo, 5 de novembro de 2023 21:27
Para: unmarked <unma...@googlegroups.com>
Assunto: Re: [unmarked] Problems running secr
 


--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.

FERNANDO CESAR CASCELLI DE AZEVEDO

unread,
Nov 16, 2023, 3:24:04 PM11/16/23
to unma...@googlegroups.com
Hi Murray,  
Do you have any tutorial about how we can exclude areas of non-habitat of a habitat mask using a polygon from ArcGis (in arcGis or in Rstudio)?
I know there is a way, but in one of your tutorials (Habitat masks in the package secr), I couldn´t find more details about it. 

Thanks in advance,

Prof. Fernando Cesar Cascelli de Azevedo

Laboratório de Ecologia de Vertebrados

Programa de Pós-Graduação em Ecologia

Departamento de Ciências Naturais

 


To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/SY4PR01MB5658EB7C61B658E7D6D05F57ACABA%40SY4PR01MB5658.ausprd01.prod.outlook.com.

Murray Efford

unread,
Nov 16, 2023, 3:39:33 PM11/16/23
to unma...@googlegroups.com
Fernando

If we continue to meet like this we will likely get into trouble with the organisers of 'unmarked'!

I don't have ArcGIS and generally I expect users to sort out their own GIS issues. Presumably you will have to export spatial data in a suitable format e.g. shapefile. However, https://www.otago.ac.nz/density/pdfs/secr-spatialdata.pdf has some tips.

Murray

________________________________________
From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of FERNANDO CESAR CASCELLI DE AZEVEDO <faze...@ufsj.edu.br>
Sent: 17 November 2023 09:23
To: unma...@googlegroups.com
Subject: Re: [unmarked] Problems running secr

Hi Murray,
Do you have any tutorial about how we can exclude areas of non-habitat of a habitat mask using a polygon from ArcGis (in arcGis or in Rstudio)?
I know there is a way, but in one of your tutorials (Habitat masks in the package secr), I couldn´t find more details about it.

Thanks in advance,

Prof. Fernando Cesar Cascelli de Azevedo
Laboratório de Ecologia de Vertebrados
Programa de Pós-Graduação em Ecologia
Departamento de Ciências Naturais
[https://ci3.googleusercontent.com/mail-sig/AIorK4znizF7Rz7XrZ0Jl-2nZdrjO1krJp-vILX-LHLDiMdjZRyw9-f6SYbO1MvMYextzqqcY97vH2A]


Em dom., 5 de nov. de 2023 às 21:28, Murray Efford <murray...@otago.ac.nz<mailto:murray...@otago.ac.nz>> escreveu:
Fernando
It would be better to post on a list for spatial capture-recapture...
I think this is a quirk of .csv input. It works fine for me when I construct text input files from the data in your post, or when I add a column header for trapID in the csv trap file, e.g.
ID,x,y
B1P1,761211,7839805
B1P2,757393,7838443
...

Then
large.trap <- read.csv("largetrap.csv", header = TRUE)
large.trap <- read.traps(data = large.trap, detector = 'count', trapID = "ID")

Murray

P.S. You have only one recapture, and that is not a spatial recapture, so the data in your example are not suitable for spatial capture-recapture.

________________________________________
From: unma...@googlegroups.com<mailto:unma...@googlegroups.com> <unma...@googlegroups.com<mailto:unma...@googlegroups.com>> on behalf of FERNANDO CESAR CASCELLI DE AZEVEDO <faze...@ufsj.edu.br<mailto:faze...@ufsj.edu.br>>
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com<mailto:unmarked%2Bunsu...@googlegroups.com><mailto:unmarked+u...@googlegroups.com<mailto:unmarked%2Bunsu...@googlegroups.com>>.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/0ab8fdf7-5571-4629-bc92-49c1340f163an%40googlegroups.com<https://groups.google.com/d/msgid/unmarked/0ab8fdf7-5571-4629-bc92-49c1340f163an%40googlegroups.com><https://groups.google.com/d/msgid/unmarked/0ab8fdf7-5571-4629-bc92-49c1340f163an%40googlegroups.com?utm_medium=email&utm_source=footer<https://groups.google.com/d/msgid/unmarked/0ab8fdf7-5571-4629-bc92-49c1340f163an%40googlegroups.com?utm_medium=email&utm_source=footer>>.

--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com<mailto:unmarked%2Bunsu...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/SY4PR01MB5658EB7C61B658E7D6D05F57ACABA%40SY4PR01MB5658.ausprd01.prod.outlook.com<https://groups.google.com/d/msgid/unmarked/SY4PR01MB5658EB7C61B658E7D6D05F57ACABA%40SY4PR01MB5658.ausprd01.prod.outlook.com>.

--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com<mailto:unmarked+u...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/CAFd59Kn4_X%3D4i4EOyLwdkCwHxG-a8z54PLCN6Nx7pag%2BMtntYw%40mail.gmail.com<https://groups.google.com/d/msgid/unmarked/CAFd59Kn4_X%3D4i4EOyLwdkCwHxG-a8z54PLCN6Nx7pag%2BMtntYw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

FERNANDO CESAR CASCELLI DE AZEVEDO

unread,
Nov 16, 2023, 3:43:17 PM11/16/23
to unma...@googlegroups.com
Ok thanks and sorry about that.  I will try to post my comments and questions only into the unmarked group.

Best,  

Prof. Fernando Cesar Cascelli de Azevedo

Laboratório de Ecologia de Vertebrados

Programa de Pós-Graduação em Ecologia

Departamento de Ciências Naturais

 



To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/SY4PR01MB5658633FAAC008B62380C633ACB0A%40SY4PR01MB5658.ausprd01.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages