Learn R Programming

bidux

Overview

The {bidux} package helps Shiny developers create more effective dashboards using the Behavioral Insight Design (BID) Framework. If you’ve ever wondered why users struggle with your carefully crafted dashboards, or why your beautifully visualized data doesn’t drive the decisions you expected, this package is for you.

The core insight: Technical excellence ≠ User success. Even the most sophisticated analysis can fail if users can’t quickly understand and act on it.

The BID framework bridges this gap by integrating behavioral science, UX best practices, and data storytelling techniques into a systematic 5-stage process:

  1. Interpret the User’s Need - Like defining your research question and understanding your data
  2. Notice the Problem - Like identifying data quality issues or analytical bottlenecks
  3. Anticipate User Behavior - Like checking for statistical biases that could skew results
  4. Structure the Dashboard - Like choosing the right visualization or model architecture
  5. Validate & Empower the User - Like testing your model and ensuring stakeholders can act on results

Installation

You can install the released version of bidux from CRAN with:

install.packages("bidux")

And the development version from this repo with:

# install.packages("pak")
pak::pak("jrwinget/bidux")

Quick Start

Need immediate UX suggestions? Use bid_quick_suggest():

library(bidux)

# Get quick suggestions for a specific problem
suggestions <- bid_quick_suggest(
  problem = "Users are overwhelmed by too many filter options"
)

# View ranked suggestions with component recommendations
print(suggestions)

Full BID Workflow

For comprehensive dashboard redesigns, use the complete 5-stage process:

# Document a complete BID process
process <- bid_interpret(
  central_question = "How are our marketing campaigns performing across different channels?",
  data_story = new_data_story(
    hook = "Recent campaign performance varies significantly across channels",
    context = "We've invested in 6 different marketing channels over the past quarter",
    tension = "ROI metrics show inconsistent results, with some channels underperforming",
    resolution = "Identify top-performing channels and key performance drivers"
  )
) |>
  bid_notice(
    problem = "Users are overwhelmed by too many filter options and struggle to find relevant insights",
    evidence = "User testing shows 65% of first-time users fail to complete their intended task within 2 minutes"
  ) |>
  bid_anticipate(
    bias_mitigations = list(
      anchoring = "Include previous period performance as reference points",
      framing = "Provide toggle between ROI improvement vs. ROI gap views"
    )
  ) |>
  bid_structure() |>
  bid_validate(
    summary_panel = "Executive summary highlighting top and bottom performers, key trends, and recommended actions",
    next_steps = c(
      "Review performance of bottom 2 channels",
      "Increase budget for top-performing channel",
      "Schedule team meeting to discuss optimization strategy"
    )
  )

# View implementation suggestions for specific packages
bid_suggest_components(process, package = "bslib")

# Generate comprehensive reports
bid_report(process, format = "html")

Data-Driven UX with Telemetry

Enhanced telemetry workflows transform real user behavior data into actionable BID insights.

Telemetry Sources Supported:

  • {shiny.telemetry}: Appsilon’s package for Shiny app telemetry
  • Shiny OpenTelemetry (NEW!): Native OTEL support in {shiny} 1.12+ with rich performance data

Both sources work seamlessly with the same API:

# Works with {shiny.telemetry}
issues <- bid_telemetry("telemetry.sqlite")

# Works with Shiny OpenTelemetry (1.12+)
issues <- bid_telemetry("otel_spans.json")

# Same analysis workflow for both!
print(issues)  # Shows organized issue summary with severity levels

# Adjust sensitivity with presets
strict_issues <- bid_telemetry(
  "telemetry.sqlite",
  thresholds = bid_telemetry_presets("strict") # or "moderate", "relaxed"
)

# Focus on critical issues using tidy workflows
library(dplyr)

critical_issues <- issues |>
  filter(severity == "critical") |>
  arrange(desc(impact_rate))

