Skip to Content
R Programming By Example
book

R Programming By Example

by Omar Trejo Navarro
December 2017
Beginner to intermediate
470 pages
12h 29m
English
Packt Publishing
Content preview from R Programming By Example

Looking at geographical data with static maps

Maps can be very useful tools to get an intuition behind geographical data. In this section, we will produce a map with the ggplot2 package. The objective is to show the location of our client's messages, the PRICE associated to their purchases, and the corresponding PROFIT_RATIO. This example will show us how to join data from the sales and client_messages data frames.

Our graph_client_messages_static() function receives as parameters the client_messages and sales data frames, and that's all it needs as we are showing unfiltered (full) datasets. First, we need to merge our two data frames using the identifier they share, which is SALE_ID. To do so we use the merge() function, and we specify that ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Efficient R Programming

Efficient R Programming

Colin Gillespie, Robin Lovelace
R Programming

R Programming

Jared P. Lander

Publisher Resources

ISBN: 9781788292542Supplemental Content