diff --git a/DESCRIPTION b/DESCRIPTION index 3cade0b..7e88625 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Type: Package -Package: covadj +Package: RobinCar2 Title: R Package Template Version: 0.1.0.9000 Date: 2023-06-20 @@ -7,19 +7,14 @@ Authors@R: person("openpharma", , , "openpharma@example.com", role = c("aut", "cre")) Description: R package template with GitHub Actions workflows included. License: Apache License 2.0 | file LICENSE -URL: https://github.com/openpharma/covadj/ -BugReports: https://github.com/openpharma/covadj/issues +URL: https://github.com/openpharma/RobinCar2/ +BugReports: https://github.com/openpharma/RobinCar2/issues Depends: R (>= 3.6) Imports: - plumber, - shiny, stringr Suggests: - future, - httr, knitr, - shinytest, testthat (>= 2.0) VignetteBuilder: knitr @@ -28,4 +23,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/NAMESPACE b/NAMESPACE index 62a3c9a..01843dc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,3 @@ # Generated by roxygen2: do not edit by hand export(hello) -export(plumber_api) -export(shiny_app) -importFrom(utils,packageName) diff --git a/NEWS.md b/NEWS.md index cdd3810..f770305 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# covadj 0.1.0.9000 +# RobinCar2 0.1.0.9000 ### New features diff --git a/R/hello.R b/R/hello.R index 58efee5..ae4284d 100644 --- a/R/hello.R +++ b/R/hello.R @@ -13,49 +13,3 @@ hello <- function(name = "your name") { name <- stringr::str_to_title(name) print(paste("Hello,", name)) } - -#' Personal greeting as a Shiny app -#' -#' @description Greet a person and appropriately capitalize their name -#' as a Shiny app. -#' -#' @return Shiny app showcasing the personal greeting feature. -#' @export -#' -shiny_app <- function() { - ui <- shiny::fluidPage( - shiny::textInput("name", "What is your name?"), - shiny::actionButton("greet", "Greet"), - shiny::textOutput("greeting") - ) - - server <- function(input, output, session) { - output$greeting <- shiny::renderText({ - shiny::req(input$greet) - hello(shiny::isolate(input$name)) - }) - } - - shiny::shinyApp(ui, server) -} - -#' Personal greeting as a Plumber API -#' -#' @importFrom utils packageName -#' -#' @description Greet a person and appropriately capitalize their name -#' as a Plumber API. -#' -#' @param ... Additional arguments to plumber::pr_run() -#' -#' @return Plumber API showcasing the personal greeting feature. -#' @export -#' -plumber_api <- function(...) { - plumber::pr_run( - plumber::plumb_api( - package = packageName(), name = "hello" - ), - ... - ) -} diff --git a/README.md b/README.md index 2e5c1d7..bcf6489 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# covadj +# RobinCar2 Short description of the package diff --git a/RobinCar2.Rproj b/RobinCar2.Rproj new file mode 100644 index 0000000..cba1b6b --- /dev/null +++ b/RobinCar2.Rproj @@ -0,0 +1,21 @@ +Version: 1.0 + +RestoreWorkspace: No +SaveWorkspace: No +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace diff --git a/_pkgdown.yml b/_pkgdown.yml index 621d2b8..5db6c59 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://openpharma.github.io/covadj +url: https://openpharma.github.io/RobinCar2 template: bootstrap: 5 @@ -17,4 +17,4 @@ template: navbar: right: - icon: fa-github - href: https://github.com/openpharma/covadj + href: https://github.com/openpharma/RobinCar2 diff --git a/inst/WORDLIST b/inst/WORDLIST index 03096e3..b1dfb39 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,12 +1,2 @@ -BiocCheck -CMD -Pkgdown -Pre -Roxygen -SuperLinter -github -gitleaks +RobinCar initializer -pre -repo -Forkers diff --git a/inst/plumber/hello/plumber.R b/inst/plumber/hello/plumber.R deleted file mode 100644 index c5fffb6..0000000 --- a/inst/plumber/hello/plumber.R +++ /dev/null @@ -1,4 +0,0 @@ -#* Personal greeting as a Plumber API -#* @param name Your name (character string; e.g. "john doe"). -#* @get /echo -covadj::hello diff --git a/man/plumber_api.Rd b/man/plumber_api.Rd deleted file mode 100644 index 84ef92b..0000000 --- a/man/plumber_api.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/hello.R -\name{plumber_api} -\alias{plumber_api} -\title{Personal greeting as a Plumber API} -\usage{ -plumber_api(...) -} -\arguments{ -\item{...}{Additional arguments to plumber::pr_run()} -} -\value{ -Plumber API showcasing the personal greeting feature. -} -\description{ -Greet a person and appropriately capitalize their name -as a Plumber API. -} diff --git a/man/shiny_app.Rd b/man/shiny_app.Rd deleted file mode 100644 index 8171c58..0000000 --- a/man/shiny_app.Rd +++ /dev/null @@ -1,15 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/hello.R -\name{shiny_app} -\alias{shiny_app} -\title{Personal greeting as a Shiny app} -\usage{ -shiny_app() -} -\value{ -Shiny app showcasing the personal greeting feature. -} -\description{ -Greet a person and appropriately capitalize their name -as a Shiny app. -} diff --git a/staged_dependencies.yaml b/staged_dependencies.yaml index 882b00c..9298e7c 100644 --- a/staged_dependencies.yaml +++ b/staged_dependencies.yaml @@ -1,7 +1,7 @@ --- # Information about this file: https://github.com/openpharma/staged.dependencies current_repo: - repo: openpharma/covadj + repo: openpharma/RobinCar2 host: https://github.com upstream_repos: downstream_repos: diff --git a/tests/testthat.R b/tests/testthat.R index 2b396ad..e850692 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,3 +1,3 @@ -pkg_name <- "covadj" +pkg_name <- "RobinCar2" library(pkg_name, character.only = TRUE) testthat::test_check(pkg_name) diff --git a/tests/testthat/shiny-app/app.R b/tests/testthat/shiny-app/app.R deleted file mode 100644 index fa6ba9b..0000000 --- a/tests/testthat/shiny-app/app.R +++ /dev/null @@ -1 +0,0 @@ -covadj::shiny_app() diff --git a/tests/testthat/test-api.R b/tests/testthat/test-api.R deleted file mode 100644 index 5cc47a2..0000000 --- a/tests/testthat/test-api.R +++ /dev/null @@ -1,30 +0,0 @@ -test_that("API greets the person", { - host <- "127.0.0.1" - port <- 9000 - - # Start the API - future::plan(future::multisession) - future::future( - covadj::plumber_api(host = host, port = port) - ) - Sys.sleep(3) - - # Make request - res <- httr::GET( - url = paste0( - "http://", - host, - ":", - port, - "/echo" - ), - query = "name=tim" - ) - - # Get response - result <- httr::content(res)[[1]] - - # Compare - expected <- "Hello, Tim" - expect_identical(result, expected) -}) diff --git a/tests/testthat/test-shiny.R b/tests/testthat/test-shiny.R deleted file mode 100644 index 6fed2d6..0000000 --- a/tests/testthat/test-shiny.R +++ /dev/null @@ -1,25 +0,0 @@ -test_that("The Shiny App returns a proper greeting", { - library(shinytest) - app <- ShinyDriver$new( - "shiny-app/", - loadTimeout = 1e5, - debug = "all", - phantomTimeout = 1e5, - seed = 123 - ) - app$getDebugLog() - - # Set input - app$setInputs(name = "john") - app$setInputs(greet = "click") - output <- app$getValue(name = "greeting") - - # test - expect_equal(output, "Hello, John") - - # wait for the process to close gracefully - # this allows covr to write out the coverage results - p <- app$.__enclos_env__$private$shinyProcess - p$interrupt() - p$wait() -}) diff --git a/vignettes/hello.Rmd b/vignettes/hello.Rmd index 2e5f79a..4b917c8 100644 --- a/vignettes/hello.Rmd +++ b/vignettes/hello.Rmd @@ -7,6 +7,6 @@ date: "`r Sys.Date()`" Hello World! ```{r} -library(covadj) -hello("covadj!") +library(RobinCar2) +hello("RobinCar2!") ```