purpose
I am going to do some Sankey in R using the package googleVis. The result should look something like this:

Data
I created some dummy data in R:
set.seed(1)
source <- sample(c("North","South","East","West"),100,replace=T)
mid <- sample(c("North ","South ","East ","West "),100,replace=T)
destination <- sample(c("North","South","East","West"),100,replace=T)
dummy <- rep(1,100)
dat <- data.frame(source,mid,destination,dummy)
aggdat <- aggregate(dummy~source+mid+destination,dat,sum)
What I tried so far
I can build Sankey with two variables if I have only the source and destination, but not the midpoint:
aggdat <- aggregate(dummy~source+destination,dat,sum)
library(googleVis)
p <- gvisSankey(aggdat,from="source",to="destination",weight="dummy")
plot(p)
The code produces the following:

Question
How do i change
p <- gvisSankey(aggdat,from="source",to="destination",weight="dummy")
to accept a variable mid?