---
title: "Exploring Multiple Datasets"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Exploring Multiple Datasets}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
# Working with Multiple Datasets in dataviewR
`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.
---
## 1. Launching dataviewR with multiple datasets
You can pass any number of datasets to `dataviewer()`:
```r
library(dataviewR)
dataviewer(iris, mtcars)
```
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:
```r
dataviewer(iris, mtcars, ToothGrowth, airquality)
```
## 2. Navigating between dataset tabs
Inside the Viewer pane:
- Each dataset is presented under its own labeled tab
- Switching between tabs does not reset filters or selections
- Each dataset behaves independently (filtering, column selection, metadata)
This makes it easy to compare side-by-side:
- variable names
- attributes (labels and classes)
- missing data patterns
- derived vs raw values
## 3. Applying filters and selections independently
Each dataset tab maintains:
- its own filter expression
- its own column selection
- its own generated code
- its own metadata panel
This allows you to:
- filter iris on species
- filter mtcars on horsepower
- compare the results
Example:
Tab: iris
```ini
Species == "setosa"
```