R/fixest_nclusters.R

Defines functions fixest_nclusters

Documented in fixest_nclusters

#' @title Number of Clusters Helper Function for Fixest
#'
#' @description Helper function that will output the number of clusters
#'
#' @param est output from fixest::feols or another regression function
#'
#' @return row of number of clusters
#'
#' @import magrittr
#' @importFrom purrr map_int
#'
#' @export fixest_nclusters
#'

fixest_nclusters <- function(est) {

  est %>%
    as.list() %>%
    map_int( ~ .x$cov.scaled %>% attributes() %>% .$G)

}
jamesfeigenbaum/jjfPkg documentation built on March 31, 2022, 5:33 p.m.