[R] str on large data.frame is slow on factors with many levels

Sam Steingold sds at gnu.org
Tue Apr 9 22:30:59 CEST 2013


str() takes 2+ minutes to print
--8<---------------cut here---------------start------------->8---
'data.frame':	9445743 obs. of  25 variables:
 $ share.id        : Factor w/ 1641168 levels "387059b61ffef5cf",..: 7 118 118 209 242 242 254 254 263 291 ...
...
--8<---------------cut here---------------end--------------->8---
pausing for tens of seconds to print each factor variable which have a
lot of levels.
Why?

(R version 2.15.3 (2013-03-01) -- "Security Blanket"
 Platform: x86_64-pc-linux-gnu (64-bit))

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.10 (quantal) X 11.0.11300000
http://www.childpsy.net/ http://pmw.org.il http://palestinefacts.org
http://mideasttruth.com http://americancensorship.org http://camera.org
Garbage In, Gospel Out



More information about the R-help mailing list