Error in 'install_github("jniedballa/camtrapR"

379 views
Skip to first unread message

Magda Sitarz

unread,
Mar 11, 2021, 4:02:01 AM3/11/21
to camtrapR
Hello,
I have a problem with the code 'install_github("jniedballa/camtrapR")'. Even though I install the camptrapR package from the website: 
I still receive the notice that the function 'install_github' was not found. 

I think that because of that error I have also problem with the 2 codes:
 'exifTagNames(fileName = "D:/Digikam/Filmy/")' and the function  'exifTagNames,
'recordTable(inDir = "D:/Digikam/Filmy", IDfrom = "metadata", and the function 'recordTable'

Could You please help me to solve that problem? Maybe there is something wrong with my installation of the camptrapR package.

With best regards,
Magda

Juergen Niedballa

unread,
Mar 11, 2021, 4:11:13 AM3/11/21
to camt...@googlegroups.com

Hi Madga,

install_github requires the devtools or remotes package. But that is only necessary if you wish to install the development version of camtrapR from github (code to do that is here on the group).

To install the release version from CRAN, simply use the standard installation command:

install.packages("camtrapR")

If this doesn't help please share the code you used and the messages / errors you got.

Thank you,

Jürgen

--
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 on the web, visit https://groups.google.com/d/msgid/camtrapr/fa890b75-d3e3-42f9-9793-2d68aa986a4dn%40googlegroups.com.

Magda Sitarz

unread,
Mar 11, 2021, 6:44:40 AM3/11/21
to camtrapR
I am new in this CameratrapR package so I think i might be doing some mistakes. I would like to create a species record table from camera trap images. But I have problem in the beginning. I followed your advice and use the command, but I still have a problem with it. Coul You please tell me what is wrong with it? I pasted the commands that I used below. Thank You fro your help!

install.packages("remotes")
install_github("jniedballa/camtrapR")
install.packages("camtrapR")
install.packages("RSQLite")
install.packages("exiftoolr")
install.packages("plotKML")

And I received below messages/errors:

 > install.packages("remotes"),
Installing package into ‘C:/Users/Magda/Documents/R/win-library/4.0’,
(as ‘lib’ is unspecified),
Content type 'application/zip' length 387606 bytes (378 KB),
downloaded 378 KB

,,package ‘remotes’ successfully unpacked and MD5 sums checked,,
The downloaded binary packages are in,    C:\Users\Magda\AppData\Local\Temp\RtmpCMpPA6\downloaded_packages,

> install_github("jniedballa/camtrapR"),
Mistake in the command 'install_github("jniedballa/camtrapR")':, 
the function was no found 'install_github',

> install.packages("camtrapR"),
Installing package into ‘C:/Users/Magda/Documents/R/win-library/4.0’,
(as ‘lib’ is unspecified),
Content type 'application/zip' length 5109963 bytes (4.9 MB),
downloaded 4.9 MB,,
package ‘camtrapR’ successfully unpacked and MD5 sums checked  

Juergen Niedballa

unread,
Mar 14, 2021, 3:01:43 PM3/14/21
to camtrapR
Hi Magda, 
it looks like camtrapR installed correctly: 
package ‘camtrapR’ successfully unpacked and MD5 sums checked  

Can you load it with 
library(camtrapR)
?

install_github("jniedballa/camtrapR") probably didn't work because the required package (devtools) was not loaded first. It doesn't matter though because install.packages installed camtrapR. 

Best,
Jürgen

Magda Sitarz

unread,
Mar 16, 2021, 4:20:19 AM3/16/21
to camtrapR
Hello Jurgen,
Thank You for your help. 
So, if I wan to use install_github("jniedballa/camtrapR"), I should first use: install.package ("devtools")? 

Yes, I can load the library(camptrapR). Despite the successful installation of the packages, functions such as recordTable and exifTagNames are still not recognised.

> help("exifTagNames")
No documentation for ‘exifTagNames’ in specified packages and libraries:
  you could try ‘??exifTagNames’
> exifTagNames(fileName = "D:/Digikam/Filmy/")   
mistake in the code 'exifTagNames(fileName = "D:/Digikam/Filmy/")':
 Function was not found 'exifTagNames'

With best regards,
Magda

Juergen Niedballa

unread,
Mar 16, 2021, 5:40:17 PM3/16/21
to camtrapR
Hi Magda, 
yes, to use install_github():
install.packages("devtools")
library("devtools")

But like I said it's not really relevant at this moment.

