Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WISH: Make package lightweight by dropping dependency on 'stringr' #42

Closed
HenrikBengtsson opened this issue Jun 19, 2022 · 1 comment
Closed

Comments

@HenrikBengtsson
Copy link

The 'stringr' package depends on 'stringi', which is quite heavy and takes a long time to install from source. Looking at the source code, 'beepr' uses:

  • stringr::str_detect()
  • stringr::str_replace_all()
  • stringr::str_trim()

These can easily be replaced by base::grepl() and base::gsub(), e.g.

str_detect <- function(string, pattern, ignore_case = TRUE) {
  grepl(pattern, string, ignore.case = ignore_case)
}

str_replace_all <- function (string, pattern, replacement) {
  gsub(pattern, replacement, string)
}

str_trim <- function(string) {
  gsub("(^[[:space:]]+|[[:space:]]+$)", "", string)
}

Doing so would make 'beepr' depend on only 'audio'.

@rasmusab
Copy link
Owner

Addressed by 526fd65

@rasmusab rasmusab mentioned this issue Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants