p <- ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
coord_polar()
layerGeom <- p$layers[[1L]]$geom
coordinates <- p$coordinates
build <- ggplot_build(p)
data <- build$data[[1L]]
ggplotPanelParams <- build$layout$panel_params[[1L]]
polarXY <- Cartesianxy2Polarxy(layerGeom, coordinates, data, ggplotPanelParams)
plot(polarXY$x, polarXY$y)
Run the code above in your browser using DataLab