plot(1:10)
This file contains 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
# dummy functions ---- | |
f <- function() { | |
testthat::expect_is(data.frame(),'data.frame') | |
} | |
f1 <- function() { | |
testthat::expect_is(data.frame(),'list') | |
} |
This file contains 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
burrow_find <- function(x,parent,regex = FALSE){ | |
if(grepl('(\\[|\\])',parent)){ | |
nx <- as.numeric(gsub('(\\[|\\])','',parent)) | |
}else{ | |
if(regex){ | |
nx <- grep(parent,names(x)) |
This file contains 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
remotes_patch <- function(destdir=getwd()){ | |
#patch install_remote | |
install_remote_keep_source <- remotes:::install_remote | |
install_remote_body <- body(install_remote_keep_source) | |
install_remote_body[[6]] <- quote(on.exit({ | |
l <- list(...) | |
devtools::build(source,path = eval(enquote(l$destdir))) | |
unlink(source, recursive = TRUE) | |
}, add = TRUE)) |
This file contains 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
license: mit | |
height: 600 |
This file contains 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
library(RSelenium) | |
library(XML) | |
library(ggplot2) | |
library(reshape2) | |
library(plyr) | |
library(dplyr) | |
gh_user <- '<your github login name>' | |
gh_pass <- '<your github login password>' |
This file contains 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
#' @title Annotation: tick marks | |
#' @description This annotation adds tick marks to an axis | |
#' @export | |
#' @inheritParams ggplot2::annotation_logticks | |
#' @param ticks_per_base integer, number of minor ticks between each pair of major ticks, Default: base-1 | |
#' @param delog boolean, if an idenity transformation is needed use set to TRUE, Default: FALSE | |
#' @examples | |
#' library(ggplot2) | |
#' library(grid) | |
#' |
This file contains 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
library(ggraph) | |
library(dplyr) | |
library(d3Tree) | |
scales2df<-function(pkg){ | |
d<-ls(name = sprintf('package:%s',pkg),pattern = '^scale_(.*?)_(.*?)$') | |
d1<-sapply(d,function(x){grep('_scale|scale_',as.list(body(x)),value=TRUE)}) | |
d.fun<-sapply(d1,function(a) gsub('sc <- ','',gsub('\\((.*?)$','',a))) | |
This file contains 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
library(shiny) | |
shinyApp( | |
ui = fluidPage( | |
selectizeInput(inputId = "variable", | |
label = "Variable:", | |
choices = split(names(iris),gsub('[_.]',' ',names(iris))), | |
options=list(multiple=TRUE,create = TRUE)), | |
checkboxGroupInput(inputId = 'grep',label = 'regex options', | |
choices = c('Enable'='enbl', |