[R] Printing data frame with million rows

David Winsemius dwinsemius at comcast.net
Sun Aug 7 21:31:07 CEST 2011


On Aug 7, 2011, at 2:37 PM, peter dalgaard wrote:

>
> On Aug 7, 2011, at 20:27 , David Winsemius wrote:
>
>>
>> On Aug 7, 2011, at 2:08 PM, Bansal, Vikas wrote:
>>
>>> Dear all,
>>>
>>> I was working on number of files and at the end I got a data frame  
>>> with approx. million rows.To prin this data frame in output, I used
>>>
>>> capture.output(print.data.frame(end,row.names=F), file =  
>>> "summary", append = FALSE)
>>>
>>> where end is the name of my data frame and summary is the name of  
>>> my output file.
>>>
>>> but when I checked the output there were only 10000 rows and at  
>>> the last it was written-
>>>
>>> [ reached getOption("max.print") -- omitted 923750 rows ]]
>>>
>>> Can you please tell me what is wrong with my output code?
>>
>> Nothing.
>>
>>> I want to print all million rows in my output.
>>
>> I'm trying to figure out why, after that warning message, you did  
>> not immediately pull up the help page for getOption?
>
> Perhaps he was looking for a way to override the option rather than  
> change it?
>
> print(...., max=2e6)
>
> should do the trick. (Documented on help(print.default), which  
> perhaps _is_ a little hard to find your way to.)

You mean that options(max.print=2e6) wouldn't have done the same  
thing? That was what I thought would work when I looked at  
help(getOption). Seemed to work just fine when I just tested it.

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list