소스 검색

Gadget only shows regex functions from installed packages

Fixes #13
pull/21/head
Garrick Aden-Buie 6 년 전
부모
커밋
58aab0a945
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -0
      R/gadget.R
  2. +1
    -1
      R/gadget_ui.R

+ 6
- 0
R/gadget.R 파일 보기

) )
) )


available_regex_functions <- function() {
pkgs <- c("stringr", "rematch2")
has_pkg <- vapply(pkgs, requireNamespace, quietly = TRUE, logical(1))
regexFn_choices[c("base", pkgs[has_pkg])]
}

regexFn_substitute <- c( regexFn_substitute <- c(
paste0(c("", "g"), "sub"), paste0(c("", "g"), "sub"),
paste0("str_replace", c("", "_all")) paste0("str_replace", c("", "_all"))

+ 1
- 1
R/gadget_ui.R 파일 보기

selectInput( selectInput(
"regexFn", "regexFn",
label = "Apply Function", label = "Apply Function",
choices = regexFn_choices
choices = available_regex_functions()
), ),
tags$span( tags$span(
class = "help-block", class = "help-block",

Loading…
취소
저장