R (3) Introduction to Graphics. The main guide R in Action Data Analysis and Graphics with R Robert I. Kabacoff

Slides:



Advertisements
Similar presentations
2D Plots 1 ENGR 1181 MATLAB 12.
Advertisements

Introduction to R Graphics
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Graphics in R data analysis and visualization Katia Oleinik Scientific Computing and Visualization Boston University
Excel 2007 Graphs & Charts. TYPES OF CHARTS Column Bar Pie Line.
Exemples instructifs… Représentations graphiques.
Customizing Graphs Base graphics options. plot() The workhorse plotting function plot(x) plots values of x in sequence or a barplot plot(x, y) produces.
Evan Girvetz Winkenwerder Introduction to Graphics in R © R Foundation, from
6601 Project---Graphics --Enhancing Plots --Fine Control of Graphics Xingyan Bai, Qian Zhang, Ying Li.
EXCEL PART 2. Chart Elements Chart Title Plot Area Data Marker X AxesCategory Name Y axes.
Use intercepts to graph an equation
Baburao Kamble (Ph.D) University of Nebraska-Lincoln Data Analysis Using R Week5: Charts/Plots in R.
Excel Lesson 10 Using Advanced Chart Features Microsoft Office 2010 Advanced Cable / Morrison 1.
An Introduction to R graphics Elizabeth Garrett-Mayer Slides borrowed from Cody Chiuzan & Delia Voronca March 24, 2014.
Graphics in R. X
R Graphics Lori Shepherd-Kirchgraber May 22, 2012.
Chart Components 4.02 Understand charts and graphs used in business.
R-Graphics Day 2 Stephen Opiyo. Basic Graphs One of the main reasons data analysts turn to R is for its strong graphic capabilities. R generates publication-ready.
Creating Graphs in R Graphing techniques Sharon style! (I am not sure if this is a good or bad thing but this is what I do...)
An Introduction to R graphics Cody Chiuzan Division of Biostatistics and Epidemiology Computing for Research I, 2012.
Climographs Climate is what we expect, weather is what we get… Mark Twain What is Mark Twain saying in this quote? – Discuss with your partner, provide.
Spreadsheet Charts Vocabulary Reference – pp. IE123-IE127 in Office 2000 Textbook Do not login. You will need a writing utensil.
Learn R Toolkit D Kelly O'DayBox, Dot, Histogram, Strip Charts Mod 5 –Box Charts: 1 Module 5 Box, Dot, Histogram, Strip Charts Do See & HearRead Learn.
SOLUTION STEP 1 Use intercepts to graph an equation EXAMPLE 2 Graph the equation x + 2y = 4. x + 2y = 4 x =  x- intercept 4 Find the intercepts. x + 2(0)
R-Graphics Stephen Opiyo. Basic Graphs One of the main reasons data analysts turn to R is for its strong graphic capabilities. R generates publication-ready.
UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao.
Plotting Complex Figures Using R
CHART COMPONENTS Lesson 6 – Working With Charts and Graphics, continued.
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
Details on Kalman Filter and Smoothing Code for Chapter 6 In astsa, there are three levels (0,1,2) of filtering and smoothing, Kfilter0/Ksmooth0,
XY Plots. You can launch Gtplot from GSS to create XY plots, time series graphs, Piper and Stiff Diagrams, and more. Graphs → XY Plot You can set the.
Introduction to MATLAB ENGR 1181 MATLAB 1. MATLAB Built-in Math Functions  Pre-defined in MATLAB ready for use exp(x) – exponential (e x ) log(x) – natural.
S-PLUS Lecture 6 Jaeyong Lee. Graphical Parameters type = “c”: c =p (default), l, b,s,o,h,n. pch=“+” : character or numbers 1 – 18 lty=1 : numbers lwd=2.
Tables and Figures AGED 520V. Tables and Figures Tables Tables are for complex data –To display data for detailed analysis –To remove long strings of.
Making a Graph for Science Class.. Purpose of a graph To visually display information or data collected during an experiment. Create a “snapshot” of the.
Introduction to plotting data Fish 552: Lecture 4.
R 그래픽스 5 : R을 이용한 도형그리기 (1) 원(circle) 그리기
EXCEL LESSON 12 CREATING CHARTS VOCABULARY. AXIS A line bordering the chart plot area used as a frame of reference for measurement.
CHART COMPONENTS Lesson 6 – Working With Charts and Graphics, continued.
 Line Graphs: are used to show something changing over time.  Bar Graphs: are used to show a comparison between two or more variables.  Pie Chart:
