Skip to content

Commit

Permalink
NMF coef
Browse files Browse the repository at this point in the history
  • Loading branch information
noriakis committed Oct 22, 2024
1 parent bda8901 commit d01dcbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/NMF.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ NMF <- function(stana, species, rank=3, target="kos", seed=53, method="snmf/r",
} else {
res <- NMF::nmf(mat, rank = rank, seed = seed, method=method)
}
coefMat <- coef(res)
basisMat <- NMF::basis(res)
coefMat <- NMF::coef(res)
basisMat <- NMF::basis(res)
}

print(res)
stana@coefMat[[species]] <- data.frame(coefMat)
## Plot by default
relab <- apply(coefMat, 2, function(x) x / sum(x))
Expand Down

0 comments on commit d01dcbe

Please sign in to comment.