1
#which game is the most popular (highest rating) and does it has to do with the average complexities of the game?
library(ggplot2)
average_complexities <- board_game$average_complexity
rating_complexities_graph<- ggplot(data=board_game, Mapping = aes(x = board_game$average_complexity, y = board_game$average_rating) + geom_point())
print(rating_complexities_graph)

Hey everyone, I am quite new to R and tried to do this project of analyzing board_game. I was really curious which part did I make a mistake that causes a completely blank graph. Any help will be appreciated!

harperzhu
  • 49
  • 7
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. If you get a blank graph, you probably have an issue with the data (but we can't see that part to know for sure) – MrFlick Oct 23 '20 at 04:49
  • Actually this is probably just a type. Seems like you have ` + geom_point()` inside `ggplot()` when it should come afterward. – MrFlick Oct 23 '20 at 04:50
  • To answer the question title, ggplot2 allows empty plots so that layers (points, lines, bars, etc) can be added later, possibly by other users. It also allows for missing values or nil-observation plots to be plotted in a sensible ways. – Hugh Oct 24 '20 at 00:15

2 Answers2

2

modify:

 ggplot(data=board_game, Mapping = aes(x = board_game$average_complexity, y = board_game$average_rating)) 

to read:

 ggplot(data=board_game, Mapping = aes(x = average_complexity, y = average_rating))

... if I had a dollar...

UseR10085
  • 7,120
  • 3
  • 24
  • 54
evidently
  • 43
  • 4
0

I think you forgot one of these )

look at the end of y = board_game$average_rating)) i put two and I removed one at the end

rating_complexities_graph<- ggplot(data=board_game, aes(x = average_complexity, y = average_rating)) + geom_point()

also, I don't think you want the print command. Just call the variable you created

rating_complexities_graph
hachiko
  • 671
  • 7
  • 20