Mastering Shiny: Build Interactive Apps, Reports, and Dashboards Powered by R
- Length: 378 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2021-05-25
- ISBN-10: 1492047384
- ISBN-13: 9781492047384
- Sales Rank: #9877 (See Top 100 Books)
Master the Shiny web framework—and take your R skills to a whole new level. By letting you move beyond static reports, Shiny helps you create fully interactive web apps for data analyses. Users will be able to jump between datasets, explore different subsets or facets of the data, run models with parameter values of their choosing, customize visualizations, and much more.
Hadley Wickham from RStudio shows data scientists, data analysts, statisticians, and scientific researchers with no knowledge of HTML, CSS, or JavaScript how to create rich web apps from R. This in-depth guide provides a learning path that you can follow with confidence, as you go from a Shiny beginner to an expert developer who can write large, complex apps that are maintainable and performant.
- Get started: Discover how the major pieces of a Shiny app fit together
- Put Shiny in action: Explore Shiny functionality with a focus on code samples, example apps, and useful techniques
- Master reactivity: Go deep into the theory and practice of reactive programming and examine reactive graph components
- Apply best practices: Examine useful techniques for making your Shiny apps work well in production
Preface What Is Shiny? Who Should Read This Book? What Will You Learn? What Won’t You Learn? Prerequisites Conventions Used in This Book Using Code Examples O’Reilly Online Learning How to Contact Us Acknowledgments How This Book Was Built I. Getting Started 1. Your First Shiny App Introduction Create App Directory and File Running and Stopping Adding UI Controls Adding Behavior Reducing Duplication with Reactive Expressions Summary Exercises 2. Basic UI Introduction Inputs Common Structure Free Text Numeric Inputs Dates Limited Choices File Uploads Action Buttons Exercises Outputs Text Tables Plots Downloads Exercises Summary 3. Basic Reactivity Introduction The Server Function Input Output Reactive Programming Imperative Versus Declarative Programming Laziness The Reactive Graph Reactive Expressions Execution Order Exercises Reactive Expressions The Motivation The App The Reactive Graph Simplifying the Graph Why Do We Need Reactive Expressions? Controlling Timing of Evaluation Timed Invalidation On Click Observers Summary 4. Case Study: ER Injuries Introduction The Data Exploration Prototype Polish Tables Rate Versus Count Narrative Exercises Summary II. Shiny in Action 5. Workflow Development Workflow Creating the App Seeing Your Changes Controlling the View Debugging Reading Tracebacks Tracebacks in Shiny The Interactive Debugger Case Study Debugging Reactivity Getting Help Reprex Basics Making a Reprex Making a Minimal Reprex Case Study Summary 6. Layout, Themes, HTML Introduction Single-Page Layouts Page Functions Page with Sidebar Multirow Exercises Multipage Layouts Tabsets Navlists and Navbars Bootstrap Themes Getting Started Shiny Themes Plot Themes Exercises Under the Hood Summary 7. Graphics Interactivity Basics Clicking Other Point Events Brushing Modifying the Plot Interactivity Limitations Dynamic Height and Width Images Summary 8. User Feedback Validation Validating Input Canceling Execution with req() req() and Validation Validate Output Notifications Transient Notification Removing on Completion Progressive Updates Progress Bars Shiny Waiter Spinners Confirming and Undoing Explicit Confirmation Undoing an Action Trash Summary 9. Uploads and Downloads Upload UI Server Uploading Data Download Basics Downloading Data Downloading Reports Case Study Exercises Summary 10. Dynamic UI Updating Inputs Simple Uses Hierarchical Select Boxes Freezing Reactive Inputs Circular References Interrelated Inputs Exercises Dynamic Visibility Conditional UI Wizard Interface Exercises Creating UI with Code Getting Started Multiple Controls Dynamic Filtering Dialog Boxes Exercises Summary 11. Bookmarking Basic Idea Updating the URL Storing Richer State Bookmarking Challenges Exercises Summary 12. Tidy Evaluation Motivation Data-Masking Getting Started Example: ggplot2 Example: dplyr User-Supplied Data Why Not Use Base R? Tidy-Selection Indirection Tidy-Selection and Data-Masking parse() and eval() Summary III. Mastering Reactivity 13. Why Reactivity? Introduction Why Do We Need Reactive Programming? Why Can’t You Use Variables? What About Functions? Event-Driven Programming Reactive Programming A Brief History of Reactive Programming Summary 14. The Reactive Graph Introduction A Step-by-Step Tour of Reactive Execution A Session Begins Execution Begins Reading a Reactive Expression Reading an Input Reactive Expression Completes Output Completes The Next Output Executes Execution Completes, Outputs Flushed An Input Changes Invalidating the Inputs Notifying Dependencies Removing Relationships Re-execution Exercises Dynamism The Reactlog Package Summary 15. Reactive Building Blocks Reactive Values Exercises Reactive Expressions Errors on.exit() Exercises Observers and Outputs Isolating Code isolate() observeEvent() and eventReactive() Exercises Timed Invalidation Polling Long-Running Reactives Timer Accuracy Exercises Summary 16. Escaping the Graph Introduction What Doesn’t the Reactive Graph Capture? Case Studies One Output Modified by Multiple Inputs Accumulating Inputs Pausing Animations Exercises Antipatterns Summary IV. Best Practices 17. General Guidelines Introduction Code Organization Testing Dependency Management Source Code Management Continuous Integration/Deployment Code Reviews Summary 18. Functions File Organization UI Functions Other Applications Functional Programming UI as Data Server Functions Reading Uploaded Data Internal Functions Summary 19. Shiny Modules Motivation Module Basics Module UI Module Server Updated App Namespacing Naming Conventions Exercises Inputs and Outputs Getting Started: UI Input and Server Output Case Study: Selecting a Numeric Variable Server Inputs Modules Inside of Modules Case Study: Histogram Multiple Outputs Exercises Case Studies Limited Selection and Other Wizard Dynamic UI Single Object Modules Summary 20. Packages Converting an Existing App Single File Module Files A Package Benefits Workflow Sharing Extra Steps Deploying Your App-Package R CMD check Summary 21. Testing Testing Functions Basic Structure Basic Workflow Key Expectations User Interface Functions Workflow Code Coverage Keyboard Shortcuts Workflow Summary Testing Reactivity Modules Limitations Testing JavaScript Basic Operation Case Study Testing Visuals Philosophy When Should You Write Tests? Summary 22. Security Data Compute Resources 23. Performance Dining at Restaurant Shiny Benchmark Recording Replay Analysis Profiling The Flame Graph Profiling R Code Profiling a Shiny App Limitations Improve Performance Caching Basics Caching a Reactive Caching Plots Cache Key Cache Scope Other Optimizations Schedule Data Munging Manage User Expectations Summary Index
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Mastering Shiny: Build Interactive Apps, Reports, and Dashboards Powered by R
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.