knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-",
  message = FALSE)

library(nestboxphotos)

nestboxphotos

This package contains functions for repeatedly downloading SD card images (from trail cameras inside American kestrel nest boxes), determining which photos are actually new to the research drive, copying new photos into the drive, and renaming them by nest box ID and datetime for the Full Cycle Phenology Project.

Installing nestboxphotos

The nestboxphotos package requires you to have R and RStudio installed. After that, it's simple to install and load the nestboxphotos package.

# If devtools package is not installed
install.packages("devtools", dependencies = TRUE)

# Now install and load nestboxphotos
devtools::install_github("jaymwin/nestboxphotos")
library(nestboxphotos)

Using nestboxphotos

  1. Add SD card images to the research drive with the proper folder hierarchy

Copy the 'DCIM' folder from each SD card into its respective nest box folder in the 'photos_to_upload' folder. Directories must be organized this way or the code will stop (for Spypoint and Reconyx cameras):

photos_to_upload/AK/AK01/DCIM/100DSCIM/PICT0001.JPG

photos_to_upload/NM/NM18/DCIM/100RECNX/IMG_0001.JPG

  1. Establish research drive directories
# if using a Mac this is the research drive path
macbook <- '/Volumes/Research/HeathLab/American Kestrel projects/Full_Cycle_Phenology/'

# for windows, this is the path
windows <- 'Z:/HeathLab/American Kestrel projects/Full_Cycle_Phenology/'

year_for_photos <- 2019 # year of nest box monitoring
directory_to_drive <- macbook # this is the folder that contains upload/raw/renamed folders
ggplot_location <- '/Users/Jay/Desktop' # path where you want to export the timeline plot

# this will create file paths to photo folders
setup_directories(year_for_photos)
  1. Ingest photos, determine which ones are new to the research drive, and rename them
# this will break if folder hierarchy is not correct
update_photos(
  directory_to_drive,
  year_for_photos,
  photos_to_upload,
  raw_photo_location,
  renamed_photo_location
)
  1. Plot a timeline of all the current renamed photos in the drive
plot_photo_timeline(directory_to_drive, renamed_photo_location, ggplot_location)  
  1. Finally, if everything worked then delete the photos that were already in the drive
delete_redundant_photos(directory_to_drive, photos_to_upload)


jaymwin/fcpp documentation built on March 23, 2020, 5:26 a.m.