Skip to content

Commit

Permalink
Merge pull request #151 from pharmaverse/website_fixes
Browse files Browse the repository at this point in the history
Inserted CRAN badge.  Moved attribute discussion.  Couple of Typo and…
  • Loading branch information
bms63 committed Jan 17, 2023
2 parents ebb1744 + aab2643 commit 5df90fc
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 60 deletions.
14 changes: 8 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ knitr::opts_chunk$set(

<!-- badges: start -->
[![R build status](https://github.com/pharmaverse/logrx/workflows/R-CMD-check/badge.svg)](https://github.com/pharmaverse/logrx/actions?workflow=R-CMD-check)
[![CRAN status](https://www.r-pkg.org/badges/version/logrx)](https://CRAN.R-project.org/package=logrx)
[<img src="https://img.shields.io/codecov/c/github/pharmaverse/logrx">](https://app.codecov.io/gh/pharmaverse/logrx)
[<img src="https://img.shields.io/badge/License-MIT-blue.svg">](https://github.com/pharmaverse/logrx/blob/master/LICENSE.md)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental-1)
<!-- badges: end -->

The goal of logrx is to facilitate logging in a clinical environment with the goal of making code easily traceable and reproducible.
The goal of `{logrx}` is to facilitate logging in a clinical environment with the goal of making code easily traceable and reproducible.

## Installation

Expand All @@ -38,10 +39,10 @@ To get the latest development version use:
devtools::install_github("pharmaverse/logrx", ref = "dev")
```

## What is ```logrx``` ?
## What is ```{logrx}``` ?

Simple! The logrx package makes a log file for a R script!. Below we have a short gif of
making a log file for a `adsl.R` script. More details on the parts of the log script
Simple! The `{logrx}` package makes a log file for a R script!. Below we have a short gif of
making a log file for a `adsl.R` script using the Addin. More details on the parts of the log script
are found in [Get Started](https://pharmaverse.github.io/logrx/articles/logrx.html) and we have several vignettes that show specific use cases for using the package.

```{r img-with-knitr, echo=FALSE, fig.align='center', out.width='100%', fig.cap='logrx Addin in Action'}
Expand All @@ -50,7 +51,8 @@ knitr::include_graphics("https://pharmaverse.s3.us-east-2.amazonaws.com/gifs/log

While many packages to facilitate the logging of code already exist in the R ecosystem, it is hard to find a solution that works well for clinical programming applications. Many logging implementations are more implicit and rely on user input to create the log for the execution of a script. While this is useful for logging specific events of an application, in clinical programming a log has a set purpose.

```logrx``` is built around the concept of creating a log for the execution of an R script that provides an overview of what happened as well as the environment that it happened in. We set out to create a flexible logging utility that could provide the necessary information to anyone reviewing the code execution so they can recreate the execution environment and run the code for themselves. ```logrx``` is purpose-built for the needs of clinical programming to capture necessary elements of the environment and execution to be able to create a complete view of the program execution.
```{logrx}``` is built around the concept of creating a log for the execution of an R script that provides an overview of what happened as well as the environment that it happened in. We set out to create a flexible logging utility that could provide the necessary information to anyone reviewing the code execution so they can recreate the execution environment and run the code for themselves. ```{logrx}``` is purpose-built for the needs of clinical programming to capture necessary elements of the environment and execution to be able to create a complete view of the program execution.

## Using logrx
```logrx``` can be used in a file or through scripting. More information on how to use ```logrx``` can be found in [Get Started](https://pharmaverse.github.io/logrx/articles/logrx.html).

```logrx``` can be used in a file or through scripting. More information on how to use ```{logrx}``` can be found in [Get Started](https://pharmaverse.github.io/logrx/articles/logrx.html) and in our Articles on Execution and Use Cases.
Empty file added README.html
Empty file.
44 changes: 20 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

[![R build
status](https://github.com/pharmaverse/logrx/workflows/R-CMD-check/badge.svg)](https://github.com/pharmaverse/logrx/actions?workflow=R-CMD-check)
[![CRAN
status](https://www.r-pkg.org/badges/version/logrx)](https://CRAN.R-project.org/package=logrx)
[<img src="https://img.shields.io/codecov/c/github/pharmaverse/logrx">](https://app.codecov.io/gh/pharmaverse/logrx)
[<img src="https://img.shields.io/badge/License-MIT-blue.svg">](https://github.com/pharmaverse/logrx/blob/master/LICENSE.md)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental-1)
<!-- badges: end -->

The goal of logrx is to facilitate logging in a clinical environment
The goal of `{logrx}` is to facilitate logging in a clinical environment
with the goal of making code easily traceable and reproducible.

## Installation
Expand All @@ -30,23 +32,16 @@ To get the latest development version use:
devtools::install_github("pharmaverse/logrx", ref = "dev")
```

## What is `logrx` ?
## What is `{logrx}` ?

Simple! The logrx package makes a log file for a R script!. Below we
have a short gif of making a log file for a `adsl.R` script. More
details on the parts of the log script are found in [Get
Simple! The `{logrx}` package makes a log file for a R script!. Below we
have a short gif of making a log file for a `adsl.R` script using the
Addin. More details on the parts of the log script are found in [Get
Started](https://pharmaverse.github.io/logrx/articles/logrx.html) and we
have several vignettes that show specific use cases for using the
package.

<div class="figure" style="text-align: center">

<img src="https://pharmaverse.s3.us-east-2.amazonaws.com/gifs/logrx.gif" alt="logrx Addin in Action" width="100%" />
<p class="caption">
logrx Addin in Action
</p>

</div>
<img src="https://pharmaverse.s3.us-east-2.amazonaws.com/gifs/logrx.gif" alt="logrx Addin in Action" width="100%" style="display: block; margin: auto;" />

While many packages to facilitate the logging of code already exist in
the R ecosystem, it is hard to find a solution that works well for
Expand All @@ -55,18 +50,19 @@ implicit and rely on user input to create the log for the execution of a
script. While this is useful for logging specific events of an
application, in clinical programming a log has a set purpose.

`logrx` is built around the concept of creating a log for the execution
of an R script that provides an overview of what happened as well as the
environment that it happened in. We set out to create a flexible logging
utility that could provide the necessary information to anyone reviewing
the code execution so they can recreate the execution environment and
run the code for themselves. `logrx` is purpose-built for the needs of
clinical programming to capture necessary elements of the environment
and execution to be able to create a complete view of the program
execution.
`{logrx}` is built around the concept of creating a log for the
execution of an R script that provides an overview of what happened as
well as the environment that it happened in. We set out to create a
flexible logging utility that could provide the necessary information to
anyone reviewing the code execution so they can recreate the execution
environment and run the code for themselves. `{logrx}` is purpose-built
for the needs of clinical programming to capture necessary elements of
the environment and execution to be able to create a complete view of
the program execution.

## Using logrx

`logrx` can be used in a file or through scripting. More information on
how to use `logrx` can be found in [Get
Started](https://pharmaverse.github.io/logrx/articles/logrx.html).
how to use `{logrx}` can be found in [Get
Started](https://pharmaverse.github.io/logrx/articles/logrx.html) and in
our Articles on Execution and Use Cases.
62 changes: 32 additions & 30 deletions vignettes/logrx.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,56 @@ knitr::opts_chunk$set(
library(logrx)
```

The purpose of the `logrx` package is to generate a log upon execution of
an R script which enables traceability and reproducibility of the executed code.
# Generating a log

The purpose of the `logrx` package is to generate a log upon execution of an R script which enables traceability and reproducibility of the executed code. Generating a log with `{logrx}` can be as simple as running one line of code as seen in the below example of how to use the `axecute()` function.. However, `{logrx}` has much more advanced capabilities to meet the demands of Clinical Reporting. To learn additional techniques about executing code with ```{logrx}``` please visit our [Execution Vignette](https://pharmaverse.github.io/logrx/articles/execution.html).

## `axecute()`

`axecute()` enables the command line submission of a program. A log is set-up around the program, and its code is run safely and loudly (using `safely()` from the `purrr` package). The log will be generated in the same folder as the script unless you specify differently.

```{r axecute, eval = FALSE}
axecute("my_script.R")
```


## `logrx` addin:

A log can be generated using the ```{logrx}``` addin, which is a simple point and click interface that allows you to run a single program. The Addin ships with the package and is available once you use install the package. The gif on the [Get Started](https://pharmaverse.github.io/logrx/index.html) page gives a quick snapshot of its intended use.

# Log attributes

We have compiled a brief overview of the information that we capture in the log file generated by `{logrx}`. We also users to customize sections of the log based on their needs for a log, e.g. you can toggle on/off the messages, outputs, errors and messages. You can also build into your log approved and unapproved packages used in your R script - see [Logging Unapproved Package and Function Use]( https://pharmaverse.github.io/logrx/articles/approved.html) for additional guidance

The following attributes are recorded in the log:

* `metadata`: `logrx` package information
* **Metadata**: `{logrx}` package information
+ Version of the package
+ Type of build
+ Link to the GitHub repository
* `user and file information`
* **User and File Information**
+ User that generated the log
+ Name and path of the script for which the log was generated
+ `hash_sum`: A unique hashsum is created for the log file
* `session_info`: The R session information
* **Session Information**: The R session information
+ R version
+ OS and system
+ GUI
+ Language and timezone
* `packages`: List of all available packages in the environment
* `external_software`: List of all external software
* `masked_functions`: List of all functions masked by packages
* `start_time`, `end_time`, and `run_time`: Start, end, and run times
* `used_packages_functions`: List of all packages and functions used in the
+ Packages - List of all available packages in the environment
+ External Software - List of all external software
* **Masked Functions** - List of all functions masked by packages
* **Program Run Time Information** - Start, end, and run times
* **Used Package and Functions (optional)** - List of all packages and functions used in the
script for which the log was generated
* `unapproved_packages_functions`: List of all packages and functions used in
* **Unapproved Package and Functions (optional)** - List of all packages and functions used in
the script for which the log was generated that are not part of the approved
list of packages and functions
* `errors`: Errors generated when running the script
* `messages`: Messages generated when running the script
* `warnings`: Warnings generated when running the script
* `result`: Result generated when running the script
* `output`: Output generated when running the script
* `log_name`, `log_path`: Name and path of the log
* **Errors and Warnings** - List of Errors and Warnings from the Script
* **Messages, Output and Results (optional)** - List Messages, Outputs and Results
* **Log Output File** - Name and path of the log

Below we have a scrollabe example of what is included in a log file for an `adsl.R` script.


<style>
Expand All @@ -67,16 +82,3 @@ list of packages and functions
<img src='`r here::here("man/figures/log.png")`'/>
</div>

# Generating a log
The log can be generated in a number of ways, below is an example of how to use the `axecute()` function to generate a log. This method is the easiest and most accessible way of creating a log. To learn more about executing code with ```logrx``` please visit our [Execution Vignette](https://pharmaverse.github.io/logrx/articles/execution.html).
## `axecute()`
`axecute()` enables the command line submission of a program. A log is
set-up around the program, and its code is run safely and loudly (using
`safely()` from the `purrr` package).
```{r axecute, eval = FALSE}
axecute("my_script.R")
```


## `logrx` addin:
A log can be generated using the ```logrx``` addin. More information can be found in [logrx](https://pharmaverse.github.io/logrx/index.html).

0 comments on commit 5df90fc

Please sign in to comment.