Skip to content

Error: 'legend' is of length 0 #18

Open

Description

@Adonyo-Emmanuel

When generating a plot to assess the type of relationship in the sample, I do get an R script erro.
$ Rscript --no-save Relatedness.R
Error in legend(1, 1, xjust = 1, yjust = 1, legend = levels(relatedness$RT), :
'legend' is of length 0
Execution halted.

What might be the problem?

Activity

  1. gc-content commented on Jun 9, 2022

    @gc-content

    In Relatedness.R change line:
    relatedness = read.table("pihat_min0.2.genome", header=T)

    to:
    relatedness = read.table("pihat_min0.2.genome", header=T, stringsAsFactors = T)

  2. mpage21 commented on Sep 9, 2022

    @mpage21

    Additionally, on the legend line you could change levels(relatedness$RT) to unique(relatedness$RT)

  3. YachengPan commented on Sep 4, 2023

    @YachengPan

    In Relatedness.R change line: relatedness = read.table("pihat_min0.2.genome", header=T)

    to: relatedness = read.table("pihat_min0.2.genome", header=T, stringsAsFactors = T)
    Nice! It really works! Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions