Skip to content

Commit 2d38b8b

Browse files
committed
calcRootC bug fix when both column types available
1 parent cd05218 commit 2d38b8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

R/CBM-tools_calcRootC.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ calcRootC <- function(aboveGroundC,
5353
aboveGroundC <- aboveGroundC[, .SD, .SDcols = AGcols]
5454

5555
# Calculate the total above ground mass of carbon
56-
if (whichCols == 1){
56+
if (whichCols[[1]] == 1){
5757

5858
aboveGroundC[, SoftwoodAG := rowSums(aboveGroundC[, .(SoftwoodMerch, SoftwoodFoliage, SoftwoodOther)])]
5959
aboveGroundC[, HardwoodAG := rowSums(aboveGroundC[, .(HardwoodMerch, HardwoodFoliage, HardwoodOther)])]

0 commit comments

Comments
 (0)