Learn R Programming

dataviewR (version 0.1.0)

dataviewer: Interactive Data Viewer with Filter and Code Generation

Description

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

Value

Launches a Shiny application in the browser. Does not return a value.

Arguments

data

A data.frame or tibble. If NULL or missing, an import UI is shown to load data interactively.

Details

This function provides:

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

  • 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.

Examples

Run this code
if (interactive()) {
  dataviewer(mtcars)
  dataviewer() # Opens the import panel
}

Run the code above in your browser using DataLab