This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sg_or <- function(mod){ | |
OR <- lapply(mod, function(x) as.data.frame(questionr::odds.ratio(x))) | |
re <- list( | |
or = lapply(OR, `[[`, "OR"), | |
ci = lapply(OR, `[`, 2:3), | |
p = lapply(OR, `[[`, "p") | |
) | |
return(re) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# proposed this as an answer here: http://stackoverflow.com/a/35444147/4132844 | |
from pandocfilters import toJSONFilter, RawInline | |
def comments(k, v, f, meta): | |
if k == 'Str' and v in ['%TC:ignore','%TC:endignore']: | |
return RawInline('latex', v) | |
if __name__ == "__main__": | |
toJSONFilter(comments) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pandocfilters import toJSONFilter, Header | |
# proposed as an answer here http://stackoverflow.com/a/35341506/4132844 | |
def header_increase(key, value, format, meta): | |
if key == 'Header' and value[0] < 7: | |
value[0] = value[0] + 1 | |
return Header(value[0], value[1], value[2]) | |
if __name__ == "__main__": |