I am trying to build a sequence of colored small squares representing various activities. For example, in the next data frame, the type represents the type of activity and count represents how many of these actions happened before the "other typed" event occurred.
df3 <- data.frame(type=c(1,6,4,6,1,4,1,4,1,1,1,1,6,6,1,1,3,1,4,1,4,6,4,6,4,4,6,4,6,4), count=c(6,1,1,1,2,1,6,3,1,6,8,10,3,1,2,2,1,2,1,1,1,1,1,1,3,3,1,17,1,12) )
In ggplot, I currently do not use count. I just specify consecutive numbers as xvalues ββand 1 as yvalues. However, this gives me something like ggplot Image. This is the code I used, note that for y I always use 1, and for x I only use consecutive numbers:
ggplot(df3,aes(x=1:nrow(df3),y=rep(1,30))) + geom_bar(stat="identity",aes(color=as.factor(type)))
I would like to get small squares with the graph = df3 $ count.
Do you have any suggestions? thanks in advance