R Programming for Data Science (The Course) (The Course)
Course Info
This course includes 1 attempt.
Data science has taken the world by storm. Every field of study and area of business has been affected as people increasingly realize the value of the incredible quantities of data being generated. But to extract value from those data, one needs to be trained in the proper data science skills. The R programming language has become the de facto programming language for data science. Its flexibility, power, sophistication, and expressiveness have made it an invaluable tool for data scientists around the world.
This book is about the fundamentals of R programming. You will get started with the basics of the language, learn how to manipulate datasets, how to write functions, and how to debug and optimize code. With the fundamentals provided in this book, you will have a solid foundation on which to build your data science toolbox.
If you are interested in a printed copy of this book, you can purchase one at Lulu.
Course Material
- 1: Introduction
- 1.1: Stay in Touch!
- 1.2: Preface
- 2: History and Overview of R
- 2.1: What is R?
- 2.2: What is S?
- 2.3: The S Philosophy
- 2.4: Back to R
- 2.5: Basic Features of R
- 2.6: Free Software
- 2.7: Design of the R System
- 2.8: Limitations of R
- 2.9: R Resources
- 2.9.1: Official Manuals
- 2.9.2: Useful Standard Texts on S and R
- 2.9.3: Other Resources
- 3: Getting Started with R
- 3.1: Installation
- 3.2: Getting started with the R interface
- 4: R Nuts and Bolts
- 4.1: Entering Input
- 4.2: Evaluation
- 4.3: R Objects
- 4.4: Numbers
- 4.5: Attributes
- 4.6: Creating Vectors
- 4.7: Mixing Objects
- 4.8: Explicit Coercion
- 4.9: Matrices
- 4.10: Lists
- 4.11: Factors
- 4.12: Missing Values
- 4.13: Data Frames
- 4.14: Names
- 4.15: Summary
- 5: Getting Data In and Out of R
- 5.1: Reading and Writing Data
- 5.2: Reading Data Files with read.table()
- 5.3: Reading in Larger Datasets with read.table
- 5.4: Calculating Memory Requirements for R Objects
- 6: Using the readr Package
- 7: Using Textual and Binary Formats for Storing Data
- 7.1: Using dput() and dump()
- 7.2: Binary Formats
- 8: Interfaces to the Outside World
- 8.1: File Connections
- 8.2: Reading Lines of a Text File
- 8.3: Reading From a URL Connection
- 9: Subsetting R Objects
- 9.1: Subsetting a Vector
- 9.2: Subsetting a Matrix
- 9.2.1: Dropping matrix dimensions
- 9.3: Subsetting Lists
- 9.4: Subsetting Nested Elements of a List
- 9.5: Extracting Multiple Elements of a List
- 9.6: Partial Matching
- 9.7: Removing NA Values
- 10: Vectorized Operations
- 10.1: Vectorized Matrix Operations
- 11: Dates and Times
- 11.1: Dates in R
- 11.2: Times in R
- 11.3: Operations on Dates and Times
- 11.4: Summary
- 12: Managing Data Frames with the dplyr package
- 12.1: Data Frames
- 12.2: The dplyr Package
- 12.3: dplyr Grammar
- 12.3.1: Common dplyr Function Properties
- 12.4: Installing the dplyr package
- 12.5: select()
- 12.6: filter()
- 12.7: arrange()
- 12.8: rename()
- 12.9: mutate()
- 12.10: group_by()
- 12.11: %>%
- 12.12: Summary
- 13: Control Structures
- 13.1: if-else
- 13.2: for Loops
- 13.3: Nested for loops
- 13.4: while Loops
- 13.5: repeat Loops
- 13.6: next, break
- 13.7: Summary
- 14: Functions
- 14.1: Functions in R
- 14.2: Your First Function
- 14.3: Argument Matching
- 14.4: Lazy Evaluation
- 14.5: The ... Argument
- 14.6: Arguments Coming After the ... Argument
- 14.7: Summary
- 15: Scoping Rules of R
- 15.1: A Diversion on Binding Values to Symbol
- 15.2: Scoping Rules
- 15.3: Lexical Scoping: Why Does It Matter?
- 15.4: Lexical vs. Dynamic Scoping
- 15.5: Application: Optimization
- 15.6: Plotting the Likelihood
- 15.7: Summary
- 16: Coding Standards for R
- 17: Loop Functions
- 17.1: Looping on the Command Line
- 17.2: lapply()
- 17.3: sapply()
- 17.4: split()
- 17.5: Splitting a Data Frame
- 17.6: tapply
- 17.7: apply()
- 17.8: Col/Row Sums and Means
- 17.9: Other Ways to Apply
- 17.10: mapply()
- 17.11: Vectorizing a Function
- 17.12: Summary
- 18: Regular Expressions
- 18.1: Before You Begin
- 18.2: Primary R Functions
- 18.3: grep()
- 18.4: grepl()
- 18.5: regexpr()
- 18.6: sub() and gsub()
- 18.7: regexec()
- 18.8: The stringr Package
- 18.9: Summary
- 19: Debugging
- 19.1: Something’s Wrong!
- 19.2: Figuring Out What’s Wrong
- 19.3: Debugging Tools in R
- 19.4: Using traceback()
- 19.5: Using debug()
- 19.6: Using recover()
- 19.7: Summary
- 20: Profiling R Code
- 20.1: Using system.time()
- 20.2: Timing Longer Expressions
- 20.3: The R Profiler
- 20.4: Using summaryRprof()
- 20.5: Summary
- 21: Simulation
- 21.1: Generating Random Numbers
- 21.2: Setting the random number seed
- 21.3: Simulating a Linear Model
- 21.4: Random Sampling
- 21.5: Summary
- 22: Data Analysis Case Study: Changes in Fine Particle Air Pollution in the U.S.
- 22.1: Synopsis
- 22.2: Loading and Processing the Raw Data
- 22.2.1: Reading in the 1999 data
- 22.2.2: Reading in the 2012 data
- 22.3: Results
- 22.3.1: Entire U.S. analysis
- 22.3.2: Changes in PM levels at an individual monitor
- 22.3.3: Changes in state-wide PM levels
- 23: Parallel Computation
- 23.1: Hidden Parallelism
- 23.1.1: Parallel BLAS
- 23.2: Embarrassing Parallelism
- 23.3: The Parallel Package
- 23.3.1: mclapply()
- 23.3.2: Error Handling
- 23.4: Example: Bootstrapping a Statistic
- 23.4.1: Generating Random Numbers
- 23.4.2: Using the boot package
- 23.5: Building a Socket Cluster
- 23.6: Summary
- 24: Why I Indent My Code 8 Spaces
- 25: About the Author
Instructors
Roger D. Peng is a Professor of Statistics and Data Sciences at the University of Texas, Austin. Previously, he was Professor of Biostatistics at the Johns Hopkins Bloomberg School of Public Health. His research focuses on the development of statistical methods for addressing environmental health problems and on developing tools for doing better data analysis. He is the author of the popular book R Programming for Data Science and 10 other books on data science and statistics. He is also the co-creator of the Johns Hopkins Data Science Specialization, the Simply Statistics blog where he writes about statistics for the public, the Not So Standard Deviations podcast with Hilary Parker, and The Effort Report podcast with Elizabeth Matsui. Roger is a Fellow of the American Statistical Association and is the recipient of the Mortimer Spiegelman Award from the American Public Health Association, which honors a statistician who has made outstanding contributions to public health. He can be found on Twitter and GitHub at @rdpeng.
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them