1

我正在尝试riverplot使用R. 为此,我需要创建一个河图对象。按照这里的小插曲,这似乎很简单。不幸的是,事实并非如此。

我收到一条错误消息,但无法确定原因。任何人都可以帮忙吗?

install.packages("riverplot")
library(riverplot)

edges <- data.frame(N1=rep("SP", 8), 
                  N2=c("AL", "CVP", "EVP", "FDP", "GPS", "glp", "SVP", "SP"),
                  Value=c(77,1,1,1,20,9,1,103))

nodes <- data.frame(ID=c("SP", "AL", "CVP", "EVP", "FDP", "GPS", "glp", "SVP", "SP"),
                  x=c(1, 2,2,2,2,2,2,2,2))

r.file <- makeRiver(nodes, edges)

Error in `row.names<-.data.frame`(`*tmp*`, value = value) : 
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique value when setting 'row.names': ‘SP’ 

当然row.names(edges) <- NULLrow.names(nodes) <- NULL不要解决问题。任何人都可以帮忙吗?

谢谢。

4

0 回答 0