Skip to content

Commit

Permalink
fix issue fdiwg#7
Browse files Browse the repository at this point in the history
  • Loading branch information
tokami committed Sep 28, 2023
1 parent 666910e commit 763336b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 8 additions & 3 deletions assets/LBM/lbi/algorithms/tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ tableLBI.inputPars <- function(lbi_dat, input, format = "datatable"){
a = input$LBI_LWa,
b = input$LBI_LWb)
ind.remove <- which(is.na(tab[1,]))
tab <- tab[,-ind.remove]
if(length(ind.remove) > 0){
tab <- tab[,-ind.remove]
}

if(format == "datatable"){
labs <- c("Bin size",
Expand Down Expand Up @@ -212,11 +214,14 @@ tableLBI.inputPars <- function(lbi_dat, input, format = "datatable"){
"a",
"b")
}
colnames(tab) <- labs[-ind.remove]

## Selection
if(length(ind.remove) > 0){
labs <- labs[-ind.remove]
}
colnames(tab) <- labs
tmp <- tab
labs <- labs[-ind.remove]


## Rounding
tmp[,which(labs != "Length unit")] <- signif(tmp[,which(labs != "Length unit")],
Expand Down
5 changes: 3 additions & 2 deletions assets/LBM/lbspr/algorithms/tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ tableLBSPR.inputPars <- function(lbspr_dat, input, format = "datatable"){
"b")
}


## Selection
if(length(ind.remove) > 0){
labs <- labs[-ind.remove]
}
tmp <- tab
labs <- labs[-ind.remove]

## Rounding
tmp[,which(labs != "Length unit")] <- signif(tmp[,which(labs != "Length unit")],
Expand Down

0 comments on commit 763336b

Please sign in to comment.