# Convert high-priority issues to BID Notice stages
notices <- bid_notices(
  critical_issues,
  previous_stage = interpret_result
)

# Use telemetry flags to inform structure decisions
flags <- bid_flags(issues)

structure_result <- bid_structure(
  previous_stage = anticipate_result,
  telemetry_flags = flags  # influences layout selection
)

The bid_telemetry() function automatically identifies five key friction indicators:

  • Unused Inputs: UI controls rarely interacted with
  • Delayed Interactions: Long time-to-first-action patterns
  • Frequent Errors: Recurring error patterns that disrupt workflows
  • Navigation Drop-offs: Pages or tabs users rarely visit
  • Confusion Patterns: Rapid repeated changes indicating user uncertainty

OTEL Span Types Supported: - session_start/session_end (user sessions) - output:<id> (output rendering with timing) - reactive:<id>, observe:<id> (reactive/observer execution) - navigation (page/tab navigation) - Span events with errors (automatic error detection)

OpenTelemetry Integration (Shiny 1.12+):

For modern Shiny applications, use native OpenTelemetry for richer insights:

# In your Shiny app - enable OTEL collection
options(shiny.otel.collect = "all")

# After collecting data, analyze with bidux
issues <- bid_telemetry("otel_spans.json")

See vignette("otel-integration") for complete setup guide including: - Span-to-event conversion details (session_start→login, output:*→output, reactive:*→input, etc.) - Column schema and ID extraction logic - OTEL configuration and export formats - Performance metrics integration - Comparison with {shiny.telemetry} - Migration strategies

Function comparison: - bid_telemetry(): Modern API returning a clean tibble (recommended for new code) - bid_ingest_telemetry(): Legacy API returning hybrid object with list structure (for backward compatibility)

Key Features

Behavioral Science Integration

  • Bias Mitigation: Address anchoring, framing, confirmation bias, and choice overload
  • Cognitive Load Management: Implement progressive disclosure and visual hierarchy
  • Peak-End Rule: Structure experiences for positive, actionable endings

Implementation Support

  • Component Suggestions: Get tailored recommendations for {bslib}, {reactable}, {echarts4r}, and more
  • Layout Selection: Automatic layout recommendations based on content and telemetry flags
  • Concept Dictionary: Access 50+ behavioral science concepts with implementation tips

Real User Data Integration

  • Telemetry Analysis: Transform usage patterns into design insights
  • Evidence-Based Design: Ground design decisions in actual user behavior
  • Iterative Improvement: Track UX improvements with before/after telemetry comparison

Learning More

The BID framework is based on established behavioral science and UX design principles. Explore the concept dictionary:

# Browse all available concepts
bid_concepts() |>
  select(concept, category, description)

# Get detailed information about specific concepts
bid_concept("Processing Fluency")
bid_concept("Hick's Law")

# Search for concepts by keyword
bid_concepts("cognitive") |>
  select(concept, implementation_tips)

Getting Help

  • Browse the documentation: help(package = "bidux")
  • Read the vignettes:
    • vignette("behavioral-science-primer"): Behavioral science for data scientists
    • vignette("introduction-to-bid"): Framework overview and core principles
    • vignette("telemetry-integration"): Data-driven UX workflows with {shiny.telemetry}
    • vignette("otel-integration"): Using Shiny’s native OpenTelemetry (NEW!)
    • vignette("practical-examples"): Practical dashboard examples
    • vignette("getting-started"): Complete walk-through with examples
    • vignette("concepts-reference"): Behavioral science concepts with practical implementation
    • vignette("advanced-workflows"): Advanced BID workflows
  • Visit the BID framework repository: https://github.com/jrwinget/bid-framework

Code of Conduct

Please note that the bidux project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('bidux')

Monthly Downloads

201

Version

0.4.0

License

MIT + file LICENSE

Maintainer

Jeremy Winget

Last Published

February 27th, 2026

Functions in bidux (0.4.0)

bid_telemetry

