Skip to content

Consider avoiding overwrite of package function environment #77

@MichaelChirico

Description

@MichaelChirico

environment(med.fun) <- environment()

This looks nice & convenient for not worrying about which objects inside mediate() can be referred by med.fun(), but has the negative side-effect that it's not possible to attach a debugger to med.fun():

debugonce(mediation:::med.fun)
mediate(...) # won't debug med.fun!

The workaround would be to add the debug() call inside mediate(), after the environment<- step, which requires re-building the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions