Navigating geographical data with interactive maps
We can navigate the geographical data with the help of interactive maps, which are explained in the following sections.
Maps you can navigate and zoom-in to
In this final section, we will create interactive maps that we can navigate. This is a very powerful tool that can be embedded in your R projects, greatly increasing their value and impact on your audience. We will use the leaflet
package to develop this map. Our objective is to show a map with the locations of the messages we receive from our clients with icons that represent the type of rating we got using the STARS
variable of the message and tooltips that show the PROFIT
associated to the corresponding purchase of each message.
Our graph_client_messages_interactive()
function receives the client_messages
and sales
data frames. As in the previous map, we will show all data without any filters, so that's all we need as parameters. The first thing we do, as we did earlier, is merge the...