Skip to content

Commit

Permalink
Fix a bug in collapsing data.frame (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuomasBorman authored Mar 12, 2024
1 parent 856290c commit 9ddf1d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: HoloFoodR
Type: Package
Version: 0.1.3
Version: 0.1.4
Authors@R:
c(person(given = "Tuomas", family = "Borman", role = c("aut", "cre"),
email = "[email protected]",
Expand Down
4 changes: 4 additions & 0 deletions R/getResult.R
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ getResult <- function(accession, get.metabolomic = TRUE, ...){
if( all(lengths(col) == 1) ){
col <- unlist(col)
}
# Order data based on original table where the data will be added.
# The order can be changed during the process.
ind <- match(table[["accession"]], names(col))
col <- col[ ind ]
# Add it to back to original table
table[[name]] <- col
}
Expand Down

0 comments on commit 9ddf1d3

Please sign in to comment.