Skip to content

Commit

Permalink
Dot handling in lambda improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rj committed Apr 18, 2021
1 parent b44260e commit cdb15ba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions R/functional.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ lambda_to_func <- function(expr) {
}

if (vars_string == '')
vars_string <- str_extract(expr_str, '[a-zA-Z_]+')

if (is.na(vars_string))
vars_string <- '.'
vars_string <- str_extract(expr_str, '[a-zA-Z_.]+')

return (eval(parse(text=paste('(function(', vars_string, ') {', expr_str_splitted[length(expr_str_splitted)], '})'))))
}
Expand Down

0 comments on commit cdb15ba

Please sign in to comment.