-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from KWB-R/clean
Clean again
- Loading branch information
Showing
53 changed files
with
812 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
# filter_scripts --------------------------------------------------------------- | ||
filter_scripts <- function(scriptInfo, fun.min = 5, epf.min = 10) | ||
{ | ||
keep_row <- matches_criteria( | ||
keep <- matches_criteria( | ||
Data = scriptInfo, | ||
criteria = c( | ||
paste("fun >=", fun.min), | ||
paste("epf >=", epf.min) | ||
) | ||
) | ||
|
||
remove_empty_columns(scriptInfo[keep_row, ]) | ||
scriptInfo[keep, ] %>% | ||
remove_empty_columns() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
#' Show String Constants Used in R Scripts | ||
#' | ||
#' @param root path from which to look recursively for R scripts | ||
#' @param root path from which to look recursively for R scripts. Default: "./R" | ||
#' @export | ||
find_string_constants <- function(root = "./R") | ||
{ | ||
get_string_constants_in_scripts( | ||
root = root, | ||
FUN = fetch_string_constants_2 | ||
) %>% | ||
root %>% | ||
get_string_constants_in_scripts(FUN = fetch_string_constants_2) %>% | ||
kwb.file::add_file_info() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# deparsed_logical_values ------------------------------------------------------ | ||
deparsed_logical_values <- function( | ||
type = c("short", "long", "either")[3L], | ||
logicals = c(FALSE, TRUE) | ||
) | ||
{ | ||
values <- c("F", "T", "FALSE", "TRUE") | ||
use_false_true <- c(FALSE %in% logicals, TRUE %in% logicals) | ||
|
||
if (type == "short") { | ||
values[1:2][use_false_true] | ||
} else if (type == "long") { | ||
values[3:4][use_false_true] | ||
} else if (type == "either") { | ||
values[rep(use_false_true, 2L)] | ||
} else { | ||
stop("Unknown type: ", type) | ||
} | ||
} |
Oops, something went wrong.