Skip to content

Instantly share code, notes, and snippets.

View jmbarbone's full-sized avatar

Jordan Mark Barbone jmbarbone

View GitHub Profile
@jmclawson
jmclawson / collapse_rows.R
Last active September 4, 2023 16:19
something like "collapse rows" for gt
collapse_rows <- function(df_g, col, lookleft = TRUE){
col_num <- grep(deparse(substitute(col)), colnames(df_g$`_data`))
collapse_style <- css(visibility = "hidden",
border_top = "0px")
test_rows <- function(x) ifelse(is.na(x == lag(x)), FALSE, x == lag(x))
if(col_num > 1 & lookleft) {
col_left <- as.name(colnames(df_g$`_data`)[col_num - 1])
@moodymudskipper
moodymudskipper / subset_to_end.R
Created December 18, 2021 18:40
subset to end
`[` <- function(x, ...) {
base::`[`(x, ...)
}
makeActiveBinding(".I", function() {
sc <- sys.calls()
fr <- which(vapply(sc, \(x) capture.output(x)[1], character(1)) == "base::`[`(x, ...)")
fr <- fr[length(fr)]
sf <- sys.frames()[[fr-1]]
x <- eval(quote(x), sf)
@ellisvalentiner
ellisvalentiner / bitbucket-pipelines.yml
Created October 12, 2016 21:04
yaml to build R package for bitbucket pipelines continuous integration
image: rocker/hadleyverse:latest
pipelines:
default:
- step:
script:
- cd /opt/atlassian/pipelines/agent/build
- Rscript -e 'devtools::install_deps(".", dependencies=TRUE, upgrade=FALSE)'
- Rscript -e 'devtools::build()'
- Rscript -e 'devtools::install(upgrade_dependencies = FALSE)'