Skip to content

Commit

Permalink
Fix some issues to pass CRAN checks
Browse files Browse the repository at this point in the history
/!\ WARNING: replaced complem_init_values that is not used by user_init_values, but I'm not sure it is what was meant.
  • Loading branch information
VEZY committed Dec 13, 2019
1 parent 07b1893 commit b29ca0e
Show file tree
Hide file tree
Showing 18 changed files with 536 additions and 411 deletions.
5 changes: 4 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
CODE_OF_CONDUCT.md
README.Rmd

# temporary
R/tests.txt
Preliminary\ work
tmp
vignettes/JavaSTICS-1.41-stics-9.0
vignettes/ApsimX_parameter_estimation_simple_case_files
vignettes/Parameter_estimation_Specific_and_Varietal_files
vignettes/Parameter_estimation_simple_case_files
vignettes/Parameter_estimation_simple_case_files
8 changes: 6 additions & 2 deletions R/get_params_bounds.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
#'
#' # A case with groups of situations per parameter
#' prior_information=list()
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1", "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),lb=0.0005,ub=0.0025)
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"), c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),lb=c(50,50),ub=c(400,400))
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1",
#' "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),
#' lb=0.0005,ub=0.0025)
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"),
#' c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),
#' lb=c(50,50),ub=c(400,400))
#' SticsOptimizR:::get_params_bounds(prior_information)
#' }

Expand Down
12 changes: 8 additions & 4 deletions R/get_params_init_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@
#'
#' Cases with groups of situations per parameter
#' prior_information=list()
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1", "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1",
#' "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),
#' init_values=0.001,lb=0.0001,ub=0.1)
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"), c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"),
#' c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),
#' init_values=c(200,300),lb=50,ub=400)
#' get_params_init_values(prior_information)
#'
#' prior_information=list()
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1", "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1",
#' "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),
#' init_values=c(0.001,0.002),lb=0.0001,ub=0.1)
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"), c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"),
#' c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),
#' init_values=data.frame(c(200,300),c(250,350)),lb=50,ub=400)
#' SticsOptimizR:::get_params_init_values(prior_information)
#' }
Expand Down
8 changes: 6 additions & 2 deletions R/get_params_names.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
#'
#' # A case with groups of situations per parameter
#' prior_information=list()
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1", "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),lb=0.0005,ub=0.0025)
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"), c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),lb=c(50,50),ub=c(400,400))
#' prior_information$dlaimax=list(sit_list=list(c("bou99t3", "bou00t3", "bou99t1", "bou00t1",
#' "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+")),
#' lb=0.0005,ub=0.0025)
#' prior_information$durvieF=list(sit_list=list(c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"),
#' c("bou99t3", "bou00t3", "bou99t1", "bou00t1")),
#' lb=c(50,50),ub=c(400,400))
#' SticsOptimizR:::get_params_names(prior_information)
#' }

Expand Down
3 changes: 2 additions & 1 deletion R/get_params_per_sit.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#' active for the given situation
#'
#' @examples
#' sg=list(p1=list(sit_list=list(c("sit1","sit2","sit3"),c("sit4","sit5","sit6"))),p2=list(sit_list=list(c("sit1","sit2","sit3","sit4","sit5","sit6"))))
#' sg=list(p1=list(sit_list=list(c("sit1","sit2","sit3"),c("sit4","sit5","sit6"))),
#' p2=list(sit_list=list(c("sit1","sit2","sit3","sit4","sit5","sit6"))))
#' vec=c(1,2,3)
#' SticsOptimizR:::get_params_per_sit(sg,"sit2",vec) # should give c(1,3)
#' SticsOptimizR:::get_params_per_sit(sg,"sit4",vec) # should give c(2,3)
Expand Down
2 changes: 1 addition & 1 deletion R/optim_switch.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ optim_switch <- function(param_names,obs_list,crit_function,model_function,model

sample_sz=nb_rep-NROW(init_values)
if (sample_sz>0) {
init_values=rbind(init_values,complem_init_values)
init_values=rbind(init_values,user_init_values)
}

# Run nloptr for each repetition
Expand Down
8 changes: 6 additions & 2 deletions man/get_params_bounds.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions man/get_params_init_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/get_params_names.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/get_params_per_sit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions man/main_optim.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions man/optim_switch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/ApsimX_parameter_estimation_simple_case.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author:
- name "Drew Holzworth"
date: "`r Sys.Date()`"
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteIndexEntry{Parameter estimation with ApsimX}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
params:
Expand Down

0 comments on commit b29ca0e

Please sign in to comment.