[R] Exporting frequency distributions

Jim Lemon jim at bitwrit.com.au
Tue Sep 2 12:11:21 CEST 2008


Luz Milena Zea Fernandez wrote:
> Dear support, we are trying to export a frequency distributions obtanined by stament freq(x,variable.labels=NULL,display.na=TRUE,levels=NULL)
> of prettyR.
> How can I do it?
>   
Hi Luz,
If you want to export (save to a file) the output of freq:

sink("myfile.out")
freq(x,variable.labels=NULL,display.na=TRUE,levels=NULL)
sink()

If you want to export the object that freq returns (a list with as many 
components as there are frequency tables), you could try some variant of 
lapply, although I haven't figured out how to get it to print the 
components without also printing the object passed.

Jim



More information about the R-help mailing list