An Introduction to Data Visualization in R using ggplot

Make beautiful plots and graphs using the open source R programming language
3.9 (9 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
768 students enrolled
$19
$20
5% off
Take This Course
  • Lectures 39
  • Length 5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 4/2015 English

Course Description

How we represent our data is often as important as the quality of the data itself. In this course, you will learn how to make functional and elegant plots using the R language. R is a free/open source programming language that has become very popular in academia and among data scientists across all disciplines.

In this course, you will learn how to quickly make publication worthy

  • Bar plots
  • Scatter plots
  • Line plots
  • Pie charts
  • Geographical maps
  • and more...

You will also learn how to show trends over time and how to plot correlations and geographical data in this course.

This course is intended for students, professional, entrepeneurs and everyone in between.

Happy Plotting!


What are the requirements?

  • Download the latest version of R

What am I going to get from this course?

  • Prepare plots and graphs using R
  • Create colorful maps in R
  • Use the ggplot library in R to create high quality images
  • Export plots as image files and PDFs

What is the target audience?

  • Students, professionals, entrepeneurs or anyone interested in preparing enhanced graphs and plots

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction and Data/R Basics
04:15

This lecture provides you with an overview of the course.

6 pages

This lecture provides you with an overview of the course.

14 pages

Examples of plots created in this course.

10:19

This lecture provides tips on using the right chart type to visualize your data.

10 pages

This lecture provides tips on using the right chart type to visualize your data.

14:33

The lecture provides a tutorial on how to access and use data frames in R.

8 pages

The lecture provides a tutorial on how to access and use data frames in R.

14:40

This lecture shows you how to load data frames into R.

5 pages

This lecture shows you how to load data frames into R.

Course Introduction and Course Basics Quiz
5 questions
Section 2: Getting Started with ggplot
13:59

This lecture introduces you to the process of creating plots using the ggplot library.

8 pages

This lecture introduces you to the process of creating plots using the ggplot library.

12:39

This lecture introduces you to the process of creating themes for your plots using the ggplot library.

5 pages

This lecture introduces you to the process of creating themes for your plots using the ggplot library.

Section 3: Data Sets used in this Course
03:37

A quick overview of the data sets used to create the plots in this course.

4 pages

A quick overview of the data sets used to create the plots in this course.

Article

Please download this free and reusable dataset to practice your exercises.

Article

Please download this free and reusable dataset to practice your exercises.

Section 4: Bar plots in R
19:03

You will be able to create bar plots using ggplot at the end of this lecture.

8 pages

You will be able to create bar plots using ggplot at the end of this lecture.

Section 5: Pie Charts in R
16:46

You will be able to create pie graphs using ggplot at the end of this lecture.

6 pages

You will be able to create pie graphs using ggplot at the end of this lecture.

Section 6: Boxplots in R
17:24

You will be able to create box plots using ggplot at the end of this lecture.

6 pages

You will be able to create box plots using ggplot at the end of this lecture.

Section 7: Line Plots in R
15:25

You will be able to create line plots using ggplot at the end of this lecture.

6 pages

You will be able to create line plots using ggplot at the end of this lecture.

Section 8: Scatter plots in R
14:27

You will be able to create scatter plots using ggplot at the end of this lecture.

6 pages

You will be able to create scatter plots using ggplot at the end of this lecture.

Section 9: Geographical Data in R
19:37

You will be able to create maps using ggplot at the end of this lecture.

7 pages

You will be able to create maps using ggplot at the end of this lecture.

Section 10: Course Summary
Course Summary
Preview
02:38
Course Summary (Slides Only)
5 pages
Section 11: R SCRIPTS
ggplot_demo.R
Article
ggplot_themes.R
Article
bar_plots.R
Article
pie_charts.R
Article
Article

#Set directory

dir <- "C:/Udemy/"

setwd (dir)

#Load the R libraries that you need

library (ggplot2)

library (scales)

#Read in your data

my.data <- read.table ("diabetes.txt", fill = TRUE, header = TRUE, sep = "\t", stringsAsFactors=F, check.names = FALSE)

my.data <- my.data[complete.cases(my.data),]

#Set your theme

theme_set (theme_bw())

my_theme <- theme(

axis.text.x = element_text(colour = "black", size = 11),

axis.text.y = element_text (colour = "black", size = 11),

axis.title.x = element_blank(),

axis.title.y = element_text (colour = "black", size =11),

panel.grid.major = element_blank(),

panel.grid.minor = element_blank(),

#panel.border = element_blank(),

legend.position = "none"

#axis.line = element_line(size = 1, colour = "black", linetype = "solid")

)

#Make your base plot

bp <- ggplot (my.data, aes (x = gender, y = height)) + geom_boxplot() + my_theme

bp

#Add to your plot

p <- ggplot (my.data, aes (x = factor (gender), y = height, fill= gender)) + geom_boxplot(outlier.colour = "black", outlier.size = 3)+ my_theme

p

p <- p + scale_fill_manual (values = c ("red", "darkblue"))

p

p + scale_fill_brewer("Blues")

#Put points on graph

p + geom_jitter(alpha = .5, fill = "white", color = "black", shape = 21, pch = 19, size = 3)

p + ylab ("Height of Patients")

#Flip horizontal

p + coord_flip()

#Save plot as pdf or image file

out_dir <- "C:/Udemy/my.plots/"

tiff (paste (out_dir,"box_plot.tiff", sep = ""), width = 89, height = 89, units = "mm", res = 300)

p

dev.off()

pdf(paste (out_dir,"box_plot.pdf", sep = ""))

p

dev.off()

scatter_plots.R
Article
line_plots.R
Article
maps.R
Article

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Sophia Banton, Bioinformatician, Bioengineer, Biostatistician

Following the completion of my Bachelor of Science degree in Biology, my initial intent was to pursue an MSc degree in Microbiology. However while registering for classes, I stumbled across a course entitled "Bioinformatics I" that was cross-listed in the Biology, Chemistry, and Computer Science departments. My academic life and career would never be the same. I enrolled in the course and within two weeks I notified my advisor that I wanted to major in Bioinformatics. I graduated with an MSc in Bioinformatics after completing a research project entitled "A bioinformatics analysis of sex determination and sexual differentiation in vertebrates." Since my graduation, I have also completed an MSE degree in Bioengineering and I am nearing completion of a degree in Biostatistics. Professionally, I have worked as a bench scientist doing research on bacterial growth and mutations, as well as on viruses such as HCV and laboratory strains of HIV. I have also worked in parallel as a Biology instructor for several years teaching courses such as Microbiology, Human Anatomy and Physiology, and other courses in General Biology. Presently my interests are in Omics (Big Data Analysis) and Public Health. I am currently employed as a Data Analyst providing data visualization and statistical analyses at a major research university.

One of my greatest passions in life is supporting and enhancing scientific literacy among all age groups of students. I believe education is the great equalizer, and that education can take you anywhere and everywhere in life. My long-term vision is to create a non-profit organization that promotes education and literacy in my home country of Jamaica.

It is my hope that through my courses on Udemy that I am able to share my love for all things Biology and all things computing! I hope you enjoy my courses. Happy Learning!!

Ready to start learning?
Take This Course