我想在R中的plot_ly()周围编写一个自定义函数。这样,我可以使用一系列散点图相同的格式和样式,但不重复的代码。 I used this page as a guide.此代码再现错误: library(plotly)
my_plot <- function(x, y, ...) {
require(broom)
plot_ly(data = mtcars, y =
我使用栅格包中的getData函数来检索阿根廷的地图。我想使用ggplot2绘制生成的地图,所以我使用扫帚包中的整洁函数转换为数据框。这工作正常,但我不知道如何保留联邦区的名称,以便我可以在地图上使用它们。 这里是我的原代码,不保留地区名称: # Original code: ##################################
# get the map data from G
我在尝试对排列进行分层时遇到问题。 我的数据是这样的: gender party value
1 F Democrat 762
2 M Democrat 484
3 F Independent 327
4 M Independent 239
5 F Republican 468
6 M Republican 477
什么,我只是试图做的是party librar