Skip to content

Commit

Permalink
remove other languages and select columns in spuDist
Browse files Browse the repository at this point in the history
  • Loading branch information
camillegiuliano committed Oct 2, 2024
1 parent f853ba4 commit 63569fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/spadesCBMextraFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ spuDist <- function(mySpu, dbPath) {
}

# match mySpu with the disturbance_matrix_association table
dmid <- unique(cbmTables[[14]][which(cbmTables[[14]][, 1] %in% mySpu), c(1, 3)])
dmid <- as.data.table(unique(cbmTables[[14]][which(cbmTables[[14]][, 1] %in% mySpu), c(1, 2, 3)]))

englishTable <- as.data.table(cbmTables[[15]])
englishTable <- englishTable[locale_id <= 1,]
englishTable <- englishTable[,c(2,5)]
# add the descriptive names
spuDist <- cbind(dmid, cbmTables[[15]][dmid$disturbance_matrix_id, 5])
spuDist <- merge(dmid, englishTable, by = "disturbance_matrix_id")
spuDist <- spuDist[,c(1,3,4)]
return(spuDist)
}

Expand Down

0 comments on commit 63569fa

Please sign in to comment.