2
我正嘗試使用gvisTreeMap創建樹圖。但我收到一個錯誤: 「gvisCheckTreeMapData(data,my.options)中的錯誤: parentvar和idvar不合適。」 我對R很新。任何人都可以知道如何去除錯誤並使其工作?RStudio TreeMap-Idvar不匹配Parentvar
require(googleVis)
Gender = c("All", "All", "All", "All")
Beverage = c("Tea", "Soft", "Wine", "Water")
Under_50 = c(5, 10, 15, 50)
Up = c(10, 40, 70, 80)
df = data.frame(Beverage, Gender, Under_50, Up)
View(df)
Tree <- gvisTreeMap(df,
idvar= "Beverage", parentvar = "Gender",
sizevar = "Under_50", colorvar = "Up",
options=list(showScale=TRUE))
謝謝
德拉