You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
star_get_lhs_names<-function(star) {
## Assume that the lhs vars are right below the "Dependent variable" linedep.var.row<- which(grepl("Dependent variable", x=star))
col.numbers.row<-star[c(dep.var.row+3)]
if (!grepl("\\(1\\)", col.numbers.row))
stop("Error: `star_get_lhs_names` only works on a default stargazer regression latex table")
lhs.vars<-star[c(dep.var.row+2)] %>%
gsub("\\\\\\\\", "", x=.) %>%
sub("\\[-1.8ex\\]", "", x=.) %>%
strsplit(x=., "&") %>%
unlist(.) %>%
stringr::str_trim() %>%
.[2:length(.)]
if (length(lhs.vars) != (star_ncol(star) -1))
stop("Error: In `star_get_lhs_names`, the length of the LHS variables is not equal to `1 - star_ncol(star)`. Are you sure you are passing a default stargazer latex regression table to `star_get_lhs_names`")
return(lhs.vars)
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: