mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 12:37:30 +02:00
polished import
This commit is contained in:
parent
91a3f19952
commit
a655dd3b87
3 changed files with 104 additions and 48 deletions
14
R/helpers.R
14
R/helpers.R
|
|
@ -652,3 +652,17 @@ is_identical_to_previous <- function(data, no.name = TRUE) {
|
|||
}
|
||||
}, FUN.VALUE = logical(1))
|
||||
}
|
||||
|
||||
|
||||
#' Simplified version of the snakecase packages to_snake_case
|
||||
#'
|
||||
#' @param data character string vector
|
||||
#'
|
||||
#' @returns vector
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' c("foo bar", "fooBar21", "!!Foo'B'a-r", "foo_bar", "F OO bar") |> simple_snake()
|
||||
simple_snake <- function(data){
|
||||
gsub("[\\s+]","_",gsub("[^\\w\\s:-]", "", tolower(data), perl=TRUE), perl=TRUE)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue