R-VCD:三元情节图例

R-VCD:三元情节图例,r,plot,legend,ternary,R,Plot,Legend,Ternary,我已使用以下代码成功创建了三元绘图: data <- read.csv(file, header=TRUE) ternaryplot(data[,3:5], scale = 100, pch = 19, cex = 0.4, col = Category, dimnames = c("Al", "Mg", "Fe + Ti"), labels = c("outside"), main = "") 这是我第一次使用vcd软件包,非常感谢您在这方面的帮助。

我已使用以下代码成功创建了三元绘图:

data <- read.csv(file, header=TRUE)
ternaryplot(data[,3:5], scale = 100, 
    pch = 19, cex = 0.4, col = Category,
    dimnames = c("Al", "Mg", "Fe + Ti"),
    labels = c("outside"),
    main = "")
这是我第一次使用vcd软件包,非常感谢您在这方面的帮助。 谢谢 霍莉

错误很明显:

 pch and labels not the same length
因此,您应该给pch一个与标签长度相同的参数,将pch替换为:

rep(19,nrow(Category))

看看我的软件包,它基于ggplot2,网站是www.ggtern.com
rep(19,nrow(Category))