Skip to content

Instantly share code, notes, and snippets.

View pedroj's full-sized avatar
🌎
Fazendo ciência e soltando pipa

Pedro Jordano pedroj

🌎
Fazendo ciência e soltando pipa
View GitHub Profile
vif_func<-function(in_frame,thresh=10,trace=T,wts=NULL,...){
library(fmsb)
if(any(!'data.frame' %in% class(in_frame))) in_frame<-data.frame(in_frame)
if(is.null(wts))
wts <- rep(1, ncol(in_frame))
if(!is.null(wts))
if(length(wts)!=ncol(in_frame)) stop('length of weights must equal number of variables')
@aaronberdanier
aaronberdanier / Sankey.R
Created December 2, 2011 14:50
Program for creating sankey diagrams in R
SankeyR <- function(inputs, losses, unit, labels, format="plot"){
########################
# SankeyR version 1.01 (updated August 10, 2010)
# is a function for creating Sankey Diagrams in R.
# See http://www.sankey-diagrams.com for excellent examples of Sankey Diagrams.
#
# OPTIONS:
# 'inputs' is a vector of input values
# 'losses' is a vector of loss values
# 'unit' is a string of the unit