From d44092563ca32e1984eec38cc890f31d12dbc783 Mon Sep 17 00:00:00 2001 From: fawda123 Date: Thu, 4 Jan 2018 11:52:16 -0800 Subject: [PATCH] fixed bug in olden if output variables have special characters --- DESCRIPTION | 2 +- R/NeuralNetTools_old.R | 2 +- man/bias_lines.Rd | 1 - man/bias_points.Rd | 1 - man/garson.Rd | 5 ++--- man/get_ys.Rd | 1 - man/layer_lines.Rd | 1 - man/layer_points.Rd | 1 - man/lekgrps.Rd | 1 - man/lekprofile.Rd | 5 ++--- man/neuraldat.Rd | 1 - man/neuralskips.Rd | 1 - man/neuralweights.Rd | 5 ++--- man/olden.Rd | 5 ++--- man/plotnet.Rd | 5 ++--- man/pred_sens.Rd | 1 - 16 files changed, 12 insertions(+), 26 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9bf607d..210cf66 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,4 +27,4 @@ Depends: Authors@R: person(given = "Marcus W.", family = "Beck", role = c("aut","cre"), email = "mbafs2012@gmail.com") -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 diff --git a/R/NeuralNetTools_old.R b/R/NeuralNetTools_old.R index fbeb1ce..e4f1214 100644 --- a/R/NeuralNetTools_old.R +++ b/R/NeuralNetTools_old.R @@ -118,7 +118,7 @@ olden.default <- function(mod_in, x_names, y_names, out_var = NULL, bar_plot = T # stop if out_var is not a named variable if(!out_var %in% y_names) stop(paste('out_var must match one:', paste(y_names, collapse = ', '))) - else out_ind <- grep(out_var, y_names) + else out_ind <- grep(out_var, y_names, fixed = TRUE) #change variables names to user sub if(!is.null(x_lab)){ diff --git a/man/bias_lines.Rd b/man/bias_lines.Rd index 0ba02ed..8c89690 100644 --- a/man/bias_lines.Rd +++ b/man/bias_lines.Rd @@ -41,4 +41,3 @@ bias_lines(bias_x, bias_y, mod_in, nid, rel_rsc, all_out, pos_col, neg_col, \description{ Plot connection weights for bias lines in \code{\link{plotnet}} } - diff --git a/man/bias_points.Rd b/man/bias_points.Rd index fb6630f..5593161 100644 --- a/man/bias_points.Rd +++ b/man/bias_points.Rd @@ -31,4 +31,3 @@ bias_points(bias_x, bias_y, layer_name, node_labs, x_range, y_range, circle_cex, \description{ Plot bias points in \code{\link{plotnet}} } - diff --git a/man/garson.Rd b/man/garson.Rd index f012ae5..1090b26 100644 --- a/man/garson.Rd +++ b/man/garson.Rd @@ -3,10 +3,10 @@ \name{garson} \alias{garson} \alias{garson.default} +\alias{garson.numeric} +\alias{garson.nnet} \alias{garson.mlp} \alias{garson.nn} -\alias{garson.nnet} -\alias{garson.numeric} \alias{garson.train} \title{Variable importance using Garson's algorithm} \usage{ @@ -128,4 +128,3 @@ Olden, J.D., Joy, M.K., Death, R.G. 2004. An accurate comparison of methods for \seealso{ \code{\link{olden}} for a more flexible approach for variable importance } - diff --git a/man/get_ys.Rd b/man/get_ys.Rd index e98170e..18ea480 100644 --- a/man/get_ys.Rd +++ b/man/get_ys.Rd @@ -18,4 +18,3 @@ get_ys(lyr, max_sp, struct, y_range) \description{ Get y locations for input, hidden, output layers in \code{\link{plotnet}} } - diff --git a/man/layer_lines.Rd b/man/layer_lines.Rd index c6a0b39..ef8b3a8 100644 --- a/man/layer_lines.Rd +++ b/man/layer_lines.Rd @@ -52,4 +52,3 @@ layer_lines(mod_in, h_layer, layer1 = 1, layer2 = 2, out_layer = FALSE, \description{ Plot connection weights in \code{\link{plotnet}} } - diff --git a/man/layer_points.Rd b/man/layer_points.Rd index 0ace17b..757b389 100644 --- a/man/layer_points.Rd +++ b/man/layer_points.Rd @@ -39,4 +39,3 @@ layer_points(layer, x_loc, x_range, layer_name, cex_val, circle_cex, bord_col, \description{ Plot neural network nodes in \code{\link{plotnet}} } - diff --git a/man/lekgrps.Rd b/man/lekgrps.Rd index ad750b6..1793ce0 100644 --- a/man/lekgrps.Rd +++ b/man/lekgrps.Rd @@ -26,4 +26,3 @@ grps <- kmeans(x, 6)$center lekgrps(grps) } - diff --git a/man/lekprofile.Rd b/man/lekprofile.Rd index 60bade5..d2d0647 100644 --- a/man/lekprofile.Rd +++ b/man/lekprofile.Rd @@ -3,10 +3,10 @@ \name{lekprofile} \alias{lekprofile} \alias{lekprofile.default} -\alias{lekprofile.mlp} -\alias{lekprofile.nn} \alias{lekprofile.nnet} +\alias{lekprofile.mlp} \alias{lekprofile.train} +\alias{lekprofile.nn} \title{Sensitivity analysis using Lek's profile method} \usage{ lekprofile(mod_in, ...) @@ -135,4 +135,3 @@ Gevrey, M., Dimopoulos, I., Lek, S. 2003. Review and comparison of methods to st Olden, J.D., Joy, M.K., Death, R.G. 2004. An accurate comparison of methods for quantifying variable importance in artificial neural networks using simulated data. Ecological Modelling. 178:389-397. } - diff --git a/man/neuraldat.Rd b/man/neuraldat.Rd index 19626bb..b8a51d2 100644 --- a/man/neuraldat.Rd +++ b/man/neuraldat.Rd @@ -20,4 +20,3 @@ neuraldat A simulated dataset of 2000 observations containing two response variables and three explanatory variables. Explanatory variables were sampled from a standard normal distribution. Response variables were linear combinations of the explanatory variables. The response variables Y1 and Y2 are standardized from 0 to 1. } \keyword{datasets} - diff --git a/man/neuralskips.Rd b/man/neuralskips.Rd index 86ea722..9187707 100644 --- a/man/neuralskips.Rd +++ b/man/neuralskips.Rd @@ -40,4 +40,3 @@ mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5, linout = TRUE, neuralskips(mod) } - diff --git a/man/neuralweights.Rd b/man/neuralweights.Rd index 58dfafc..a5f546c 100644 --- a/man/neuralweights.Rd +++ b/man/neuralweights.Rd @@ -2,10 +2,10 @@ % Please edit documentation in R/NeuralNetTools_utils.R \name{neuralweights} \alias{neuralweights} +\alias{neuralweights.numeric} +\alias{neuralweights.nnet} \alias{neuralweights.mlp} \alias{neuralweights.nn} -\alias{neuralweights.nnet} -\alias{neuralweights.numeric} \title{Get weights for a neural network} \usage{ neuralweights(mod_in, ...) @@ -87,4 +87,3 @@ mod <- neuralnet(Y1 ~ X1 + X2 + X3, data = neuraldat, hidden = 5) neuralweights(mod) } } - diff --git a/man/olden.Rd b/man/olden.Rd index 22d3f39..bc1ebe9 100644 --- a/man/olden.Rd +++ b/man/olden.Rd @@ -3,10 +3,10 @@ \name{olden} \alias{olden} \alias{olden.default} +\alias{olden.numeric} +\alias{olden.nnet} \alias{olden.mlp} \alias{olden.nn} -\alias{olden.nnet} -\alias{olden.numeric} \alias{olden.train} \title{Variable importance using connection weights} \usage{ @@ -134,4 +134,3 @@ Olden, J.D., Jackson, D.A. 2002. Illuminating the 'black-box': a randomization a Olden, J.D., Joy, M.K., Death, R.G. 2004. An accurate comparison of methods for quantifying variable importance in artificial neural networks using simulated data. Ecological Modelling. 178:389-397. } - diff --git a/man/plotnet.Rd b/man/plotnet.Rd index 03fda2f..89b7087 100644 --- a/man/plotnet.Rd +++ b/man/plotnet.Rd @@ -3,10 +3,10 @@ \name{plotnet} \alias{plotnet} \alias{plotnet.default} -\alias{plotnet.mlp} -\alias{plotnet.nn} \alias{plotnet.nnet} \alias{plotnet.numeric} +\alias{plotnet.mlp} +\alias{plotnet.nn} \alias{plotnet.train} \title{Plot a neural network model} \usage{ @@ -202,4 +202,3 @@ plotnet(mod, circle_col = list(cols, 'lightblue')) \references{ Ozesmi, S.L., Ozesmi, U. 1999. An artificial neural network approach to spatial habitat modeling with interspecific interaction. Ecological Modelling. 116:15-31. } - diff --git a/man/pred_sens.Rd b/man/pred_sens.Rd index 1d60d27..3be590d 100644 --- a/man/pred_sens.Rd +++ b/man/pred_sens.Rd @@ -47,4 +47,3 @@ pred_sens(mat_in, mod, 'X1', 100, grps, 'Y1') \seealso{ lekprofile } -