R Programming Fundamentals
Deal with data using various modeling techniques
Kaelen Medeiros
BIRMINGHAM - MUMBAI
R Programming Fundamentals
Copyright 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Acquisitions Editors: Aditya Date, Bridget Neale
Content Development Editor: Madhura Bal
Production Coordinator: Ratan Pote
First published: September 2018
Production reference: 2290719
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78961-299-8
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why Subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Packt.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the Author
Kaelen Medeiros is a content quality developer at DataCamp, where she works to improve course content and tracks quality metrics across the company. She also works as a data scientist/developer for HealthLabs, who develop automated methods for analyzing large amounts of medical data. She received her MS in biostatistics from Louisiana State University Health Sciences Center in 2016. Outside of work, she has one cat, listens to way too many podcasts, and enjoys running.
Packt is Searching for Authors Like You
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
Demand for data scientists is growing exponentially and demand in the US is expected to increase by 28 percent by the year 2020, with this trend reflected across the world. R is a tool often used by data scientists to clean, examine, analyze, and report on data. It is a great starting point for those familiar with analysis in Excel or MS SQL and is an excellent place to begin to learn programming fundamentals.
This book begins by addressing the setup of R and RStudio on the machine and progresses from there, demonstrating how to import datasets, clean them, and explore their contents. It balances theory and exercises, and contains multiple open-ended activities that use real-life business scenarios for you to practice and apply your newly acquired skills in a highly relevant context. We have included over 50 practical activities and exercises across 11 topics , along with a mini project that will allow you to begin your data science project portfolio. With this book, we have created a definitive guide to beginning data science in R.
Who This Book is for
This book is for analysts who are looking to grow their data science skills beyond the tools they have used before, such as MS Excel and other statistical tools.
What This Book Covers
, Introduction to R , deals with installation of R, RStudio, and other useful packages, and talks about variable types and data structures. The chapter then introduces the different kinds of loops that can be used in R, explains how to import and export data, and also talks about getting help with R programming.
, Data Visualization and Graphics , covers the basic plots built into R and how to create them, and then introduces ggplot, a popular graphics package in R. Finally, the chapter briefly talks about two tools, Shiny and Plotly, that can be used to design interactive plots.
, Data Management , discusses how to create and manipulate factor variables, examine data using tables, apply the family of functions to generate summaries, and split, combine, merge, or join datasets in R.
The Appendix contains the solutions to all the activities within the chapters.
To Get the Most Out of This Book
You will require a computer system with at least an i3 processor, 2 GB RAM, 10 GB of s torage space, and an internet connection. Along with this, you would require the following software:
- Operating System: Windows 8 64-bit
- R and Rstudio
- Browsers (Google Chrome and Mozilla Firefox - latest versions)
Download the Example Code Files
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
- Log in or register at www.packt.com.
- Select the SUPPORT tab.
- Click on Code Downloads & Errata .
- Enter the name of the book in the Search box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR/7-Zip for Windows
- Zipeg/iZip/UnRarX for Mac
- 7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/TrainingByPackt/R-Programming-Fundamentals . In case there's an update to the code, it will be updated on the existing GitHub repository.
Next page