Concise telemetry analysis with tidy output
bid_telemetry_presets

Get predefined telemetry sensitivity presets
check_otel_available

Check if OpenTelemetry packages are available
convert_otel_spans_to_events

Convert OTLP spans to bidux event schema
bid_result

Constructor for BID result collection objects
bid_set_quiet

Set global quiet mode for bidux functions
create_navigation_notice

Create notice stage for navigation issues
create_unused_input_notice

Create notice stage for unused input
check_json_depth

Check JSON nesting depth recursively
create_error_notice

Create notice stage for error patterns
bid_with_quiet

Temporarily suppress bidux messages
bid_suggest_components

Suggest UI Components Based on BID Framework Analysis
bid_validate

Document User Validation Stage in BID Framework
bid_interpret

Document User Interpretation Stage in BID Framework
bid_suggest_analytics

Suggest alternative analytics solutions for static dashboards
classify_audience

classify audience type from description text
create_telemetry_notice

Create a telemetry notice from problem and evidence
create_confusion_notice

Create notice stage for confusion patterns
detect_telemetry_format

Auto-detect telemetry format from file extension
.calculate_severity_metrics

Calculate severity metrics for an issue
detect_otel_json

Detect if JSON file contains OTLP (OpenTelemetry Protocol) data
deduplicate_warnings_suggestions

Remove duplicate warning-suggestion pairs
create_delay_notice

Create notice stage for delayed interactions
get_cognitive_load_suggestions

Generate Cognitive Load Theory suggestions
build_groups_with_suggestions

Build suggestion groups organized by concept
get_concept_bias_mappings

Get bias mitigation strategies for concepts
extract_stage1_theory

Extract theory concepts from Stage 1 (Notice)
extract_stage

Extract specific stage from bid_result
find_navigation_dropoffs

Find navigation drop-offs or underused pages
extract_output_id_from_span

Extract output ID from span name or attributes
get_progressive_disclosure_suggestions

Generate Progressive Disclosure suggestions
calculate_span_duration_ms

Calculate span duration in milliseconds
find_error_patterns

Find error patterns in telemetry
extract_navigation_id_from_span

Extract navigation ID from span attributes
load_concept_bias_mappings

Load concept-bias mappings
bid_structure

Document Dashboard Structure Stage in BID Framework
bid_stage

Constructor for BID stage objects
bidux-package

bidux: Behavioral Insight Design: A Toolkit for Integrating Behavioral Science in UI/UX Design
load_concepts_data

Load concepts data from external file with caching
build_concept_group

Build suggestions for a specific concept
get_proximity_suggestions

Generate Principle of Proximity suggestions
.flags_from_issues

Extract global telemetry flags from issues and events
get_metadata

Get metadata from bid_stage object
get_default_theory_mappings

Get default theory mappings (fallback)
get_default_layout_mappings

Get default layout mappings (fallback)
.classify_issue_type

Classify issue type from issue key
print.bid_bias_mitigations

Print method for bias mitigations objects
parse_span_timestamp

Parse Unix nanosecond timestamp to POSIXct
read_otel_json

Read OpenTelemetry JSON (OTLP) file
read_otel_sqlite

Read OpenTelemetry SQLite database
new_data_story

Create a data story object
get_accessibility_recommendations

Get accessibility recommendations for a given context
format_label

Format field label based on output format
.suggest_theory_from_text

Suggest theory from text with confidence scoring and messaging
new_bid_stage

Create a BID stage result object (internal constructor)
validate_bid_stage

Validate BID stage object
get_onboarding_suggestions

Generate User Onboarding suggestions
validate_concepts_data_structure

Validate loaded concepts data structure
get_fallback_concepts_data

Fallback concepts data for emergency use
get_dual_processing_suggestions

Generate Dual-Processing Theory suggestions
get_fallback_suggestion

Generate fallback suggestions for stages without specific rules
get_stage

