This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in plot_AS_segfit

Hi,

I am currently running HAPSEG v1.1.1 on R v3.4.4. There is this error:

Error in if (!is.na(loci.annot)) { : argument is of length zero

which seems to be coming from the PlotSnpAscn function. May I know what is causing this error and how to resolve it?

Thanks!

r hapseg

1 answer

Error message is clear, we have no values in loci.annot, see this example:

loci.annot <- character()

length(loci.annot)
# [1] 0

!is.na(character())
# logical(0)

if( !is.na(character()) ) { "yes" } else { "no" }
# Error in if (!is.na(character())) { : argument is of length zero

Log in to answer this question.