Skip to content

setDT() fails in case of nested calls #6735

@MichaelChirico

Description

@MichaelChirico

The {marginaleffects} case in #6575 is pretty hard to tease apart, but I found this example that could be related where 1.16.4 and current master differ in behavior:

baz = function(x) setDT(x)
foo = function(x) {
  bar = function() baz(x)
  x = data.frame(a=1)
  bar()
  class(x)
}
foo()

## 1.16.4
# [1] "data.table" "data.frame"

## current master
# [1] "data.frame"

From debugging of {marginaleffects} thus far, I only found that, in contrast to #6701 and #6725, {marginaleffects} (in example(comparisons) where R CMD check is failing, at least) only calls simply setDT(<name>).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions