Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
-0.01*高度中出错:R中的二进制运算符的非数字参数_R_Bar Chart - Fatal编程技术网

-0.01*高度中出错:R中的二进制运算符的非数字参数

-0.01*高度中出错:R中的二进制运算符的非数字参数,r,bar-chart,R,Bar Chart,#我试图在条形图中可视化我的数据(我刚开始使用R,所以我尝试了一些东西)。类似的语法适用于前两个图形,但是,对于这一个,我不知道问题出在哪里 s22 <- list("SUP Bottle"= 517.36, "Bottle Caps"= 10.52, "SUP Cups"= 37.96, "Tin"= 58.4, "SUP Bag"= 792.79, "Food Containe

#我试图在条形图中可视化我的数据(我刚开始使用R,所以我尝试了一些东西)。类似的语法适用于前两个图形,但是,对于这一个,我不知道问题出在哪里

s22 <- list("SUP Bottle"= 517.36, "Bottle Caps"= 10.52, "SUP Cups"= 37.96, "Tin"= 58.4, "SUP Bag"= 792.79, "Food Container"= 71.09, "Cloth"= 20.26, "Polyester bag"= 75.8, "Tetra Pack"= 11.09, "Packaging"= 347.36, "Wood"= 246.68, "Rubber"= 670, "Cardboard"= 470.73, "Iron Rod"= 344.21, "plastic pipe"= 40, "Aluminum"= 64, "lubricant bottle"= 102.17, "shoe"= 470.88)

barplot(s22, main = "Site 2.2", horiz = T, xlab = "Mass (g)", col="#69b3a2", las = 3, cex.axis = 1, las=2, cex.main = 2)

s22将列表转换为数据帧。然后运行代码

s22 <- list("SUP Bottle"= 517.36, "Bottle Caps"= 10.52, "SUP Cups"= 37.96, "Tin"= 58.4, "SUP Bag"= 792.79, "Food Container"= 71.09, "Cloth"= 20.26, "Polyester bag"= 75.8, "Tetra Pack"= 11.09, "Packaging"= 347.36, "Wood"= 246.68, "Rubber"= 670, "Cardboard"= 470.73, "Iron Rod"= 344.21, "plastic pipe"= 40, "Aluminum"= 64, "lubricant bottle"= 102.17, "shoe"= 470.88)

barplot(unlist(s22), main = "Site 2.2", horiz = T, xlab = "Mass (g)", col="#69b3a2", las = 3, cex.axis = 1, las=2, cex.main = 2)

s22将列表转换为数据帧。然后运行代码

s22 <- list("SUP Bottle"= 517.36, "Bottle Caps"= 10.52, "SUP Cups"= 37.96, "Tin"= 58.4, "SUP Bag"= 792.79, "Food Container"= 71.09, "Cloth"= 20.26, "Polyester bag"= 75.8, "Tetra Pack"= 11.09, "Packaging"= 347.36, "Wood"= 246.68, "Rubber"= 670, "Cardboard"= 470.73, "Iron Rod"= 344.21, "plastic pipe"= 40, "Aluminum"= 64, "lubricant bottle"= 102.17, "shoe"= 470.88)

barplot(unlist(s22), main = "Site 2.2", horiz = T, xlab = "Mass (g)", col="#69b3a2", las = 3, cex.axis = 1, las=2, cex.main = 2)

s22谢谢,它在一定程度上起作用了,需要自定义图形。非常感谢。谢谢,它在一定程度上起了作用,需要自定义图表。非常感谢你。