Skip to content

Commit

Permalink
fix missing attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
grantmcdermott committed Jan 17, 2025
1 parent 100822b commit c1a0ec6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ License: GPL-3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
URL: https://grantmcdermott.com/ggfixest/
BugReports: https://github.com/grantmcdermott/ggfixest/issues
Depends:
Expand Down
12 changes: 4 additions & 8 deletions R/aggr_es.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#' # Default hypothesis test is a null mean post-treatment effect
#' (post_mean = aggr_es(est))
#' # The underlying hypothesis is saved as an attribute
#' attributes(post_mean)["hypothesis"]
#' attr(post_mean, "hypothesis")
#'
#' # Other hypothesis and aggregation options
#' aggr_es(est, aggregation = "cumulative") # cumulative instead of mean effects
Expand Down Expand Up @@ -113,14 +113,10 @@ aggr_es = function(object,
return(ret)
}
)
## Bind together and capture/re-assign and the hypothesis attribute (again,
## mostly for the "both" case)
hyp_attr = sapply(res, function(x) {attributes(x)["hypothesis"]})
## Bind together and capture/re-assign and the hypothesis attribute
hyp_attr = sapply(res, function(x) attr(x, "hypothesis"))
res = do.call("rbind", res)
row.names(res) = NULL
if (!is.numeric(period) && period == "both") {
attributes(res) = utils::modifyList(attributes(res), hyp_attr)
attributes(res)["hypothesis"] = NULL
}
if (!is.numeric(period)) attr(res, "hypothesis") = hyp_attr
return(res)
}
2 changes: 1 addition & 1 deletion man/aggr_es.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c1a0ec6

Please sign in to comment.