R 为什么ggplot2会给出一个空图? #哪款游戏最受欢迎(评级最高),它是否与游戏的平均复杂度有关? 图书馆(GG2) 平均复杂度
修改:R 为什么ggplot2会给出一个空图? #哪款游戏最受欢迎(评级最高),它是否与游戏的平均复杂度有关? 图书馆(GG2) 平均复杂度,r,ggplot2,data-visualization,R,Ggplot2,Data Visualization,修改: #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, Map
#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)
全文如下:
ggplot(data=board_game, Mapping = aes(x = board_game$average_complexity, y = board_game$average_rating))
。。。如果我有一美元…我想你忘了其中一个) 看看y=board_game$average_rating)的结尾,我在末尾放了两个,去掉了一个
ggplot(data=board_game, Mapping = aes(x = average_complexity, y = average_rating))
你好谢谢你的回答。它仍然显示为一个空白的图形。如果您包含一个简单的示例输入和所需的输出,可以用来测试和验证可能的解决方案,那么就更容易帮助您。如果您得到一个空白的图形,您可能会遇到数据问题(但我们无法确定看到该部分),实际上这可能只是一个类型。似乎您在
ggplot()
中包含了“+geom_point()”。要回答问题标题,ggplot2允许空绘图,以便稍后可以添加图层(点、线、条等),可能由其他用户添加。它还允许以合理的方式绘制缺失值或零观测图。
rating_complexities_graph<- ggplot(data=board_game, aes(x = average_complexity, y = average_rating)) + geom_point()
rating_complexities_graph