Chart Components 3.03 Identify charts and graphs used in business.
Review > mean(humidity, na.rm=T) > humidity[!is.na(humidity)] > X x Y Y[[1]][2,3] > zone.fac
Review > plot(x=primates$Bodywt, y=primates$Brainwt, xlim=c(0,300), ylim=c(0,1400), cex=2, pch=21, col="black", bg="salmon", xlab = "Body weight (kg)",
Trevor A. Branch FISH 552 Introduction to R
Presentation SUBJECT NAME & FUNCTION OF SPEAKER MONTH / YEAR.
Example 13 Wendy Balmer Indiana U
Assignment #12 “Off the chart!”
8.04 Spreadsheet Charts 8.04 Spreadsheet Charts.
مناهــــج البحث العلمي
TITLE TITLE TITLE TITLE
Graphing Notes.
Title of the presentation
Chart Components Lesson 6 – Working With Charts and Graphics, continued 4.02 Chart Components.
Chart Components Lesson 6 – Working With Charts and Graphics, continued 4.02 Chart Components.
Edit this text to create a title slide
Chart Components Lesson 6 – Working With Charts and Graphics, continued 4.02 Chart Components.
PRESENTATION TITLE (capital, bold, calibri light, 32)
Presentation Title SUBTITLE description LOGO.
Title Introduction: Discussion & Conclusion: Methods & Results:
Introduction to R plot Instructor: Li, Han
[Please type your poster title in white font]
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
TİTLE SUBTİTLE.
Presentation transcript:

R (3) Introduction to Graphics

The main guide R in Action Data Analysis and Graphics with R Robert I. Kabacoff

Simple plot Evolution of daily sales in August 2011 (data imported from Pg) > plot(daily_sales_2011_8$day, + daily_sales_2011_8$sales, type="b")

Parameters for symbols and lines

Plot with symbol and line Evolution of daily sales in August 2011 (data imported from Pg) > plot(daily_sales_2011_8$day, + daily_sales_2011_8$sales, + type="b", + lty=2, + pch=17)

Plot with symbol,line and different symbol size Evolution of daily sales in August 2011 (data imported from Pg) > plot(daily_sales_2011_8$day, + daily_sales_2011_8$sales, + type="b", + lty=2, + pch=17, + cex =.5)

Parameters for color

Plot with colour > plot(daily_sales_2011_8$day, + daily_sales_2011_8$sales, + type="b", + lty=2, + pch=17, + cex =.5, + col="brown", + col.axis= + "green", + col.lab= + "red", + fg="blue", + bg="yellow")

Parameters for text s& dimensions/margins

Parameters for text & dimensions/margins

Change axes limits > plot(daily_sales_2011_8$day,daily_sales_2011_8$sales/ , xlim=c(min(daily_sales_2011_8$day), + max(daily_sales_2011_8$day)), ylim=c(0, + max(daily_sales_2011_8$sales/1000)+1000), + type="b", + cex =.5, + col="red", + lty=2, + pch=2, + lwd=2)

Titles (1) Types of titles – Main title of the graphic ( main ) – Sub-title of the graphic ( sub ) – Title of the axis x and y ( xlab and ylab ) > title(main="main title", + sub="sub-title", + xlab="x-axis label", + ylab="y-axis label")

Titles (2) > plot(dday, sales/1000, main= "Daily Sales in + August 2011", sub="Data imported from + PostgreSQL", xlab="Day (of the month)", + ylab="Sales (thousands)", + type="b", + cex =.5, + col="red", + lty=2, + pch=2, + lwd=2)

Legend (1) > attach(daily_sales_2011_8) > plot(day, sales/1000, main="Daily Sales - Aug. vs. Sept. 2011", sub="Data imported from PostgreSQL", xlab="Day (of the month)", ylab="Sales(thousands)", type="b", cex = 1.25, col="red", lty=1, pch=2, lwd=1.5) > detach(daily_sales_2011_8) > attach(daily_sales_2011_9) > # to display on the same graphic, use lines, not plot > lines(day, sales/1000, col="black", lty=2, + pch=17, lwd=2) # now the legend legend("bottomright", inset=.05, title="Month", + c("Aug","Sept"), + lty=c(1, 2), pch=c(2, 17), col=c("red", "black"))

Legend (2)