Closed bochocki closed 7 years ago
removedtable_select()
. code was:
table_select <- function(x, full_tbl = FALSE, possible_args){
if(full_tbl == FALSE) return(x[,possible_args])
if(full_tbl == TRUE) return(x)
}
changed to:
subset_data <- if(full_tbl){subset_data} else {subset_data[,possible_args()]}
and instead of defining a function, I just use this in a single location in browse()
I also started an "UNUSED FUNCTIONS" section at the bottom of browse.R
to track functions that we're removing from the main code without deleting them.
Changed the function
# changes clss to class and ordr to order
class_order_names <- function(x){
names(x) <- gsub("clss","class",names(x))
names(x) <- gsub("ordr","order",names(x))
return(x)
}
to the more generic
# changes a column name from one name to another
colname_change = function(from, to, x){
names(x) <- gsub(from,to,names(x))
return(x)
}
and updated the appropriate lines in main_table()
. moved class_order_names()
to "UNUSED FUNCTIONS".
I removed the "Unused Functions" in browse.R
I removed tallies
and multiple_columns
, which are used in summary_popler
instead.
Closing this issue, as I believe it requires no peer-review.
There are some functions, in
browse()
at least, that perform relatively simple tasks and are only used once. We should minimize the use of functions like this to improve code readability and to minimize errors.