Skip to content

Commit

Permalink
initial revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyhanson committed Feb 22, 2020
0 parents commit fe509b5
Show file tree
Hide file tree
Showing 223 changed files with 44,719 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
^doc$
^Meta$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^gurobi\.log$
^revdep$
^docs$
^appveyor\.yml$
.gitkeep
^Makefile$
cran-comments.md
CRAN-RELEASE
_pkgdown.yml
check.log
test.log
gp.log
spell.log
README.Rmd
inst/extdata/dictionary.txt
^_pkgdown\.yml$
^CONTRIBUTING\.md$
^CONTRIBUTING\.Rmd$
src/amalgamation/dmlc-minimum0.o
src/amalgamation/xgboost-all0.o
src/rabit/src/c_api.o
src/rabit/src/engine_empty.o
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Meta
doc
# C++ compiled files
*.o
*.so
*.dll

# R profile files
*.Rproj.user
*.Rhistory
.Rproj.user
# log files
gurobi.log
test.log
check.log
spell.log
gp.log
# system files
.directory
# do not ignore the following files
!.gitkeep
!*/
!inst/doc/*.html
!inst/doc/*.Rmd
!inst/doc/.gitkeep
# devtools files
doc/*
Meta/*
.build.timestamp
73 changes: 73 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Package: surveyvoi
Type: Package
Version: 0.0.1
Title: Survey Value of Information
Description: Develop candidate survey schemes for sampling biodiversity, and
and evaluate their return on investment using value of
information analyses.
Authors@R: c(person(c('Jeffrey', 'O'), 'Hanson',
email='[email protected]', role = c('aut', 'cre')),
person(c('Joseph'), 'Bennett',
email='[email protected]', role = c('aut')))
Imports:
utils,
methods,
stats,
Matrix,
parallel,
magrittr (>= 1.5),
assertthat (>= 0.2.0),
tibble (>= 2.0.0),
xgboost (>= 1.0.0.1),
rBayesianOptimization (>= 1.1.0),
Metrics (>= 0.1.4),
plyr (>= 1.8.4),
withr (>= 2.1.2),
tibble (>= 2.1.3),
scales (>= 1.0.0),
doParallel (>= 1.0.15),
RandomFields (>= 3.3.7),
vegan (>= 2.5-6),
RcppAlgos (>= 2.3.6)
Suggests:
testthat (>= 2.0.0),
knitr (>= 1.20),
roxygen2 (>= 6.1.0),
rmarkdown (>= 1.10),
gurobi (>= 8.1.0),
tidyr (>= 1.0.0),
ggplot2 (>= 3.2.0),
gridExtra (>= 2.3),
viridis (>= 0.5.1)
Depends:
R (>= 3.4.0),
sf (>= 0.8.0)
LinkingTo:
Rcpp (>= 0.12.19),
RcppEigen (>= 0.3.3.7.0),
RcppProgress (>= 0.4.1),
RcppNumerical (>= 0.3-3)
License: GPL-3
LazyData: true
SystemRequirements:
C++11,
gurobi (>= 8.1.0),
gmp (>= 4.2.3)
URL: https://github.com/jeffreyhanson/surveyroi
BugReports: https://github.com/jeffreyhanson/surveyroi/issues
VignetteBuilder: knitr
RoxygenNote: 6.1.1
Collate:
'RcppExports.R'
'internal.R'
'env_div_survey_scheme.R'
'feasible_survey_schemes.R'
'tune_occupancy_models.R'
'fit_occupancy_models.R'
'geo_cov_survey_scheme.R'
'package.R'
'relative_site_richness_scores.R'
'relative_site_uncertainty_scores.R'
'simulate_feature_data.R'
'simulate_site_data.R'
'weighted_survey_scheme.R'
51 changes: 51 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
all: initc data docs test check

initc:
R --slave -e "Rcpp::compileAttributes()"
R --slave -e "tools::package_native_routine_registration_skeleton('.', 'src/init.c', character_only = FALSE)"

docs: man readme vigns

readme:
R --slave -e "rmarkdown::render('README.Rmd')"

man:
R --slave -e "devtools::document()"

vigns:
R --slave -e "devtools::build_vignettes(install = FALSE)"
cp -R doc inst/
touch inst/doc/.gitkeep

purl_vigns:
R --slave -e "lapply(dir('vignettes', '^.*\\\\.Rmd$$'), function(x) knitr::purl(file.path('vignettes', x), gsub('.Rmd', '.R', x, fixed = TRUE)))"

quicksite:
R --slave -e "pkgdown::build_site(run_dont_run = TRUE, lazy = TRUE)"
cp -R doc inst/

site:
R --slave -e "pkgdown::clean_site()"
R --slave -e "pkgdown::build_site(run_dont_run = TRUE, lazy = TRUE)"
cp -R doc inst/

test:
R --slave -e "devtools::test()" > test.log 2>&1
rm -f tests/testthat/Rplots.pdf

quickcheck:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(build_args = '--no-build-vignettes', args = '--no-build-vignettes', run_dont_test = TRUE, vignettes = FALSE)" >> check.log 2>&1se
cp -R doc inst/
touch inst/doc/.gitkeep

check:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(build_args = '--no-build-vignettes', args = '--no-build-vignettes', run_dont_test = TRUE, vignettes = FALSE)" >> check.log 2>&1
cp -R doc inst/
touch inst/doc/.gitkeep

install:
R --slave -e "devtools::install_local('../surveyroi', force = TRUE, upgrade = 'never')"

.PHONY: initc docs site test check checkwb build install man readme vigns site quicksite
13 changes: 13 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by roxygen2: do not edit by hand

export(env_div_survey_scheme)
export(feasible_survey_schemes)
export(fit_occupancy_models)
export(geo_cov_survey_scheme)
export(relative_site_richness_scores)
export(relative_site_uncertainty_scores)
export(simulate_feature_data)
export(simulate_site_data)
export(tune_occupancy_models)
export(weighted_survey_scheme)
useDynLib(surveyvoi, .registration = TRUE)
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# surveyvoi 0.0.1

- Initial commit.
79 changes: 79 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

rcpp_approximate_expected_value_of_prioritization <- function(solution, pij, alpha, gamma, states) {
.Call(`_surveyvoi_rcpp_approximate_expected_value_of_prioritization`, solution, pij, alpha, gamma, states)
}

rcpp_appproximate_expected_value_of_management_decision_given_current_information <- function(pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap, n_approx_states) {
.Call(`_surveyvoi_rcpp_appproximate_expected_value_of_management_decision_given_current_information`, pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap, n_approx_states)
}

rcpp_approximate_expected_value_of_management_decision_given_perfect_information <- function(pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap, n_approx_states) {
.Call(`_surveyvoi_rcpp_approximate_expected_value_of_management_decision_given_perfect_information`, pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap, n_approx_states)
}

rcpp_expected_value_of_management_action <- function(solution, pij, alpha, gamma) {
.Call(`_surveyvoi_rcpp_expected_value_of_management_action`, solution, pij, alpha, gamma)
}

rcpp_expected_value_of_management_decision_given_current_information <- function(pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap) {
.Call(`_surveyvoi_rcpp_expected_value_of_management_decision_given_current_information`, pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap)
}

rcpp_expected_value_of_management_decision_given_perfect_information <- function(pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap) {
.Call(`_surveyvoi_rcpp_expected_value_of_management_decision_given_perfect_information`, pij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap)
}

rcpp_feasible_actions_ilp_matrix <- function(x) {
.Call(`_surveyvoi_rcpp_feasible_actions_ilp_matrix`, x)
}

rcpp_pmedian_constraint_matrix <- function(x, costs) {
.Call(`_surveyvoi_rcpp_pmedian_constraint_matrix`, x, costs)
}

rcpp_prioritization <- function(rij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap, file_path) {
.Call(`_surveyvoi_rcpp_prioritization`, rij, pu_costs, pu_locked_in, alpha, gamma, n_approx_obj_fun_points, budget, gap, file_path)
}

rcpp_total_probability_of_positive_result <- function(prior, sensitivity, specificity) {
.Call(`_surveyvoi_rcpp_total_probability_of_positive_result`, prior, sensitivity, specificity)
}

rcpp_total_probability_of_negative_result <- function(prior, sensitivity, specificity) {
.Call(`_surveyvoi_rcpp_total_probability_of_negative_result`, prior, sensitivity, specificity)
}

rcpp_probability_of_outcome <- function(oij, total_probability_of_survey_positive, total_probability_of_survey_negative, idx) {
.Call(`_surveyvoi_rcpp_probability_of_outcome`, oij, total_probability_of_survey_positive, total_probability_of_survey_negative, idx)
}

rcpp_probability_of_state <- function(sij, pij) {
.Call(`_surveyvoi_rcpp_probability_of_state`, sij, pij)
}

rcpp_nth_state_sparse <- function(n, matrix, idx) {
.Call(`_surveyvoi_rcpp_nth_state_sparse`, n, matrix, idx)
}

rcpp_nth_state <- function(n, matrix) {
.Call(`_surveyvoi_rcpp_nth_state`, n, matrix)
}

rcpp_n_states <- function(n) {
.Call(`_surveyvoi_rcpp_n_states`, n)
}

rcpp_which_state <- function(matrix, idx) {
.Call(`_surveyvoi_rcpp_which_state`, matrix, idx)
}

rcpp_fit_xgboost_models_and_assess_performance <- function(rij, wij, pu_env_data_raw, survey_features, xgb_parameters, n_xgb_nrounds, xgb_train_folds, xgb_test_folds) {
.Call(`_surveyvoi_rcpp_fit_xgboost_models_and_assess_performance`, rij, wij, pu_env_data_raw, survey_features, xgb_parameters, n_xgb_nrounds, xgb_train_folds, xgb_test_folds)
}

rcpp_xgboost <- function(y, train_x_raw, predict_x_raw, xgb_parameters, n_xgb_nrounds) {
.Call(`_surveyvoi_rcpp_xgboost`, y, train_x_raw, predict_x_raw, xgb_parameters, n_xgb_nrounds)
}

Loading

0 comments on commit fe509b5

Please sign in to comment.