خرید بک لینک

Vote count: 0

I have the following example data:

my.list <- vector('list',100)
for(i in 1:1000)
{
    temp <- sample(c("type1","type2"),1)
    my.list[[i]] <- data.frame(time=i,type=temp)
}
df <- do.call('rbind',my.list)

I want to plot the variation of the type variable with time. I used the following:

ggplot(df,aes(x=time,y=type)) + geom_line()

with this command, I am not getting the expected result:

enter image description here

Notice how a transition from type 1 to type 2 and vice versa doesn't show in the plot. Did I miss something ?

asked 53 secs ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: شنبه 26 تير 1395 ساعت: 20:23

صفحه بندی