Skip to content

Minor bug: ^ causes trouble in terms.formula #4

@karldw

Description

@karldw

I noticed that using ^ can cause issues with formula parsing. Here's the case I tripped over, with stats::terms.formula called indirectly by fixest::r2. I think this is a bug, though let me know if I'm misinterpreting.

library(fixest)

gravity_results <- feglm(
  Euros ~ log(dist_km) | Origin ^ Destination + Product ^ Year, 
  data=trade
)
r2(gravity_results)
#> Error in terms.formula(tmp, simplify = TRUE): invalid power in formula

Created on 2019-11-22 by the reprex package (v0.3.0)

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