2012-08-14 66 views

回答

0

我不知道你的數據看起來完全像什麼,但它聽起來像你想:

ccdf<-function(views,density=FALSE) 
    { 
    freq = table(views) 
    X = rev(as.numeric(names(freq))) 
    Y =cumsum(as.list(freq));   #not reversed 
    Y=(max(Y)-Y)/max(Y)    #proportion, beware recursion! 
    data.frame(x=X,Cum.Prop=Y)   #name change 
    } 
qplot(x,Cum.Prop ,data=ccdf(views),log='xy') 

如果你告訴我多一點關於你的views可變我可以確保它工作的權利。