I have a dataset with zipf law distribution, and now i want compare it with standard zipf diagram, this is my R code:
f <- read.table('/myfile.txt',sep='\t',header=T)
attach(f)
fs <- f[order(cnt), ]
detach(f)
n = 1:dim(fs)[1]
plot(fs[,2]~n)
Now i want to compare it with zipf in the same plot, How can i do this in R?
The VGAM package has facilities for estimating the exponent in the Zipf distribution. You might want to plot your distribution against a best fit estimated density:
Below is that procedure using the data in the example on the ?dzipf page.
