Type: | Package |
Title: | Makes 'R' Easier for Everyone |
Version: | 1.2.5 |
Author: | David J. Bosak |
Maintainer: | David Bosak <dbosak01@gmail.com> |
Description: | A meta-package that aims to make 'R' easier for everyone, especially programmers who have a background in 'SAS®' software. This set of packages brings many useful concepts to 'R', including data libraries, data dictionaries, formats and format catalogs, a data step, and a traceable log. The 'flagship' package is a reporting package that can output in text, rich text, 'PDF', 'HTML', and 'DOCX' file formats. |
License: | CC0 |
Encoding: | UTF-8 |
Depends: | R (≥ 3.6.0) |
URL: | https://r-sassy.org, https://github.com/dbosak01/sassy |
BugReports: | https://github.com/dbosak01/sassy/issues |
Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown, tidylog, magrittr, covr |
Imports: | fmtr(≥ 1.6.4), common(≥ 1.1.3), logr(≥ 1.3.8), libr(≥ 1.3.3), reporter(≥ 1.4.4), procs(≥ 1.0.6), datasets, tools, utils |
RoxygenNote: | 7.3.1 |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2024-05-29 00:27:49 UTC; dbosa |
Repository: | CRAN |
Date/Publication: | 2024-05-30 07:20:02 UTC |
sassy: Making R Easier for Everyone
Description
The sassy package is a meta-package that installs a set of functions that aim to make R easier for everyone, especially programmers whose primary experience is with SAS® software. These functions provide the ability to create data libraries, format catalogs, data dictionaries, a traceable log, and includes reporting capabilities reminiscent of those found in SAS®. These packages were written independently, and the authors have no association with, approval of, or endorsement by SAS® Institute.
Packages Included
The packages included in the sassy meta-package are as follows:
-
libr
: Define a libname, view data dictionaries, and simulate a data step. -
fmtr
: Create a format catalog and apply formats to a data frame or vector. -
logr
: Generate a traceable log. -
reporter
: Write reports and output in TXT, RTF, PDF, HTML, and DOCX. -
common
: A set of utility functions shared across the sassy family of packages. -
procs
: A package to simulate frequently used SAS® procedures.
See Also
Useful links:
Report bugs at https://github.com/dbosak01/sassy/issues
Examples
#########################################################
##### Example: Simple Data Listing #####
#########################################################
library(sassy)
library(magrittr)
options("logr.notes" = FALSE)
# Get path to temp directory
tmp <- tempdir()
# Get path to sample data
pkg <- system.file("extdata", package = "sassy")
# Open log
lgpth <- log_open(file.path(tmp, "example1.log"))
sep("Get Data")
# Define data library
libname(sdtm, pkg, "csv") %>% put()
sep("Write Report")
# Define table object
tbl <- create_table(sdtm$DM) %>%
define(USUBJID, id_var = TRUE)
# Construct report path
pth <- file.path(tmp, "output/l_dm.rtf") %>% put()
# Define report object
rpt <- create_report(pth, output_type = "RTF", font = "Courier") %>%
page_header("Sponsor: Company", "Study: ABC") %>%
titles("Listing 1.0", "SDTM Demographics") %>%
add_content(tbl, align = "left") %>%
page_footer(Sys.time(), "CONFIDENTIAL", "Page [pg] of [tpg]")
# Write report to file system
write_report(rpt) %>% put()
# Close log
log_close()
# View report
# file.show(pth)
# View log
# file.show(lgpth)
Generates an Installation Qualification Report
Description
The run_iq
function executes an
installation qualification (IQ)
on the currently installed sassy packages, and generates a report
on the results. The IQ ensures that all sassy packages
have been installed.
The results of the IQ will be placed in the supplied location.
Usage
run_iq(location)
Arguments
location |
The path to the desired output directory. The IQ reports and any associated files will be placed in this directory. |
Value
The path to the output directory. The directory will contain a PDF report showing a summary of the results of the IQ. After the function is run, review this report to ensure that all tests passed.
Examples
# Create a temp directory
tmp <- tempdir()
# Run the Installation Qualification
run_iq(tmp)
Generates an Operational Qualification Report
Description
The run_oq
function executes an
operational qualification (OQ)
on the currently installed sassy packages and generates a report
on the results. The OQ ensures that the sassy packages are
installed and working
as expected. The results will be placed in the supplied location.
Usage
run_oq(location)
Arguments
location |
The path to the desired output directory. The IQ reports and any other associated files will be placed in this directory. Location should be specified as a directory only. The file names will be generated by the function. |
Details
The Operation Qualification works by executing a representative set of functions from each sassy package, and comparing the results against expected values. Here is a brief description of the operations performed on each package:
logr: A sample log is produced and checked for existence. This test confirms the following functions:
log_open
,log_print
, andlog_close
.fmtr: The basic operations of the package are executed and compared against expected output:
fapply
,fdata
,value
,condition
,write.fcat
, andread.fcat
.libr: The procedure verifies that the fundamental operations of the package are working properly without errors:
libname
,lib_add
,lib_remove
,dictionary
, anddatastep
.reporter: The reporter package is tested by producing sample reports in each of the available output types: TXT, HTML, RTF, PDF, and DOCX. This method tests almost all of the sub-functions of the package.
common: The following representative functions are run and tested for errors and valid return values:
v
,sort
,labels
,roundup
,Sys.path
,find.names
, andcopy.attributes
.procs: All the major functions of the package are executed and tested against expected results:
proc_freq
,proc_means
,proc_transpose
,proc_sort
, andproc_print
.
Value
The path to the output directory. This directory will contain subdirectories with the output reports, logs, and other files produced by the Operation Qualification. At the top level, the directory will contain a PDF report showing a summary of the results of the OQ. After the function is run, review this report to ensure that all tests passed.
Examples
# Create a temp directory
tmp <- tempdir()
# Uncomment to Run the Operational Qualification
# run_oq(tmp)