# NOT RUN {
data(camtraps)
data(recordTableSample)
reportTest <- surveyReport (recordTable = recordTableSample,
CTtable = camtraps,
speciesCol = "Species",
stationCol = "Station",
setupCol = "Setup_date",
retrievalCol = "Retrieval_date",
CTDateFormat = "%d/%m/%Y",
recordDateTimeCol = "DateTimeOriginal",
recordDateTimeFormat = "%Y-%m-%d %H:%M:%S")
class(reportTest) # a list with
length(reportTest) # 5 elements
reportTest[[1]] # camera trap operation times and image date ranges
reportTest[[2]] # number of species by station
reportTest[[3]] # number of events and number of stations by species
reportTest[[4]] # number of species events by station
reportTest[[5]] # number of species events by station including 0s (non-observed species)
# with camera problems
reportTest_problem <- surveyReport (recordTable = recordTableSample,
CTtable = camtraps,
speciesCol = "Species",
stationCol = "Station",
setupCol = "Setup_date",
retrievalCol = "Retrieval_date",
CTDateFormat = "%d/%m/%Y",
recordDateTimeCol = "DateTimeOriginal",
recordDateTimeFormat = "%Y-%m-%d %H:%M:%S",
CTHasProblems = TRUE)
reportTest_problem$survey_dates
# }
# NOT RUN {
# run again with sinkpath defined
reportTest <- surveyReport (recordTable = recordTableSample,
CTtable = camtraps,
speciesCol = "Species",
stationCol = "Station",
setupCol = "Setup_date",
retrievalCol = "Retrieval_date",
CTDateFormat = "%d/%m/%Y",
recordDateTimeCol = "DateTimeOriginal",
recordDateTimeFormat = "%Y-%m-%d %H:%M:%S",
sinkpath = getwd())
# have a look at the text file
readLines(list.files(getwd(), pattern = paste("survey_report_", Sys.Date(), ".txt", sep = ""),
full.names = TRUE))
# }
Run the code above in your browser using DataLab