install_github("ropensci/alm")
library("alm")
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))) | |
#' @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) | |
#' |
library(RSelenium) | |
library(XML) | |
library(ggplot2) | |
library(reshape2) | |
library(plyr) | |
library(dplyr) | |
gh_user <- '<your github login name>' | |
gh_pass <- '<your github login password>' |
license: mit | |
height: 600 |
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)) |
burrow_find <- function(x,parent,regex = FALSE){ | |
if(grepl('(\\[|\\])',parent)){ | |
nx <- as.numeric(gsub('(\\[|\\])','',parent)) | |
}else{ | |
if(regex){ | |
nx <- grep(parent,names(x)) |
# dummy functions ---- | |
f <- function() { | |
testthat::expect_is(data.frame(),'data.frame') | |
} | |
f1 <- function() { | |
testthat::expect_is(data.frame(),'list') | |
} |
library(rvest) | |
library(patchwork) | |
tweet_threading <- function(tw){ | |
last_found <- FALSE | |
while(!last_found){ | |
nr <- nrow(tw) | |
last_found <- is.na(tw$reply_to_status_id[nr]) |