[R] Using get() or similar function to access more than one element in a vector

2011-08-13 Thread Joseph Sorell
Dear R-users, I've written a script that produces a frequency table for a group of texts. The table has a total frequency for each word type and individual frequency counts for each of the files. (I have not included the code for creating the column headers.) Below is a sample: Word Total 01

[R] keeping output in memory

2011-08-08 Thread Joseph Sorell
In regard to my question Prof. Warren (Victoria University of Wellington, NZ) suggested the line: assign(paste("freq.list",i,sep="."),freq.list) instead of the lines: filename<-paste("freq.list", i, "txt", sep=".") write(freq.list, file=filename[[1]], sep="", append=FALSE)

[R] keeping output in memory

2011-08-08 Thread Joseph Sorell
ot;.") #creates a unique file name for each iteration of this loop write(freq.list, file=filename[[1]], sep="", append=FALSE) #writes the current frequency list to file } Many thanks! Joseph Sorell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] plotting Zipf and Zipf-Mandelbrot curves in R

2010-10-11 Thread Joseph Sorell
Using R, I plotted a log-log plot of the frequencies in the Brown Corpus using plot(sort(file.tfl$f, decreasing=TRUE), xlab="rank", ylab="frequency", log="x,y") However, I would also like to add lines showing the curves for a Zipfian distribution and for Zipf-Mandelbrot. I have seen these in many a