Map with connecting lines

Super User
12932 Views
Super User
Super User

Map with connecting lines

Description

This visual uses Maps package and Geosphere package to draw a map of Australia and dots on that map finally connecting them with lines. Using sample migration statistics data from different cities within Australia to the city of Melbourne, R visual shows the trend of migration by color coding the lines and shading higher count cities on top of the lower ones.

 

Prerequisites (The sample .pbix files won't work without installing the following)

1. Install R Engine

Power BI does not include the R engine.  Therefore, a seperate installation is required to install R on your local computer.  

  

Required R Packages

Maps

Geosphere

 

Tested on

MRO 3.3.1, CRAN 3.3.1

Power BI Team Sharon
Power BI Team

Re: Map with connecting lines

this is so cool Ankit!

Moderator boefraty
Moderator

Re: Map with connecting lines

Hi Ankit,

 

This visual is very impressive. If you consider to convert this or some of your other R-visuals to R-powered-custom visuals, out team will be happy to assist you. 

 

The visibility of R-powered custom visuals is greater and it is not limited for R-users. 

paul_turley Frequent Visitor
Frequent Visitor

Re: Map with connecting lines

To get this R visual script to work, users will need to add the following commands before the two libray function calls:

install.packages("maps")
install.packages("geosphere")

JoseMiguelPR Visitor
Visitor

Re: Map with connecting lines

Hi Ankitpatira,

 

thanks for the visual. Really great one.

 

 

Hi Paul,

Can we install these packages before even having R installed? and sorry for the question but... how do we install packages?

 

 

thanks for your help

/Jose Miguel

Moderator boefraty
Moderator

Re: Map with connecting lines

Hi @JoseMiguelPR

You need R engine installed to run R in Power BI. You can use any R IDE (like RStudio) to install packages 

See more here: 
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-r-scripts/

 

gurukpm Frequent Visitor
Frequent Visitor

Re: Map with connecting lines

Could you please include the files used in R Get Data Script.

 

Cities.csv, migrations.csv

gurukpm Frequent Visitor
Frequent Visitor

Re: Map with connecting lines

Could you also add the Get Data R Script support files (Cities.csv, migrations.csv).