Get stage name from bid_stage object
get_visual_hierarchy_suggestions

Generate Visual Hierarchy suggestions
print.bid_result

Print method for BID result objects
print.bid_stage

Print method for BID stage objects
extract_session_id_from_span

Extract session ID from span attributes
get_generic_suggestions

Generate generic suggestions for unrecognized concepts
get_information_scent_suggestions

Generate Information Scent suggestions
extract_error_message_from_span

Extract error message from span events
safe_stage_data_story_access

Safe access to data_story elements from previous stage
find_confusion_patterns

Find confusion patterns (rapid repeated changes)
structure_suggestions

Generate ranked, concept-grouped, actionable UI/UX suggestions
.create_issues_tibble

Create tidy issues tibble from notice issues list
extract_input_id_from_span

Extract input ID from span name or attributes
get_layout_concepts

Get concepts recommended for a layout
is_complete

Check if workflow is complete (has all 5 stages)
print.bid_data_story

Print method for data story objects
print.bid_issues

Print method for bid_issues objects
load_accessibility_guidelines

Load accessibility guidelines
find_delayed_sessions

Find sessions with delayed first interaction
get_consolidated_suggestion_rules

Get consolidated suggestion rules for all BID stages
print.bid_user_personas

Print method for user personas objects
get_default_concepts_data

Get default concepts data with lazy loading
read_telemetry_sqlite

Read telemetry from SQLite database
safe_lower

Safely convert text to lowercase with null handling
rank_and_sort_suggestions

Rank and sort suggestions within each group
read_telemetry_data

Read telemetry data from file or connection
flatten_suggestions_to_tibble

Convert nested suggestion groups to flat tibble
read_telemetry_json

Read telemetry from JSON log file
extract_span_attribute

Extract an attribute value from span attributes by key names
get_concept_keywords

Get the canonical concept keyword map for text-based concept detection
find_unused_inputs

Find unused or under-used inputs
suggest_theory_from_mappings

Suggest theory based on problem and evidence using mappings
load_theory_mappings

Load theory mappings from external file or use defaults
load_layout_mappings

Load layout-concept mappings
new_bias_mitigations

Create bias mitigations tibble
new_user_personas

Create user personas tibble
is_bid_stage

Check if object is a bid_stage
get_concepts_data

Internal function to get concepts data from external files
normalize_telemetry_columns

Normalize telemetry column names
new_bid_result

Create a BID result collection object (internal constructor)
infer_concepts_from_story

Infer concepts from Stage 2 (Interpret) story elements
summary.bid_result

Summary method for BID result objects
validate_param

Common validation utility for bidux functions (DRY principle)
validate_bid_result

Validate BID result object
summary.bid_stage

Summary method for BID stage objects
bid_concept

Get detailed information about a specific concept
bid_concepts

Search BID Framework Concepts
bid_address

Create Notice stage from single telemetry issue (sugar)
bid_anticipate

Document User Behavior Anticipation Stage in BID Framework
assign_difficulty

Assign difficulty rating based on components and suggestion complexity
as_tibble.bid_stage

Convert bid_stage to tibble
as_tibble.bid_issues

Convert bid_issues object to tibble
bid_pipeline

Create pipeline of Notice stages from top telemetry issues (sugar)
bid_notices

Create multiple Notice stages from telemetry issues
bid_notice

Document User Notice Stage in BID Framework
bid_quick_suggest

Quick UX Suggestions for R Dashboard Developers
bid_ingest_telemetry

Ingest telemetry data and identify UX friction points
assign_category

Assign category based on suggestion content and concept
adjust_suggestion_score

Apply context-based scoring adjustments
apply_suggestion_rules

Apply suggestion rules to context data
bid_flags

Extract telemetry flags from bid_issues object
bid_get_quiet

Get current quiet mode setting
bid_notice_issue

Create Notice stage from individual telemetry issue
bid_report

Generate BID Framework Report