What happens when you type:
?exifTagNames

or
example("exifTagNames")

or simply
?camtrapR

If you're unsure please share your command and the exact R output.

Best,
Jürgen

Magda Sitarz

unread,
Mar 18, 2021, 4:17:49 AM3/18/21
to camtrapR
Hello,
I am using below commands:

install.packages("remotes")
install.packages("camtrapR")
install.packages("RSQLite")
install.packages("exiftoolr")
install.packages("plotKML")

library(remotes)
library(camtrapR)
library("exiftoolr")
library(exiftoolr)
library(rgdal)
library(plotKML)
library(RSQLite)
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
Sys.which("make")
install.packages("jsonlite", type = "source")
exiftoolPath ="C:/Windows"
Sys.which("exiftool")

setwd("D:/Digikam/Filmy")
cam_table <- read.csv("cam_table.csv")
head(cam_table)
names(cam_table)
names(cam_table)[names(cam_table)=="ï..Station"] <- "Station"
names(cam_table)  #checking if worked

wd_images_raw <- "D:/Digikam/Filmy"


help('exifTagNames')
exifTagNames(fileName = "D:/Digikam/Filmy/")   


vid_spp_table <- recordTable(inDir = "D:/Digikam/Filmy", IDfrom = "metadata", metadataSpeciesTag = "GATUNEK", cameraID = "directory", camerasIndependent = TRUE, minDeltaTime = 0, timeZone = "Europe/Warsaw", writecsv = TRUE, removeDuplicateRecords = FALSE, video = list(file_formats = c("mp4", "avi", "mov"), dateTimeTag = "FileModifyDate", db_directory = "D:/Digikam/Filmy", db_filename = "digiKam4.db"))


And here is the ouput from R:
> install.packages("camtrapR")
Installing package into ‘C:/Users/Magda/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Content type 'application/zip' length 5109893 bytes (4.9 MB)
downloaded 4.9 MB

> library(camtrapR)
This is camtrapR 2.0.3 (CURRENT)

> help('exifTagNames')
No documentation for ‘exifTagNames’ in specified packages and libraries:
you could try ‘??exifTagNames’
> exifTagNames(fileName = "D:/Digikam/Filmy/")   
Error in the command 'exifTagNames(fileName = "D:/Digikam/Filmy/")':
  the function was not found 'exifTagNames'
> vid_spp_table <- recordTable(inDir = "D:/Digikam/Filmy", IDfrom = "metadata", metadataSpeciesTag = "GATUNEK", cameraID = "directory", camerasIndependent = TRUE, minDeltaTime = 0, timeZone = "Europe/Warsaw", writecsv = TRUE, removeDuplicateRecords = FALSE, video = list(file_formats = c("mp4", "avi", "mov"), dateTimeTag = "FileModifyDate", db_directory = "D:/Digikam/Filmy", db_filename = "digiKam4.db"))
Error in the command 'recordTable(inDir = "D:/Digikam/Filmy", IDfrom = "metadata", ':
  the function was not found 'recordTable'

It seems that there is a mistake regarding the camtrapR, but I am able to install the packages. However I have a problem with two functions from the camtrapR packages.

Thank you very much for your help.
With best regards,
Magda

Juergen Niedballa

unread,
Mar 20, 2021, 8:46:56 AM3/20/21
to camtrapR
Hi Magda, 
camtrapR installed and was loaded correctly from what I see:
This is camtrapR 2.0.3 (CURRENT)

Don't use help() to access the function reference. Instead, try
?exifTagNames 

Also, do any of the  other camtrapR functions work? Can you for example try the following please and tell me if you get any output?
example(detectionHistory)

Thank you,
Jürgen

Magda Sitarz

unread,
Mar 23, 2021, 3:34:33 AM3/23/21
to camtrapR
Hello Jürgen,
unfortunatelly, I still have a problem with the camptrapR package. I did what You suggested and I received below output:

> ?exifTagNames ("exifTagNames")
Error in the command '.helpForCall(topicExpr, parent.frame())':
  no methods for ‘exifTagNames’ and no documentation for it as a function
> ?exifTagNames(fileName = "D:/Digikam/Filmy")   
Error in the command'.helpForCall(topicExpr, parent.frame())':
  no methods for ‘exifTagNames’ and no documentation for it as a function
