舉報(bào)

會(huì)員
R Programming By Example
最新章節(jié):
Loading R packages
ThisbooksisforaspiringdatascienceprofessionalsorstatisticianswhowouldliketolearnabouttheRprogramminglanguageinapracticalmanner.Basicprogrammingknowledgeisassumed.
最新章節(jié)
- Loading R packages
- Internal requirements – R packages
- macOS High Sierra
- Ubuntu 17.10
- Dependencies for the Rcpp package and the .Fortran() function
- macOS High Sierra
品牌:中圖公司
上架時(shí)間:2021-07-02 18:38:45
出版社:Packt Publishing
本書數(shù)字版權(quán)由中圖公司提供,并由其授權(quán)上海閱文信息技術(shù)有限公司制作發(fā)行
- Loading R packages 更新時(shí)間:2021-07-02 21:31:24
- Internal requirements – R packages
- macOS High Sierra
- Ubuntu 17.10
- Dependencies for the Rcpp package and the .Fortran() function
- macOS High Sierra
- Ubuntu 17.10
- Dependencies for the rgl and rgdal R packages
- Setting up user/password in both Linux and macOS
- macOS High Sierra
- Ubuntu 17.10
- Dependencies for the RMySQL R package
- External requirements – software outside of R
- Required Packages
- Summary
- Sharing your newly created application
- Adding custom CSS styling
- Adding HTML to your web application
- Adding static images
- Other topics of interest
- Styling our application with themes
- Adding interactivity with a secondary zoom-in graph
- Adding a simple moving average graph
- Adding a summary table with shared data
- Setting up dynamic input panels
- Setting up dynamic options in a drop-down
- Setting up static user inputs
- Introducing interactivity with user input
- Inserting a dynamic data table
- Introducing sections with panels
- Setting up a two-column distribution
- Designing our high-level application structure
- The input output and rendering functions
- The building blocks for reactivity in Shiny
- How is functional reactivity handled within Shiny?
- What is functional reactive programming and why is it useful?
- Introducing the Shiny application architecture and reactivity
- Required packages
- Adding Interactivity with Dashboards
- Summary
- Specialized R distributions
- Flexibility and power with cloud computing
- Using specialized packages for performance
- Improving our data and memory management
- Using memoization or cache layers
- Just-in-time (JIT) compilation of R code
- Making R code a bit faster with byte code compilation
- Preallocating memory to avoid duplication
- Other topics of interest to enhance performance
- Looking back at what we have achieved
- Using a modern approach with C++
- Using an old-school approach with Fortran
- Using C++ and Fortran to accelerate calculations
- Practical parallelization with R
- How deep does the parallelization rabbit hole go?
- Using parallelization to divide and conquer
- Avoiding sending data structures with overheads
- Using R's way of iterating efficiently
- If you can avoid iterating at all
- Moving checks out of iterative processes
- Removing unnecessary logic
- Vectorizing as much as possible
- Using the simple data structure for the job
- Easily achieving high benefit - cost improvements
- Benchmarking automatically with microbenchmark()
- Benchmarking manually with system.time()
- Profiling fundamentals with Rprof()
- Measuring by profiling and benchmarking
- Single-threaded processes
- Memory-bound processes
- Interpreted dynamic typings
- Object immutability
- Understanding why R can be slow
- Our first (very inefficient) attempt at an SMA
- Simulating the time-series
- Calculating simple moving averages inefficiently
- How fast is fast enough?
- Just how much impact can algorithm selection have?
- Starting by using good algorithms
- Required packages
- Implementing an Efficient Simple Moving Average
- Summary
- Some advice when working with object-oriented systems
- Activating our system with two simple functions
- Saving our initial user data into the system
- Helping ourselves with a centralized settings file
- Finally introducing users with S3 classes
- Implementing our wallet requesters
- Developing our wallets infrastructure
- Developing our exchanges infrastructure
- Creating a very simple requester to isolate API calls
- Retrieving live data for markets and wallets with R6 classes
- Encapsulating multiple databases with a storage layer
- Easily allowing new database integration with a factory
- Implementing a database-like storage system with CSV files
- Communicating available behavior with a database interface
- Implementing our storage layer with R6 classes
- Implementing cryptocurrency assets using S4 classes
- Starting simple with timestamps using S3 classes
- The architecture behind our cryptocurrencies system
- Finalizers
- Active bindings
- Inheritance
- Encapsulation and mutability
- Public methods and polymorphism
- Classes constructors and composition
- The R6 object model
- Inheritance
- Encapsulation and mutability
- Public methods and polymorphism
- Classes constructors and composition
- The S4 object model
- Inheritance
- Encapsulation and mutability
- Public methods and polymorphism
- Classes constructors and composition
- The S3 object model
- The second source of confusion – generic functions
- The first source of confusion – various object models
- Introducing three object models in R – S3 S4 and R6
- Interfaces factories and patterns in general
- Public and private methods
- Classes and constructors
- Hierarchies
- Polymorphism
- Encapsulation
- Important concepts behind object-oriented languages
- The purpose of object-oriented programming
- A brief introduction to object-oriented programming
- The cryptocurrencies example
- This chapter's required packages
- Object-Oriented System to Track Cryptocurrencies
- Summary
- Building our presentation with R Markdown
- Developing graphs and analysis as we normally would
- Producing the final output with knitr
- Caching
- Global chunk options
- Chunk options
- Graphs
- Tables
- Code chunks
- Extending Markdown with R Markdown
- Mathematics
- Code
- Quotes
- Images
- Links
- Tables
- Lists
- Header Level 4
- Header Level 3
- Header Level 2
- Header Level 1
- Headers
- Text
- A gentle introduction to Markdown
- The basic tools for an automation pipeline
- Reproducibility as a benefit of literate programming
- Literate programming as a content creation methodology
- Why invest in automation?
- Required packages
- Developing Automatic Presentations
- Summary
- Retrieving text data from Twitter
- Testing our predictive model with unseen data
- Digging deeper with sentiment analysis
- Extending our analysis with cosine similarity
- Reducing dimensionality with SVD
- Adding flexibility with N-grams
- Improving our results with TF-IDF
- Computing predictive accuracy and confusion matrices
- Improving speed with parallelization
- Training our first predictive model
- Training models with cross validation
- Document feature matrices
- Building the corpus with tokenization and data cleaning
- Preparing training and testing data
- What is text analysis and how does it work?
- This chapter's required packages
- Understanding Reviews with Text Analysis
- Summary
- High-tech-looking interactive globe
- Maps you can navigate and zoom-in to
- Navigating geographical data with interactive maps
- Looking at geographical data with static maps
- Looking at dynamic data with time-series
- Exploring with interactive 3D scatter plots
- Developing our own graph type – radar graphs
- Client birth dates gender and ratings
- Pricing and profitability by protein source and continent
- Scatter plots with joint and marginal distributions
- Graphing disaggregated data with boxplots
- Graphing top performers with bar graphs
- Adding a third dimension with colors
- Starting with simple applications for bar graphs
- Building blocks for reusable high-quality graphs
- Extending our data with profit metrics
- Required packages
- Communicating Sales with Visualizations
- Summary
- Working with relational databases
- Simulating the client messages data
- Simulating the client data
- Putting everything together
- Simulating strings for complex identifiers
- Simulating numbers under shared restrictions
- Simulating dates within a range
- Simulating categorical values using factors
- Simulating numeric data according to distribution assumptions
- Simulating the sales data
- The too-much-repeated-data problem
- The too-much-empty-space problem
- Potential pitfalls
- Simplifying assumptions
- The basic variables
- Designing our data tables
- Required packages
- Simulating Sales Data and Working with Databases
- Summary
- Predicting votes from wards with unknown data
- Generating model combinations
- Programatically finding the best model
- Measuring accuracy with score functions
- Checking no collinearity with correlations
- Checking homoscedasticity with residual plots
- Checking normality with histograms and quantile-quantile plots
- Checking linearity with scatter plots
- Checking model assumptions
- Predicting votes with linear models
- Training and testing datasets
- Setting up the data
- Required packages
- Predicting Votes with Linear Models
- Summary
- Programming by visualizing the big picture
- Understanding the fundamentals of high-quality code
- Planning before programming
- Putting it all together into high-quality code
- Building new variables with principal components
- Creating a new dataset with what we've learned
- Understanding interactions with correlations
- Getting a better look with detailed scatter plots
- Using matrix scatter plots for a quick overview
- Visualizing variable distributions
- Getting intuition with graphs and correlations
- Summarizing the data into a data frame
- Cleaning and setting up the data
- The Brexit votes example
- This chapter's required packages
- Understanding Votes with Descriptive Statistics
- Summary
- The examples in this book
- While loops
- For loops
- If… else conditionals
- Complex logic with control structures
- Coercion
- Operators are functions
- Functions as arguments
- Optional arguments
- Divide and conquer with functions
- Data frames
- Lists
- Matrices
- Factors
- Vectors
- Logicals
- Characters
- Special values
- Numerics
- Working with data types and data structures
- Tracking state with symbols and variables
- How to use this book
- Executing R code in non-interactive sessions
- The efficient write-execute loop
- The send to console functionality
- Pick an IDE or a powerful editor
- Tools to work efficiently with R
- The interpreter and the console
- Comparing R with other software
- What R is not good for
- R is free as in freedom and as in free beer
- R is a flexible programming language
- R is a high quality statistical computing system
- The inspiration for R – the S language
- What R is and what it isn't
- Introduction to R
- Questions
- Piracy
- Errata
- Downloading the color images of this book
- Downloading the example code
- Customer support
- Reader feedback
- Conventions
- Who this book is for
- What you need for this book
- What this book covers
- Preface
- Customer Feedback
- Why subscribe?
- www.PacktPub.com
- About the Reviewer
- About the Author
- Credits
- 版權(quán)信息
- 封面
- 封面
- 版權(quán)信息
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Why subscribe?
- Customer Feedback
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Downloading the color images of this book
- Errata
- Piracy
- Questions
- Introduction to R
- What R is and what it isn't
- The inspiration for R – the S language
- R is a high quality statistical computing system
- R is a flexible programming language
- R is free as in freedom and as in free beer
- What R is not good for
- Comparing R with other software
- The interpreter and the console
- Tools to work efficiently with R
- Pick an IDE or a powerful editor
- The send to console functionality
- The efficient write-execute loop
- Executing R code in non-interactive sessions
- How to use this book
- Tracking state with symbols and variables
- Working with data types and data structures
- Numerics
- Special values
- Characters
- Logicals
- Vectors
- Factors
- Matrices
- Lists
- Data frames
- Divide and conquer with functions
- Optional arguments
- Functions as arguments
- Operators are functions
- Coercion
- Complex logic with control structures
- If… else conditionals
- For loops
- While loops
- The examples in this book
- Summary
- Understanding Votes with Descriptive Statistics
- This chapter's required packages
- The Brexit votes example
- Cleaning and setting up the data
- Summarizing the data into a data frame
- Getting intuition with graphs and correlations
- Visualizing variable distributions
- Using matrix scatter plots for a quick overview
- Getting a better look with detailed scatter plots
- Understanding interactions with correlations
- Creating a new dataset with what we've learned
- Building new variables with principal components
- Putting it all together into high-quality code
- Planning before programming
- Understanding the fundamentals of high-quality code
- Programming by visualizing the big picture
- Summary
- Predicting Votes with Linear Models
- Required packages
- Setting up the data
- Training and testing datasets
- Predicting votes with linear models
- Checking model assumptions
- Checking linearity with scatter plots
- Checking normality with histograms and quantile-quantile plots
- Checking homoscedasticity with residual plots
- Checking no collinearity with correlations
- Measuring accuracy with score functions
- Programatically finding the best model
- Generating model combinations
- Predicting votes from wards with unknown data
- Summary
- Simulating Sales Data and Working with Databases
- Required packages
- Designing our data tables
- The basic variables
- Simplifying assumptions
- Potential pitfalls
- The too-much-empty-space problem
- The too-much-repeated-data problem
- Simulating the sales data
- Simulating numeric data according to distribution assumptions
- Simulating categorical values using factors
- Simulating dates within a range
- Simulating numbers under shared restrictions
- Simulating strings for complex identifiers
- Putting everything together
- Simulating the client data
- Simulating the client messages data
- Working with relational databases
- Summary
- Communicating Sales with Visualizations
- Required packages
- Extending our data with profit metrics
- Building blocks for reusable high-quality graphs
- Starting with simple applications for bar graphs
- Adding a third dimension with colors
- Graphing top performers with bar graphs
- Graphing disaggregated data with boxplots
- Scatter plots with joint and marginal distributions
- Pricing and profitability by protein source and continent
- Client birth dates gender and ratings
- Developing our own graph type – radar graphs
- Exploring with interactive 3D scatter plots
- Looking at dynamic data with time-series
- Looking at geographical data with static maps
- Navigating geographical data with interactive maps
- Maps you can navigate and zoom-in to
- High-tech-looking interactive globe
- Summary
- Understanding Reviews with Text Analysis
- This chapter's required packages
- What is text analysis and how does it work?
- Preparing training and testing data
- Building the corpus with tokenization and data cleaning
- Document feature matrices
- Training models with cross validation
- Training our first predictive model
- Improving speed with parallelization
- Computing predictive accuracy and confusion matrices
- Improving our results with TF-IDF
- Adding flexibility with N-grams
- Reducing dimensionality with SVD
- Extending our analysis with cosine similarity
- Digging deeper with sentiment analysis
- Testing our predictive model with unseen data
- Retrieving text data from Twitter
- Summary
- Developing Automatic Presentations
- Required packages
- Why invest in automation?
- Literate programming as a content creation methodology
- Reproducibility as a benefit of literate programming
- The basic tools for an automation pipeline
- A gentle introduction to Markdown
- Text
- Headers
- Header Level 1
- Header Level 2
- Header Level 3
- Header Level 4
- Lists
- Tables
- Links
- Images
- Quotes
- Code
- Mathematics
- Extending Markdown with R Markdown
- Code chunks
- Tables
- Graphs
- Chunk options
- Global chunk options
- Caching
- Producing the final output with knitr
- Developing graphs and analysis as we normally would
- Building our presentation with R Markdown
- Summary
- Object-Oriented System to Track Cryptocurrencies
- This chapter's required packages
- The cryptocurrencies example
- A brief introduction to object-oriented programming
- The purpose of object-oriented programming
- Important concepts behind object-oriented languages
- Encapsulation
- Polymorphism
- Hierarchies
- Classes and constructors
- Public and private methods
- Interfaces factories and patterns in general
- Introducing three object models in R – S3 S4 and R6
- The first source of confusion – various object models
- The second source of confusion – generic functions
- The S3 object model
- Classes constructors and composition
- Public methods and polymorphism
- Encapsulation and mutability
- Inheritance
- The S4 object model
- Classes constructors and composition
- Public methods and polymorphism
- Encapsulation and mutability
- Inheritance
- The R6 object model
- Classes constructors and composition
- Public methods and polymorphism
- Encapsulation and mutability
- Inheritance
- Active bindings
- Finalizers
- The architecture behind our cryptocurrencies system
- Starting simple with timestamps using S3 classes
- Implementing cryptocurrency assets using S4 classes
- Implementing our storage layer with R6 classes
- Communicating available behavior with a database interface
- Implementing a database-like storage system with CSV files
- Easily allowing new database integration with a factory
- Encapsulating multiple databases with a storage layer
- Retrieving live data for markets and wallets with R6 classes
- Creating a very simple requester to isolate API calls
- Developing our exchanges infrastructure
- Developing our wallets infrastructure
- Implementing our wallet requesters
- Finally introducing users with S3 classes
- Helping ourselves with a centralized settings file
- Saving our initial user data into the system
- Activating our system with two simple functions
- Some advice when working with object-oriented systems
- Summary
- Implementing an Efficient Simple Moving Average
- Required packages
- Starting by using good algorithms
- Just how much impact can algorithm selection have?
- How fast is fast enough?
- Calculating simple moving averages inefficiently
- Simulating the time-series
- Our first (very inefficient) attempt at an SMA
- Understanding why R can be slow
- Object immutability
- Interpreted dynamic typings
- Memory-bound processes
- Single-threaded processes
- Measuring by profiling and benchmarking
- Profiling fundamentals with Rprof()
- Benchmarking manually with system.time()
- Benchmarking automatically with microbenchmark()
- Easily achieving high benefit - cost improvements
- Using the simple data structure for the job
- Vectorizing as much as possible
- Removing unnecessary logic
- Moving checks out of iterative processes
- If you can avoid iterating at all
- Using R's way of iterating efficiently
- Avoiding sending data structures with overheads
- Using parallelization to divide and conquer
- How deep does the parallelization rabbit hole go?
- Practical parallelization with R
- Using C++ and Fortran to accelerate calculations
- Using an old-school approach with Fortran
- Using a modern approach with C++
- Looking back at what we have achieved
- Other topics of interest to enhance performance
- Preallocating memory to avoid duplication
- Making R code a bit faster with byte code compilation
- Just-in-time (JIT) compilation of R code
- Using memoization or cache layers
- Improving our data and memory management
- Using specialized packages for performance
- Flexibility and power with cloud computing
- Specialized R distributions
- Summary
- Adding Interactivity with Dashboards
- Required packages
- Introducing the Shiny application architecture and reactivity
- What is functional reactive programming and why is it useful?
- How is functional reactivity handled within Shiny?
- The building blocks for reactivity in Shiny
- The input output and rendering functions
- Designing our high-level application structure
- Setting up a two-column distribution
- Introducing sections with panels
- Inserting a dynamic data table
- Introducing interactivity with user input
- Setting up static user inputs
- Setting up dynamic options in a drop-down
- Setting up dynamic input panels
- Adding a summary table with shared data
- Adding a simple moving average graph
- Adding interactivity with a secondary zoom-in graph
- Styling our application with themes
- Other topics of interest
- Adding static images
- Adding HTML to your web application
- Adding custom CSS styling
- Sharing your newly created application
- Summary
- Required Packages
- External requirements – software outside of R
- Dependencies for the RMySQL R package
- Ubuntu 17.10
- macOS High Sierra
- Setting up user/password in both Linux and macOS
- Dependencies for the rgl and rgdal R packages
- Ubuntu 17.10
- macOS High Sierra
- Dependencies for the Rcpp package and the .Fortran() function
- Ubuntu 17.10
- macOS High Sierra
- Internal requirements – R packages
- Loading R packages 更新時(shí)間:2021-07-02 21:31:24