The RBGL package inside the bioconductor has what you are looking for. RBGL provides an interface to the Boost library for graph analysis (C ++)
source("https://bioconductor.org/biocLite.R")
biocLite("RBGL")
library(RBGL)
library(igraph)
set.seed(1234)
g <- erdos.renyi.game(20, 1/5)
plot(g)
g <- as_graphnel(g)
boyerMyrvoldPlanarityTest(g)
g <- erdos.renyi.game(20, 1/8)
plot(g)
g <- as_graphnel(g)
boyerMyrvoldPlanarityTest(g)
Unplanar Count

Flat graph

source
share