Skip to content

Commit

Permalink
removing dead wood
Browse files Browse the repository at this point in the history
  • Loading branch information
edwindj committed Feb 10, 2020
1 parent 113432f commit 4de728f
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 162 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Suggests:
testthat (>= 2.1.0),
magrittr,
covr
RoxygenNote: 6.1.1
RoxygenNote: 7.0.2
Encoding: UTF-8
Collate:
'MipRules.R'
Expand All @@ -30,7 +30,6 @@ Collate:
'errorlocate-package.r'
'errorlocation.R'
'expr_manip.R'
'expr_simplify.R'
'linear.R'
'locate-errors.R'
'mip_lpsolve.R'
Expand Down
90 changes: 0 additions & 90 deletions R/expr_simplify.R

This file was deleted.

60 changes: 30 additions & 30 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ to_exprs <- function(x, ...){
)
}


get_variables_num <- function(x){
var_num <- sapply(to_miprules(x), function(mr){
names(mr$type)[mr$type == "double"]
})
unique(unlist(var_num))
}

get_variables_cat <- function(x){
var_cat <- sapply(to_miprules(x), function(mr){
nms <- names(mr$type)
nms[mr$type == "binary" & grepl(":", nms)]
})
var_cat <- unique(unlist(var_cat))
if (length(var_cat) == 0){
return(
data.frame( bin_variable = character(0)
, variable = character(0)
, value = character(0)
, stringsAsFactors = FALSE
)
)
}

data.frame( bin_variable = var_cat
, variable = sub(":.*$", "", var_cat)
, value = sub("^.*:", "", var_cat)
, stringsAsFactors = FALSE
)
}
#
# get_variables_num <- function(x){
# var_num <- sapply(to_miprules(x), function(mr){
# names(mr$type)[mr$type == "double"]
# })
# unique(unlist(var_num))
# }
#
# get_variables_cat <- function(x){
# var_cat <- sapply(to_miprules(x), function(mr){
# nms <- names(mr$type)
# nms[mr$type == "binary" & grepl(":", nms)]
# })
# var_cat <- unique(unlist(var_cat))
# if (length(var_cat) == 0){
# return(
# data.frame( bin_variable = character(0)
# , variable = character(0)
# , value = character(0)
# , stringsAsFactors = FALSE
# )
# )
# }
#
# data.frame( bin_variable = var_cat
# , variable = sub(":.*$", "", var_cat)
# , value = sub("^.*:", "", var_cat)
# , stringsAsFactors = FALSE
# )
# }
9 changes: 0 additions & 9 deletions R/values.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,3 @@ substitute_values <- function(x, values=list()){
}
vals[!is_logical]
}


#' substitute an existing language object
#'
#' @param x expression or language object!
#' @param values list of values
substitute_ <- function(x, values=list()){
eval(substitute(substitute(x, values), list(x=x)))
}
4 changes: 2 additions & 2 deletions man/errorlocate-package.Rd

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

2 changes: 1 addition & 1 deletion man/is_categorical.Rd

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

7 changes: 2 additions & 5 deletions man/locate_errors.Rd

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

10 changes: 3 additions & 7 deletions man/replace_errors.Rd

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

16 changes: 0 additions & 16 deletions man/substitute_.Rd

This file was deleted.

0 comments on commit 4de728f

Please sign in to comment.