O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Force Atlas 2

Force Atlas 2 is another algorithm in the set of force-directed algorithms and it attempts to resolve the shortcomings of the Force algorithm by making a balance between the quality of the final layout and the speed of the computation algorithm. Its performance for large networks is much better when compared to the Force Atlas layout algorithm.

The speedup that is achieved in Force Atlas 2 is primarily due to the replacement of direct sum simulation used in Force Atlas with Barnes-Hut simulation.

Install and load the following package:

> install.packages("devtools") > library(devtools)> devtools::install_github("analyxcompany/ForceAtlas2")> library(ForceAtlas2)

Next, define Force Atlas 2 layout with the number of iteration attribute ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required