Re: [camtrapR] multiple species per image

8 views
Skip to first unread message

Jürgen Niedballa

unread,
May 23, 2026, 7:51:06 AMMay 23
to Jorge Luis Godoy, camtrapR
Hello and sorry for the late reply,
Quick answer, no, this is not possible out of the box. The tagging workflow was not designed for this specific problem, so we are hitting the limits of what camtrapR can do by default.

But I'll still try to sketch a solution, which will require some manual processing of the record table though. 

As you noted you can assign multiple species per image, but a single "individual" Tag doesn't work when you have individuals of multiple species per image.

You can however have subgroups within the "Individual" tag, for example "individual_tiger" or "individual_leopard", with their respective individual names or IDs (let's say we use "1", "2", etc for both). So something like: 
Individual > individual_tiger > 1.
These tags will be extracted by recordTable and are available in the "HierarchicalSubject" column. 

You can run recordTable (returning all records), which for an image with two species gives you two rows. By matching the species name from the "Species" field (e.g. Tiger) to the name of the individual tags in the HierarchicalSubject column (e.g. "individual|individual_tiger|1" or "individual|individual_leopard|2") you can assign the individual to each row. Then you'd need to summarize the number of individuals in a given time period as needed.

I don't have readymade code but I hope this gives an idea of a possible solution. Do you think that would work for you? 

Best regards



On Mon, Apr 27, 2026, 11:19 Jorge Luis Godoy <ingj...@gmail.com> wrote:

Hello, my name is Jorge.

I recently started working with the camtrapR package, specifically using the recordTable() function. I understand that it is possible to assign more than one species to the HierarchicalSubject tag, but I am facing an issue when trying to extract the maximum number of individuals per event (based on the defined minDeltaTime).

When working with a single species per image, I can use an additional metadata field (e.g., UserComment) to store the number of individuals, and then summarize it correctly using:

rt_all <- recordTable(
  inDir                  = "C:/Prueba2/",
  IDfrom                 = "metadata",
  metadataSpeciesTag     = "animal",
  metadataHierarchyDelimitor = "|",
  minDeltaTime           = 30,
  additionalMetadataTags = c("UserComment"),
  eventSummaryColumn     = "UserComment",
  eventSummaryFunction   = "max",
  deltaTimeComparedTo    = "lastIndependentRecord",
  timeZone               = "America/Argentina/Buenos_Aires",
  removeDuplicateRecords = FALSE
)


In this case, UserComment contains the number of individuals and works as expected.

The issue arises when a single image contains two or more species. While I can include multiple species in HierarchicalSubject (separated by commas), I cannot do the same in UserComment, because recordTable() expects the eventSummaryColumn to be numeric.

Duplicating images to assign one species per file is also not a viable solution, since recordTable() removes duplicates (images with the same timestamp), especially when minDeltaTime > 0.

In summary, my question is:

Is there a way to work with multiple species per image in camtrapR while also correctly calculating the maximum number of individuals per species within the time window defined by minDeltaTime?

Any suggestions or alternative workflows would be greatly appreciated.

Thank you very much!

--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/camtrapr/1b7a701f-a130-4ca3-acec-5031407a1863n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages