Skip to content

Commit

Permalink
Fixed an issue with structure_plot_ggplot_call() to allow for an L ma…
Browse files Browse the repository at this point in the history
…trix that does not have rows summing to 1.
  • Loading branch information
pcarbo committed Jan 29, 2025
1 parent 3328e09 commit 96446c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Encoding: UTF-8
Type: Package
Package: fastTopics
Version: 0.7-1
Version: 0.7-2
Date: 2025-01-29
Title: Fast Algorithms for Fitting Topic Models and Non-Negative
Matrix Factorizations to Count Data
Expand Down
5 changes: 4 additions & 1 deletion R/structure_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,12 @@ structure_plot_ggplot_call <- function (dat, colors, ticks = NULL,
dat <- mutate(dat,"bot" = coalesce(lag(.data$top),0))
dat <- ungroup(dat)
dat <- dat[,c("sample","topic","top","bot")]
upper <- max(dat$top)
res <- res/upper
rasterdat <- dat["sample"]
rasterdat <- crossing(rasterdat,
data.frame("y" = seq(0 + res/2,1 - res/2,by = res)))
data.frame("y" = seq(0 + res/2,upper - res/2,
by = res)))
rasterdat <- left_join(rasterdat,dat,
by = join_by("sample",x$y > y$bot,x$y < y$top))
return(ggplot(rasterdat,aes_string(x = "sample",y = "y",fill = "topic")) +
Expand Down

0 comments on commit 96446c7

Please sign in to comment.