dataviewR allows you to explore two or more
datasets in the same session, making it easy to compare
structures, values, and attributes across data sources.
This capability is especially useful when reviewing:
- raw vs
derived datasets
- ADaM vs SDTM datasets
- training vs test sets
- simulation outputs vs expected results
This article walks through how to launch and work with multiple datasets.
You can pass any number of datasets to dataviewer():
Each dataset will appear in its own tab inside the application in the RStudio Viewer pane or the default web browser.
You can pass more than two datasets as well:
Each dataset tab maintains:
This allows you to:
Example:
Tab: iris
Tab: mtcars
mpg > 20 & cyl == 4
Each dataset’s output, table, and code are kept separate.
Click Generate R Code within any dataset tab to get a reproducible pipeline for that dataset.
Example structure:
# Generated R Code
library(dplyr)
iris |>
filter(Species == "setosa") |>
select(Sepal.Length, Sepal.Width, Species)Switch tabs → generate code for the other dataset.
Load both raw and derived datasets:
The dm_raw, dm, and adsl datasets are loaded from the
pharmaverseraw, pharmaversesdtm, and
pharmaverseadam packages, respectively.
library(pharmaverseraw)
library(pharmaversesdtm)
library(pharmaverseadam)
dataviewer(dm_raw, dm)
dataviewer(dm, adsl)Then:
Navigate through tabs to review structure and metadata.
Inspect variable distributions and missingness.
In this article, you learned how to:
Viewing datasets side-by-side is one of the most powerful features of dataviewR, especially for data review and quality control workflows.
Continue with: Working with Clinical Datasets