Skip to content

traceback() for no applicable method for 'depth' applied to an object of class "NULL" #3538

Closed
@joethorley

Description

@joethorley

This error has been reported previously (in issue #2514) where @hadley wrote.

Unfortunately there's not much I can do without a reprex. If you see it again, at least try capturing a traceback() and filing a new issue.

Originally posted by @hadley in #2514 (comment)

It frequently but unpredictably occurs when printing ggplot objects by sourcing a script.
As it's unpredictable I'm not able to provide a reprex however I am providing a traceback() as suggested.

Error in UseMethod("depth") : 
  no applicable method for 'depth' applied to an object of class "NULL"
In addition: There were 13 warnings (use warnings() to see them)
> traceback()
16: depth(path)
15: upViewport(depth(vp), recording = FALSE)
14: popgrobvp.viewport(x$vp)
13: popgrobvp(x$vp)
12: postDraw.grob(x)
11: postDraw(x)
10: drawGTree(x)
9: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
8: grid.draw.gTree(gtable)
7: grid.draw(gtable)
6: print.ggplot(gp)
5: print(gp) at predict-abundance.R#138
4: eval(ei, envir)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("predict-abundance.R")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions