Closed romainfrancois closed 4 years ago
This uses as.tbl_cube() from cubelyr and relaxes a test, because in this function:
as.tbl_cube()
cubelyr
tidy.gls <- function(x, conf.int = FALSE, conf.level = 0.95, ...) { . <- Value <- Std.Error <- `t-value` <- `p-value` <- NULL ## glob var checks ret <- (summary(x)[["tTable"]] %>% as.data.frame() ## have to convert to df *first* %>% tibble::rownames_to_column(var = "term") %>% as_tibble() %>% dplyr::rename( estimate = Value, std.error = Std.Error, statistic = `t-value`, p.value = `p-value` ) ) if (conf.int) { cc <- (confint(x, level=conf.level) %>% as.data.frame() %>% setNames(c("conf.low","conf.high")) ) ret <- dplyr::bind_cols(ret,cc) } return(ret) }
ret inherits the row.names from cc, alternatively, this could be
ret
cc
row.names(cc) <- NULL
This uses
as.tbl_cube()
fromcubelyr
and relaxes a test, because in this function:ret
inherits the row.names fromcc
, alternatively, this could be