diff --git a/DESCRIPTION b/DESCRIPTION index 885c74f87..5c9eac66a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,7 @@ BugReports: https://github.com/pharmaR/risk_assessment/issues Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.1.9000 +RoxygenNote: 7.2.2 Imports: bslib (>= 0.3.0), config (>= 0.3.1), diff --git a/README.Rmd b/README.Rmd index af5ab3e32..530e3e4b2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,77 +13,123 @@ knitr::opts_chunk$set( ) ``` -## Risk Assessment Shiny Application +# `{riskassessment}`: an extension of `{riskmetric}` [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -The Risk Assessment App is an interactive web application serving as a front end -application for the [`riskmetric`](https://github.com/pharmaR/riskmetric) R package. `riskmetric` is a framework to quantify risk by assessing a number of -metrics meant to evaluate development best practices, code documentation, -community engagement, and development sustainability. The app and `riskmetric` -aim to provide some context for validation within regulated industries. +`riskassessment` is a handy interface that augments the utility of the [`riskmetric`](https://github.com/pharmaR/riskmetric) package within an organizational setting. -Furthermore, the app extends the functionalities of `riskmetric` by allowing -the reviewer to +
-- analyze `riskmetric` output without the need to code in R, -- comment on the value of individual metrics, -- provide an overall assessment on the package (i.e., low, medium, or high risk) -based on the output of the evaluating metrics cohort, -- download a report with the package risk, metrics, and reviewer comments, and -- store assessments on the database for future viewing. +
+ +Risk Assessment app + +
-The app also provides user authentication. There are two roles on the app: -regular user and admin. The latter can add/delete users, -download an entire copy of the database, and modify the metric weights. +
-For further information about the app, please refer to the documentation. +
- - -### Our Approach to Validation +More over, `riskassessment` is an R package containing an interactive shiny application. It serves as a front end interface to the [`riskmetric`](https://github.com/pharmaR/riskmetric) R package. If you're unfamiliar, `riskmetric` is a framework to quantify an R package's "risk" by assessing a number of meaningful metrics designed to evaluate package development best practices, code documentation, community engagement, and development sustainability. Together, the `riskassessment` app and the `riskmetric` package aim to provide some context for validation within regulated industries. -Validation can serve as an umbrella for various terms, and admittedly, -companies will diverge on what is the correct approach to validation. The -validation approach we followed during the development of the app is -based on the philosophy of the white paper set forth by the -R Validation Hub: [White Paper](https://www.pharmar.org/white-paper/). +The app extends the functionality of `riskmetric` by allowing +the reviewer to: - - +- analyze `riskmetric` output without the need to write code in R +- contribute personalized comments on the value of individual metrics +- categorize a package with an overall assessment (i.e., low, medium, or high risk) based on subjective opinions or after tabulating user(s) consensus after the evaluating metric output +- download a static reports with the package risk, metrics outputs, and reviewer comments, and more +- store assessments in a database for future viewing and historical backup +- user authentication with with admin roles to manage users and metric weighting -### Documentation -We are currently working on improving the app and the documentation. Watch out for PR [#162](https://github.com/pharmaR/risk_assessment/pull/162)! -In the meantime, please refer to the documentation here. - - +### Echo-ing `{riskmetric}`'s Approach to Validation + +Validation can serve as an umbrella for various terms, and admittedly, companies will diverge on what is the correct approach to validation. The validation approach we followed is based on the philosophy of the white paper set forth by the R Validation Hub: [White Paper](https://www.pharmar.org/white-paper/). + + +### Usage + +If you are new to using the `riskassessment` app, welcome! We'd highly encourage you to start exploring the [`demo verson`](https://rinpharma.shinyapps.io/risk_assessment) of the app currently deployed on shinyapps.io. There, you'll find a number of pre-loaded packages just waiting to be assessed. Hands on experience will help you become familiar with the general layout of the app as you poke around and explore. + +With that said, you should immediately recognize that the app requires authentication, since it's intended use is within an organization. There are two pre-defined roles: 'nonadmin' users and 'admin' users. The latter can add/delete users, download an entire copy of the database, and modify the metric weights used in calculation of risk scores. Initially, both share the same password: `QWERTY1`. If you log in with this credential, the app will immediately prompt you to change your password and repeat the tje process with your new credentials. + +If you want a quick tour through the app (or need assistance getting past the authentication wall), you should watch this short walk through on the R Consortium's website: + +
+ +
+ +R Validation Hub update + +
-### Contributors/Authors -We would like to thank all the contributors! +
+ +If you desire a more comprehensive overview of `riskmetric`'s approach to validation in the context of this app, watch our talk at [Rstudio::Global 2021](https://www.youtube.com/watch?v=4uVQXHpNmUQ). But don't forget to take it for a spin! + +#### Installation + +For those who are ready to run/deploy this application in their own environment, we'd recommend the below workflow to install the package. Note: the `riskassessment` package is not on CRAN yet, but you can easily install the latest version from GitHub using: + +```{r, eval=FALSE} +# install.packages("remotes") # if needed +remotes::install_github("pharmaR/riskassessment") +``` + +With a simple `library(riskassessment)` you can access all the exported functions from `riskassessment` that help users reproduce analysis performed in the app. Or, you can create an `app.R` file and launch (or deploy) the application if you include the following line of code: + +```{r, eval=FALSE} +# Run the application +riskassessment::run_app() +``` -Specially, we would like to thank the following contributors/authors. + + +#### Deployments + +As you might expect, certain deployment environments offer persistent storage and others do not. For example, shinyapps.io does not. That means that even our [demo app](https://rinpharma.shinyapps.io/risk_assessment) that's hosted on shinyapps.io contains a a package database that can't be permanently altered. That's not advantageous since an organization needs to continually add new packages, publish comments, and make decisions about packages. Thus, we'd recommend exploring these deployment options (which allow persistent storage): + +* Shiny Server + +* RStudio Connect + +* ShinyProxy + +For more information on each of these, we highly recommend reading our deployments article. + + +### User Guides + +We are currently working on improving the app and it's documentation. Since they are are currently in-progress, please explore the user guides that have been developed so far, available on the [documentation site](https://pharmar.github.io/riskassessment/). + + +### Contributors/Authors + +We would like to thank all the contributors! Specifically, we would like to thank: - [R Validation Hub](https://www.pharmar.org) -- [Marly Gotti](https://www.marlygotti.com), Biogen, *Maintainer* - [Aaron Clark](https://www.linkedin.com/in/dataaaronclark/), Biogen, *Maintainer* -- Robert Krajcik, Cytel, *Maintainer* +- [Marly Gotti](https://www.marlygotti.com), Previously Biogen +- Robert Krajcik, Cytel +- Jeff Thompson, Cytel - Maya Gans, Cytel - Aravind Reddy Kallem - Fission Labs India Pvt Ltd -_Note:_ This app was made possible thanks to the [R Validation Hub](https://www.pharmar.org/about/), a collaboration to support the adoption -of R within a biopharmaceutical regulatory setting. +_Note:_ This app was made possible thanks to the [R Validation Hub](https://www.pharmar.org/about/), a collaboration to support the adoption of R within a biopharmaceutical regulatory setting. - - ### License -Please see the [License](LICENSE.md) file that lives alongside this repo. \ No newline at end of file +Please see the [License](LICENSE.md) file that lives alongside this repo. + + +
diff --git a/README.md b/README.md index 3236b5041..cf1b8ba31 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -## Risk Assessment Shiny Application +# `{riskassessment}`: an extension of `{riskmetric}` @@ -9,79 +9,165 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -The Risk Assessment App is an interactive web application serving as a -front end application for the -[`riskmetric`](https://github.com/pharmaR/riskmetric) R package. -`riskmetric` is a framework to quantify risk by assessing a number of -metrics meant to evaluate development best practices, code -documentation, community engagement, and development sustainability. The -app and `riskmetric` aim to provide some context for validation within -regulated industries. - -Furthermore, the app extends the functionalities of `riskmetric` by -allowing the reviewer to - -- analyze `riskmetric` output without the need to code in R, -- comment on the value of individual metrics, -- provide an overall assessment on the package (i.e., low, medium, or - high risk) based on the output of the evaluating metrics cohort, -- download a report with the package risk, metrics, and reviewer - comments, and -- store assessments on the database for future viewing. - -The app also provides user authentication. There are two roles on the -app: regular user and admin. The latter can add/delete users, download -an entire copy of the database, and modify the metric weights. - -For further information about the app, please refer to the -documentation. - - - - -### Our Approach to Validation +`riskassessment` is a handy interface that augments the utility of the +[`riskmetric`](https://github.com/pharmaR/riskmetric) package within an +organizational setting. + +
+ +
+ +Risk Assessment app + +
+ +
+ +
+ +More over, `riskassessment` is an R package containing an interactive +shiny application. It serves as a front end interface to the +[`riskmetric`](https://github.com/pharmaR/riskmetric) R package. If +you’re unfamiliar, `riskmetric` is a framework to quantify an R +package’s “risk” by assessing a number of meaningful metrics designed to +evaluate package development best practices, code documentation, +community engagement, and development sustainability. Together, the +`riskassessment` app and the `riskmetric` package aim to provide some +context for validation within regulated industries. + +The app extends the functionality of `riskmetric` by allowing the +reviewer to: + +- analyze `riskmetric` output without the need to write code in R +- contribute personalized comments on the value of individual metrics +- categorize a package with an overall assessment (i.e., low, medium, or + high risk) based on subjective opinions or after tabulating user(s) + consensus after the evaluating metric output +- download a static reports with the package risk, metrics outputs, and + reviewer comments, and more +- store assessments in a database for future viewing and historical + backup +- user authentication with with admin roles to manage users and metric + weighting + +### Echo-ing `{riskmetric}`’s Approach to Validation Validation can serve as an umbrella for various terms, and admittedly, companies will diverge on what is the correct approach to validation. -The validation approach we followed during the development of the app is -based on the philosophy of the white paper set forth by the R Validation -Hub: [White Paper](https://www.pharmar.org/white-paper/). - - - - -### Documentation - - -We are currently working on improving the app and the documentation. In the meantime, please refer to the documentation -here. - - - +The validation approach we followed is based on the philosophy of the +white paper set forth by the R Validation Hub: [White +Paper](https://www.pharmar.org/white-paper/). + +### Usage + +If you are new to using the `riskassessment` app, welcome! We’d highly +encourage you to start exploring the +[`demo verson`](https://rinpharma.shinyapps.io/risk_assessment) of the +app currently deployed on shinyapps.io. There, you’ll find a number of +pre-loaded packages just waiting to be assessed. Hands on experience +will help you become familiar with the general layout of the app as you +poke around and explore. + +With that said, you should immediately recognize that the app requires +authentication, since it’s intended use is within an organization. There +are two pre-defined roles: ‘nonadmin’ users and ‘admin’ users. The +latter can add/delete users, download an entire copy of the database, +and modify the metric weights used in calculation of risk scores. +Initially, both share the same password: `QWERTY1`. If you log in with +this credential, the app will immediately prompt you to change your +password and repeat the tje process with your new credentials. + +If you want a quick tour through the app (or need assistance getting +past the authentication wall), you should watch this short walk through +on the R Consortium’s website: + +
+ +
+ +R Validation Hub update + +
+ +
+ +If you desire a more comprehensive overview of `riskmetric`’s approach +to validation in the context of this app, watch our talk at +[Rstudio::Global 2021](https://www.youtube.com/watch?v=4uVQXHpNmUQ). But +don’t forget to take it for a spin! + +#### Installation + +For those who are ready to run/deploy this application in their own +environment, we’d recommend the below workflow to install the package. +Note: the `riskassessment` package is not on CRAN yet, but you can +easily install the latest version from GitHub using: + +``` r +# install.packages("remotes") # if needed +remotes::install_github("pharmaR/riskassessment") +``` + +With a simple `library(riskassessment)` you can access all the exported +functions from `riskassessment` that help users reproduce analysis +performed in the app. Or, you can create an `app.R` file and launch (or +deploy) the application if you include the following line of code: + +``` r +# Run the application +riskassessment::run_app() +``` + +#### Deployments + +As you might expect, certain deployment environments offer persistent +storage and others do not. For example, shinyapps.io does not. That +means that even our [demo +app](https://rinpharma.shinyapps.io/risk_assessment) that’s hosted on +shinyapps.io contains a a package database that can’t be permanently +altered. That’s not advantageous since an organization needs to +continually add new packages, publish comments, and make decisions about +packages. Thus, we’d recommend exploring these deployment options (which +allow persistent storage): + +- Shiny Server + +- RStudio Connect + +- ShinyProxy + +For more information on each of these, we highly recommend reading our +deployments article. + +### User Guides + +We are currently working on improving the app and it’s documentation. +Since they are are currently in-progress, please explore the user guides +that have been developed so far, available on the [documentation +site](https://pharmar.github.io/riskassessment/). ### Contributors/Authors -We would like to thank all the contributors! +We would like to thank all the contributors! Specifically, we would like +to thank: -Specially, we would like to thank the following contributors/authors. - -- [R Validation Hub](https://www.pharmar.org) -- [Marly Gotti](https://www.marlygotti.com), Biogen, *Maintainer* -- [Aaron Clark](https://www.linkedin.com/in/dataaaronclark/), Biogen, - *Maintainer* -- Robert Krajcik, Cytel, *Maintainer* -- Maya Gans, Cytel -- Aravind Reddy Kallem -- Fission Labs India Pvt Ltd +- [R Validation Hub](https://www.pharmar.org) +- [Aaron Clark](https://www.linkedin.com/in/dataaaronclark/), Biogen, + *Maintainer* +- [Marly Gotti](https://www.marlygotti.com), Previously Biogen +- Robert Krajcik, Cytel +- Jeff Thompson, Cytel +- Maya Gans, Cytel +- Aravind Reddy Kallem +- Fission Labs India Pvt Ltd *Note:* This app was made possible thanks to the [R Validation Hub](https://www.pharmar.org/about/), a collaboration to support the adoption of R within a biopharmaceutical regulatory setting. - - - ### License Please see the [License](LICENSE.md) file that lives alongside this repo. + +
diff --git a/man/figures/demo_riskassessment.png b/man/figures/demo_riskassessment.png new file mode 100644 index 000000000..a2b9ce95e Binary files /dev/null and b/man/figures/demo_riskassessment.png differ diff --git a/man/figures/r_con_update.png b/man/figures/r_con_update.png new file mode 100644 index 000000000..447a58fcf Binary files /dev/null and b/man/figures/r_con_update.png differ diff --git a/tests/testthat/test-golem-recommended.R b/tests/testthat/test-golem-recommended.R index b314130e6..1d8154995 100644 --- a/tests/testthat/test-golem-recommended.R +++ b/tests/testthat/test-golem-recommended.R @@ -50,20 +50,20 @@ test_that( } ) -# Configure this test to fit your need. -# testServer() function makes it possible to test code in server functions and modules, without needing to run the full Shiny application -testServer(app_server, { - - # Set and test an input - session$setInputs(x = 2) - expect_equal(input$x, 2) - - # Example of tests you can do on the server: - # - Checking reactiveValues - # expect_equal(r$lg, 'EN') - # - Checking output - # expect_equal(output$txt, "Text") -}) +# # Configure this test to fit your need. +# # testServer() function makes it possible to test code in server functions and modules, without needing to run the full Shiny application +# testServer(app_server, { +# +# # Set and test an input +# session$setInputs(x = 2) +# expect_equal(input$x, 2) +# +# # Example of tests you can do on the server: +# # - Checking reactiveValues +# # expect_equal(r$lg, 'EN') +# # - Checking output +# # expect_equal(output$txt, "Text") +# }) # Configure this test to fit your need test_that(