There appears to be an issue in structure_plot when the n argument is less than the total number of rows of L, and some of the groups that are supplied in the grouping argument have a very small number of samples.
The issue typically occurs here: https://github.com/stephenslab/fastTopics/blob/master/R/structure_plot.R#L256
On line 256, if the length of i is 0, the variable y will not have been created, and this will result in the error
Error in structure_plot(...) :
object 'y' not found
I think there are two ways to fix this. Either a) do some sort of "smart" sampling, where you make sure to at least sample 1 row from each group or b) keep the sampling the same but somehow work around this issue.
There appears to be an issue in
structure_plotwhen thenargument is less than the total number of rows ofL, and some of the groups that are supplied in thegroupingargument have a very small number of samples.The issue typically occurs here: https://github.com/stephenslab/fastTopics/blob/master/R/structure_plot.R#L256
On line 256, if the length of
iis 0, the variableywill not have been created, and this will result in the errorI think there are two ways to fix this. Either a) do some sort of "smart" sampling, where you make sure to at least sample 1 row from each group or b) keep the sampling the same but somehow work around this issue.