Skip to content

triangulating a pslg with attributes #17

@roth-mh

Description

@roth-mh

when I am triangulating a pslg object with attributes, the triangulate function seems to (kind of) transpose the attribute matrix.
in the example below i would expect PA to stay the same from the pslg object to the DT object. Am I misunderstanding the intended functionality?

sp_pts <- as.data.frame(matrix(nrow=4,ncol = 2))
colnames(sp_pts) <- c("latitude", "longitude")
sp_pts$latitude <- c(41,42,43,44)
sp_pts$longitude <- c(-120,-121,-122,-123)

att <- as.data.frame(matrix(nrow=4,ncol = 3))
colnames(att) <- c("att1", "att2", "att3")
att$att1 <- c(1, 1.1, 1.11, 1.111)
att$att2 <- c(2, 2.2, 2.22, 2.222)
att$att3 <- c(3, 3.3, 3.33, 3.333)

att
p <- pslg(P = sp_pts, PA = att)
p$PA[1,]

DT <- RTriangle::triangulate(p)
DT$PA[1,]

p$PA
DT$PA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions