My goal is to create a wordcloud in R, but I'm working with nested JSON data (which also happens to be incredibly messy).
There's a nice explanation here for how to create a wordcloud of phrases rather than singular words. I also know melt() from reshape2 can create new rows out of entire columns. Is there a way in R to perform a melt-like function over nested substrings?
Example:
N Group String
1 A c("a", "b", c")
2 A character(0)
3 B a
4 B c("b", d")
5 B d
...should become:
N Group String
1 A a
2 A b
3 A c
4 A character(0)
5 B a
6 B b
7 B d
8 B d
...where each subsequent substring is returned to the next row. In my actual data, the pattern c("x, y") is consistent but the substrings are too varied to know a priori.
If there's no great way to do this, too bad... just thought I'd ask the experts!