Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Practical Business Intelligence

You're reading from  Practical Business Intelligence

Product type Book
Published in Dec 2016
Publisher Packt
ISBN-13 9781785885433
Pages 352 pages
Edition 1st Edition
Languages

Table of Contents (16) Chapters

Practical Business Intelligence
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Introduction to Practical Business Intelligence 2. Web Scraping 3. Analysis with Excel and Creating Interactive Maps and Charts with Power BI 4. Creating Bar Charts with D3.js 5. Forecasting with R 6. Creating Histograms and Normal Distribution Plots with Python 7. Creating a Sales Dashboard with Tableau 8. Creating an Inventory Dashboard with QlikSense 9. Data Analysis with Microsoft SQL Server

Creating graphs in R


Once a dataframe has been set up with the necessary column, we can begin to graph the data and explore visualization options.

Creating simple charts with plot() in R

The most basic graph can be generated with the plot() function using the following script:

plot(SQL_Query_1, main = 'Discount Code by Week') 

The output of the script can be seen here:

While the plot displays the discount by week, it is difficult to identify the relationship week-to-week without being able to connect the dots.

The following script will connect the dots between each sequential point:

plot(SQL_Query_1, main = 'Discount Code by Week', type="o") 

The output of the script can be seen in the following screenshot:

R has the ability to allow developers to combine multiple charts into a larger overall graph by using the par() function. If we choose to display two charts one above the other, we would create a matrix of two rows and one column by running the following script:

par(mfrow=c(2,1...
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}