Package 'dataviewR'

Title: An Interactive and Feature-Rich Data Viewer
Description: Provides an interactive viewer for 'data.frame', 'tibble' and 'data.table' objects using 'shiny' <https://shiny.posit.co/> and 'DT' <https://rstudio.github.io/DT/>. It supports complex filtering, column selection, and automatic generation of reproducible 'dplyr' <https://dplyr.tidyverse.org/> code for data manipulation. The package is designed for ease of use in data exploration and reporting workflows.
Authors: Madhan Kumar N [aut, cre], Siddhesh Pujari [aut], Gomathi S [aut], Mackenzie Haight [aut]
Maintainer: Madhan Kumar N <[email protected]>
License: MIT + file LICENSE
Version: 1.1.0
Built: 2026-05-08 08:34:44 UTC
Source: https://github.com/madhankumarnagaraji/dataviewr

Help Index


Interactive Data Viewer with Filter and Code Generation

Description

Launches a Shiny application to explore and filter a data.frame or tibble or data.table. If no data is provided, it opens an import panel to load a dataset from either the global environment or the packages.

Usage

dataviewer(..., background = NULL, port = NULL)

Arguments

...

One or more data.frame or tibble or data.table objects. If none provided, an import UI is shown to load data interactively.

background

Logical. If TRUE, runs the app in a background R process using callr. Requires the callr package. Default is TRUE when dataset(s) are provided, FALSE when no dataset(s) are provided.

port

Integer. Port number for the Shiny app. If NULL, a random available port is used. Default is NULL.

Details

This function provides:

  • A tab-based interface with data import and viewer options.

  • Support for multiple datasets in separate tabs.

  • A checkbox panel to select/deselect columns.

  • An input for dplyr-compatible filter expressions.

  • A dynamically generated dplyr code preview.

  • Metadata display for the variables.

The filtering uses dplyr::filter() and generates user-friendly code to replicate the steps. It also provides copyable R code that includes column selection and filtering logic.

Value

If background = TRUE, returns the process ID (character) invisibly. If background = FALSE, returns a Shiny application object.

See Also

For more information about the features of dataviewer, please refer to the documentation.

Examples

if (interactive()) {
    dataviewer(mtcars) # Opens in RStudio Viewer pane or default web browser
    dataviewer(iris, mtcars) # Opens multiple datasets in separate tabs
    dataviewer() # Opens the "Import Dataset" tab (foreground mode - console will be busy)

    # Run in foreground to enable the "Import Dataset" tab alongside 'mtcars'
    dataviewer(mtcars, background = FALSE)

    # Stop background process
    id <- dataviewer(mtcars, iris)
    stop_dataviewer(id)
}

List Active Background Dataviewer Processes

Description

List Active Background Dataviewer Processes

Usage

list_dataviewers()

See Also

For more information, please refer to the documentation.


Stop All Background Dataviewer Processes

Description

Stop All Background Dataviewer Processes

Usage

stop_all_dataviewers()

See Also

For more information, please refer to the documentation.


Stop a Specific or Most Recent Dataviewer Process

Description

Stop a Specific or Most Recent Dataviewer Process

Usage

stop_dataviewer(id = NULL)

Arguments

id

Character string specifying the process ID to stop. If NULL, stops the most recent background dataviewer.

See Also

For more information, please refer to the documentation.