Description Usage Arguments Details Value Status Note Examples
Tests the results stored in the Distance for Windows project file against those generated from running the same analysis in R.
1 | test_stats(analysis, statuses = 1, tolerance = 0.01)
|
analysis |
a converted (but not run) analysis |
statuses |
for which statuses should tests be run? See "Status", below (Defaults to |
tolerance |
the tolerance of the test (default 0.01) |
A previous call to convert_project
will return a list of projects. Only one analysis at a time can be run with test_stats
. If you wish to run all the analyses in the project, you can use lapply
.
a data.frame
with five columns: Statistic
, a description of the tested statistic; Distance_value
the value of the statistic stored by Distance for Windows; mrds_value
the value of the statistic calculated by mrds
; Difference
the proportional difference between the previous two columns (computed using all.equal
); Pass
a series of ticks, indicating that the value in the Difference
column is less than tolerance
.
The status
code is taken from Distance for Windows to indicate whether the analysis has been run yet and what the outcome was. Status codes are as follows:
0
analyses has not been run in Distance for Windows yet
1
analysis ran without errors or warnings
2
analysis ran with warnings
3
analysis ran with errors
If an analysis has a status of 0 or 3 there will usually not be any statistics attached to the analysis, so no tests will be run.
Note that an analysis that runs with error in Distance for Windows may run fine in R and an analysis that runs fine in Distance for Windows may not work in R. In the latter case, please consider submitting this a a bug to github.com/distancedevelopment/distance-bugs.
Tests all available statistics.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
library(readdst)
# load the golftees sample project and convert it
project <- system.file("Golftees-example", package="readdst")
project <- paste0(project,"/Golftees")
converted <- convert_project(project)
# run tests for analysis 1
test_stats(converted[[1]])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.