Skip to content

Commit

Permalink
add: select only colums 1:2 of the refit table
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-plutniak committed Feb 12, 2024
1 parent c8baea8 commit db332bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/do_refits_preprocessing.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.do_refits_preprocessing <- function(refits, dataset){

# remove duplicated refits if any:
refits <- refits[! duplicated(t(apply(refits[c(1, 2), ], 1, sort))), ]

# refitting data for 2D plots:
refits.2d <- refits
refits.2d <- refits[, 1:2]
colnames(refits.2d) <- c("from", "to")
dataset <- dataset[, c("id", "x", "y", "z")]

refits.2d <- merge( refits.2d, dataset,
refits.2d <- merge(refits.2d, dataset,
by.x = "from", by.y="id", sort = FALSE, all.x = T)
refits.2d <- merge( refits.2d, dataset,
by.x = "to", by.y="id", sort = FALSE, all.x = T)
Expand Down

0 comments on commit db332bc

Please sign in to comment.