Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning R Programming

You're reading from  Learning R Programming

Product type Book
Published in Oct 2016
Publisher Packt
ISBN-13 9781785889776
Pages 582 pages
Edition 1st Edition
Languages
Author (1):
Kun Ren Kun Ren
Profile icon Kun Ren

Table of Contents (21) Chapters

Learning R Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Quick Start 2. Basic Objects 3. Managing Your Workspace 4. Basic Expressions 5. Working with Basic Objects 6. Working with Strings 7. Working with Data 8. Inside R 9. Metaprogramming 10. Object-Oriented Programming 11. Working with Databases 12. Data Manipulation 13. High-Performance Computing 14. Web Scraping 15. Boosting Productivity

Using built-in functions to manipulate data frames


Previously, you learned the basics of data frames. Here, we will review the built-in functions used to filter a data frame. Although a data frame is essentially a list of vectors, we can access it like a matrix since all column vectors are of the same length. To select rows that meet certain conditions, we will supply a logical vector as the first argument of [], while the second is left empty.

In R, these operations can be done with built-in functions. In this section, we will introduce some built-in functions that are most helpful to manipulate data into the form we need as model input or for presentation. Some of the functions or techniques are already presented in the previous chapters.

Most of the code in this section and subsequent sections are based on a group of fictitious data about some products. We will use the readr package to load the data for better handling of column types. If you don't have this package installed, run install...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}