You are here

Easy R

Easy R
Access, Prepare, Visualize, Explore Data, and Write Papers

January 2020 | 200 pages | SAGE Publications, Inc
This book is built on the premise that anyone can learn to use the R software. The authors emphasize using R to do useful things like writing papers and reports, creating data and graphs, accessing datasets collected by others, preparing data, and conducting simple data analysis. After a first chapter on installing the software and project setup, the second chapter shows how to write an essay using R Markdown, rewarding readers with an immediate tangible result, and taking the fear out of working with a new software. After walking readers step by step through data creation, visualization, preparation, access, and exploration across the next four chapters, the book ends on a high note of writing an empirical research paper in R. Student-friendly language and examples (e.g. binge-watched shows on Netflix, top 5 songs on Spotify), cumulative learning and repetition across chapters, and practice exercises make this a must-have guide for a variety of courses where data is used and reports need to be written (including, but not limited to intro statistics and research methods). Code and datasets used to carry out the examples in the book are available on an accompanying website.
Why should you learn R, too?

Who should read this book? What do we hope to achieve?

What is in this book? How do yo use it?

What is unique about this book?

Chapter 1: Making Preparations: Software Installation and Project Setup

How to download and install R for Windows

How to download and install R for Mac

Download and install RStudio

Set up a project in RStudio

Create folders under project


Chapter 2: Writing an Essay Using R Markdown: Something for Everyone

The pros of using R Markdown

How to create an R Markdown file

How to write and format text in R Markdown

A simple example of an R Markdown document

Other useful formatting tricks

How to use R Markdown for a writing example: A bare bones example

How to revise and improve the bare bones essay

For more ambitious readers

Exercise: Turning knowledge into results


Chapter 3: Creating Data and Graphs in Reports

Bar plot: Graphing the winners of a hot dog eating contest

Bar plot II: Graphing the winning lottery numbers in Texas Pick-3

Pie chart: Graphing the composition of daily plays among Top 5 songs on Spotify

Histogram: Graphing the distribution of LSAT scores in a review class

Scatter Plot: Graphing the relationship between two variables - gas mileages in city and on highway

Time-series plot: Graphing the changing pattern of Youtube video news.

Useful tips: Polishing and exporting graphs


Chapter 4: Preparing Your Data

Writing and running a program in R

Creating your variables and dataset

Manipulating your data using the dplyr package

Rename a variable

Chaining different data manipulation operations

Missing value in R: NA


Chapter 5: Accessing Datasets

Setting up RStudio project

Downloading dataset

Installing R packages for data importing

Importing downloaded dataset in RStudio

Using R data packages: A simple example with gapminder

Using R data packages: A more advanced example with wbstats

Using R data packages: Finding more R data packages

Where do you find more data?


Chapter 6: Exploratory Data Analysis: Three Exercises

Exercise 1: Reporting results of 2016 presidential primary in King County, Washington

Exercise 2: Human use of natural resources: Consumption and biocapacity

Exercise 3: Exploring the impact of GDP per capita on life expectancy


Chapter 7: Writing a Research Paper Using R: Analyzing the Effect of Economic Development on Life Expectancy

Arguments and Hypothesis

Data and Method



Appendix: Summary Statistics and Codebook


Preview this book

Elizabeth Ann Gohmert

Elizabeth Gohmert graduated from Texas A&M University in 2018 with a Bachelor of Arts in Political Scienceand a minor in Cybersecurity—a year early. She then went on to graduate school at Southern MethodistUniversity, from which she graduated with a Master of Science in Business Analytics in 2019. While shehad previously helped to edit the book, “Using R for Data Analysis in Social Sciences”, this will be her firstauthored publication. Aside from her love of data science, she enjoys travelling, learning new languages,white water rafting, and the joy of finding great new rib places. She currently lives and works in Washington,D.C. as a... More About Author

Quan L. Li

Dr. Quan Li is Professor of Political Science and Cornerstone Faculty Fellow at Texas A&M University anda Fulbright U.S. Senior Scholar in Spain during the 2019-2020 academic year. His research on economicglobalization, democratic governance, political violence, and environmental degradation has appeared invarious journals in international relations, international business, political science, and public policy. Hecoauthored Democracy and Economic Openness in an Interconnected System: Complex Transformations(Cambridge University Press, 2009) and Politics and Foreign Direct Investment (University of Michigan Press,2012). He is also the... More About Author

Douglas Reynolds Wise

Douglas Wise is a Solution Engineer at a Silicon Valley based technology company where he specializesin helping organizations transform their digital customer experiences. Douglas previously served as anintelligence analyst in the United States Air Force. Douglas was also a member of the Air Force Honor Guardand is an Afghanistan war veteran. Douglas received his Bachelor of Science in Political Science from TexasA&M University and currently resides in Santa Clara, California with his family. More About Author

Purchasing options

Please select a format:

ISBN: 9781544379418