emmanuelparadis / pegas

Population and Evolutionary Genetics Analysis System
GNU General Public License v2.0
27 stars 10 forks source link

Error in .labelSegmentsHaploNet(xx, yy, altlink[s, 1:2, drop = FALSE], : argument "scale.ratio" is missing, with no default #59

Closed sheinasim closed 3 years ago

sheinasim commented 3 years ago

Howdy!

I am trying to run the following commands but get an error that I do not understand how to rectify:

co1 <- read.dna("co1.fasta", format = "fasta") co1_haps <- haplotype(co1) co1_net <- haploNet(co1_haps) ind.hap <- with(utils::stack(setNames(attr(co1_haps, "index"), rownames(co1_haps))), table(hap = ind, pop = rownames(co1)[values])) plot(co1_net, size = attr(co1_net, "freq"), scale.ratio = 0.01, cex = 0.8, pie = ind.hap, show.mutation = 2, fast = FALSE)

Error in .labelSegmentsHaploNet(xx, yy, altlink[s, 1:2, drop = FALSE], : argument "scale.ratio" is missing, with no default

Since I included scale.ratio in the plot function, I don't understand why the error indicates that it is missing.

Thanks!

emmanuelparadis commented 3 years ago

Hi, I can use the 'scale.ratio' without problem. Try this:

library(pegas)
example(rmst)
plot(tr, scale.ratio = .01)

Maybe you have an older version of pegas...

sheinasim commented 3 years ago

Hi there!

The version of pegas that was installed was the current one available on CRAN.

Oddly enough, we changed the show.mutation = 2 to show.mutation = 0 and it plotted.

Not sure why the error it was reporting was scale.ratio.

Thanks! Sheina

emmanuelparadis commented 3 years ago

I found the bug and fixed it. scale.ratio was not always well passed among internal functions. This should be OK now. The version on GH is fixed. I'm closing this issue but don't hesitate to reopen if you still have problems. Thanks for the report!