> vid_spp_table <- recordTable(inDir = " D:/Digikam/Filmy ", IDfrom = "metadata", metadataSpeciesTag = "GATUNEK", cameraID = "directory", camerasIndependent = TRUE, minDeltaTime = 0, timeZone = "Europe/Warsaw", writecsv = TRUE, removeDuplicateRecords = FALSE, video = list(file_formats = c("mp4", "avi", "mov"), dateTimeTag = "FileModifyDate", db_directory = " D:/Digikam/Filmy ", db_filename = "digiKam4.db"))
Error in the command 'recordTable(inDir = " D:/Digikam/Filmy ", IDfrom = "metadata", ':
  The function could not be found   'recordTable'
> example(detectionHistory)
Warning message:
In the command 'example(detectionHistory)':   no help found for ‘detectionHistory’

Thank you very much for your help so far and I will be very grateful for your help in solving this problem.
With best regards,
Magda

Juergen Niedballa

unread,
Mar 23, 2021, 6:11:51 AM3/23/21
to camtrapR
Hi Magda, 
can you please start a new R session, run the following two lines and send me the output?

library(camtrapR)
sessionInfo()

Thank you,
Jürgen

Magda Sitarz

unread,
Mar 23, 2021, 10:31:53 AM3/23/21
to camtrapR
Hello,
below I am sending the output:

> library(camtrapR)
This is camtrapR 2.0.3 (CURRENT)
> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Polish_Poland.1250  LC_CTYPE=Polish_Poland.1250    LC_MONETARY=Polish_Poland.1250
[4] LC_NUMERIC=C                   LC_TIME=Polish_Poland.1250    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] camtrapR_2.0.3

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6          codetools_0.2-18    lattice_0.20-41     MASS_7.3-53         grid_4.0.4         
 [6] nlme_3.1-152        magrittr_2.0.1      RcppParallel_5.0.3  stringi_1.5.3       data.table_1.14.0  
[11] raster_3.4-5        sp_1.4-5            Matrix_1.3-2        secr_4.3.3          overlap_0.3.3      
[16] splines_4.0.4       tools_4.0.4         stringr_1.4.0       RcppNumerical_0.4-0 abind_1.4-5        
[21] parallel_4.0.4      compiler_4.0.4      mgcv_1.8-33        

With best regards,
Magda

Juergen Niedballa

unread,
Mar 23, 2021, 1:03:58 PM3/23/21
to camtrapR
Hi Magda,
this looks good, I can't see any problems there. camtrapR is loaded and you use the most recent R. I really don't understand why R doesn't find the functions after successfully loading the package. Did you ever have this problem with another package?
What happens when you do this: 
library(camtrapR)
?camtrapR

Normally a help file should open. 

Can you try removing camtrapR and installing it again please?

Jürgen

Magda Sitarz

unread,
Mar 26, 2021, 5:40:56 AM3/26/21
to camtrapR
Hello,
No, this is the first time when I have this problem. I didn't have this problem before. But I had to reinstall the R program and now I can't deal with it.

Yes, I can open the help file.


I tried to install the camptrapR using:

library(remotes)
install_github("jniedballa/camtrapR")

And the version camtrapR 2.1.0 (DEVELOPMENT) was installed.

The previous errors did not showed, but I have a new one:

> vid_spp_table <- recordTable(inDir = " D:/Digikam/Filmy", IDfrom = "metadata", metadataSpeciesTag = "GATUNEK", cameraID = "directory", camerasIndependent = TRUE, minDeltaTime = 0, timeZone = "Europe/Warsaw", writecsv = TRUE, removeDuplicateRecords = FALSE, video = list(file_formats = c("mp4", "avi", "mov"), dateTimeTag = "FileModifyDate", db_directory = " D:/Digikam/Filmy", db_filename = "digiKam4.db"))

ERROR: Could not find inDir:
 D:/Digikam/Filmy


Thank you for your help,
With best regards,
Magda


Juergen Niedballa

unread,
Mar 29, 2021, 11:52:57 AM3/29/21
to camtrapR
Hi Magda, 
that's better, at least that is a camtrapR error. It seems the directory "D:/Digikam/Filmy" doesn't exist. So please check that it is specified correctly. 
If you are new to camtrapR I'd suggest to start with some simple data first, just a few images and one station for example. That way it is easier to see what is happening (as opposed to thousands of images and videos from dozens of stations). 
Best,
Jürgen

Magda Sitarz

unread,
Apr 2, 2021, 9:25:23 AM4/2/21
to camtrapR
Hi Jurgen,
Thank you very much for all your help and support. It seems that everything is correct now.
With best regards,
Magda

Reply all
Reply to author
Forward
0 new messages