I'm trying to get the coords common to two different dataframes (nodes
and poly
)removed from the nodes
data frame. The code below works if the coordinates line up element-wise, but not otherwise.
v1 <- c(2, 2, 4)
v2 <- c(9, 2, 7)
nodes <- data.frame(v1, v2)
v3 <- c(4, 1, 2)
v4 <- c(3, 2, 2)
poly <- data.frame(v3, v4)
newnodes <- nodes[-which(nodes[,1:2] == poly[,1:2]), ]
How can I achieve this? Desired output for nodes
is:
v1 v2
2 9
4 7