1

this is my first post. I've read the guidelines for posting and I will do my best to be as specific and detailed as possible.

I am using ggplot2 to draw a basketball court. I added all the straight lines using the + geom_segment() layer. My understanding is that the easiest way to add circles and circle segments is by using the geom_circle() and geom_arc() layers which can be accessed through the ggforce package, but I am having trouble loading it.

I have searched SO as well as Google for help with this, but can't find any useful info.

After successfully installing the package and then trying to load it, this is the error message I receive:

> install.packages("ggforce")
> library(ggforce)
Error: package or namespace load failed for ‘ggforce’:
 object ‘scale_type’ is not exported by 'namespace:ggplot2'

Can someone explain to me why this is happening?

Thank you.

ForceLeft415
  • 277
  • 4
  • 14
  • Welcome to SO! Have you checked [this question](https://stackoverflow.com/questions/31717850/error-package-or-namespace-load-failed-for-ggplot2-and-for-data-table)? – pogibas Aug 27 '18 at 08:32
  • Thank you for the warm welcome! That post was one I came across before posting my question. It seemed that issue had to do with ggplot2 (and Rcpp), which has been working fine for me so far. But since ggforce seems to be designed with ggplot2 in mind, maybe I'll try reinstalling ggplot2 with the dependencies argument set to TRUE. – ForceLeft415 Aug 27 '18 at 09:00
  • Try reinstalling `ggplot2` and `ggforce` with deps – pogibas Aug 27 '18 at 09:05
  • And you might also want to check out [this package](https://github.com/toddwschneider/ballr) for making shot charts – p0bs Aug 27 '18 at 09:29
  • Your suggestion worked! It must have had to do with the dependencies on the ggplot2 package. I've seen the ballr package as well I'm just trying to get some practice building some things from scratch. Thank you very much for your help. – ForceLeft415 Aug 27 '18 at 09:32

0 Answers0