Commit f48a47bb authored by Chris Holbrook's avatar Chris Holbrook

add test for convert_glatos_to_att output and add example walleye att internal...

add test for convert_glatos_to_att output and add example walleye att internal data to check against
parent d8373656
No preview for this file type
#Make internal data object walleye_att for testing
# (example data object)
#get path to example detections file
dtc_file <- system.file("extdata",
"walleye_detections.csv", package = "glatos")
#get path to example receiver file
rec_file <- system.file("extdata", "sample_receivers.csv",
package = "glatos")
#create new objects
walleye_detections <- read_glatos_detections(dtc_file)
rcv <- read_glatos_receivers(rec_file) # load receiver data
walleye_att <- convert_glatos_to_att(walleye_detections, rcv)
#----------------------------------------------------
#add to sysdata.rda
rda_file <- file.path(".","R/sysdata.rda")
glatos:::add_internal_data(walleye_att, rda_file)
#for exported ('public') data
#devtools::use_data(walleye_detections, pkg = "..", overwrite = TRUE)
......@@ -5,7 +5,7 @@
dtc_file <- system.file("extdata",
"walleye_detections.csv", package = "glatos")
#create new object
#create new objects
walleye_detections <- read_glatos_detections(dtc_file)
#----------------------------------------------------
......
context("Check convert_glatos_to_att")
#check against internal data object 'walleye_att' in R/sysdata.r
# Actual result
#get path to example detection file
wd_file <- system.file("extdata",
"walleye_detections.csv", package = "glatos")
wald <- read_glatos_detections(wd_file)
#get path to example receiver file
rec_file <- system.file("extdata", "sample_receivers.csv",
package = "glatos")
recd <- read_glatos_receivers(rec_file) # load receiver data
watt <- convert_glatos_to_att(wald, recd)
# Test using testthat library
test_that("walleye_att gives expected result", {
# Check if expected and actual results are the same
expect_equal(watt, walleye_att)
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment