I get the following error using the steamgraph package
library(streamgraph)
streamgraph(data, "Keys" ,"Box.Office", date = 11-11-2011, interactive=TRUE)
Error in .subset(x, j) : invalid subscript type 'list'
Sample of the data:
days;Box.Office;Key
1; 2324234;Lucy
2; 123123;Lucy
3; 898989;Lucy
.....
1; 231231;Interstellar
2; 32423;Interstellar
First thing first, there is a typo in your code:
Keys
should beKey
and theinteractive
argument is set toTRUE
by default, you do not need to specify it.Most likely the problem is that
streamgraph
does not know how to deal with thedays
column, in fact if you change thedays
column with something (numeric or character) that can be converted toas.Date
it works well.The example of the official page show that all example do have column (numeric or character) that can be interpreted as valid date, furthermore you can explore the body of the function with just typing
streamgraph
in R and you'll see more closely what it does.With the provided data, to allow function work you need other informations. Here is an example where I have converted the
days
column to dates. It works well and produce the plot.just use this data: