Skip to content

Commit

Permalink
use perl regex for extra robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyphantom committed Mar 7, 2019
1 parent ae7efa6 commit f642d56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/verisr2.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ getenum_tbl <- function(data, params){

getenum_df_single <- function(data, params){
sel <- getenum_stri(data, params)
selnames <- gsub("^[a-z.]+", replacement="", sel)
selnames <- gsub("^[a-z0-9._ ]+\\.?(?=[A-Z])", replacement="", sel, perl=TRUE)

x <- data.frame("enum" = selnames, "x"=colSums(data[,sel]))
x <- cbind(x, "n"=nrow(data[rowSums(data[,sel[-length(sel)]]) > 0, ]))
Expand Down

0 comments on commit f642d56

Please sign in to comment.