r2d3 (version 1.0)

jsonCompare: Multiple results for comparison to json

Description

Creates a json file from a sequence of events. This json will work with D3Sankey

Usage

jsonCompare(data)

Arguments

data
A data frame with first column the record identifier and a series of columns showig the allocations to compare

Examples

Run this code
hc.ave <- hclust(dist(USArrests), "ave")
hc.single <- hclust(dist(USArrests), "single")
hc.ward <- hclust(dist(USArrests), "ward.D")

cut.ave<-cutree(hc.ave, k=6)
cut.single<-cutree(hc.single, k=6)
cut.ward<-cutree(hc.ward, k=6)

ClustComp<-data.frame(States=rownames(USArrests), ave=as.vector(cut.ave),single=as.vector(cut.single),ward=as.vector(cut.ward))

JSON<-jsonCompare(ClustComp)

Run the code above in your browser using DataCamp Workspace