Bug 15300 - factors with incorrect structure sent to `write.table` cause crash on Ubuntu, OSX and other systems
factors with incorrect structure sent to `write.table` cause crash on Ubuntu,...
Product: R
Classification: Unclassified
Component: Low-level
R 3.0.0
All All
: P5 normal
Assigned To: R-core
Depends on:
  Show dependency treegraph
Reported: 2013-04-30 15:15 UTC by Ricardo Saporta
Modified: 2013-05-02 18:27 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Saporta 2013-04-30 15:15:09 UTC
Brief Description:
  Calling write.table on a data.frame with factors with atypical structure causes crash. 


    PROBLEM_DATA <- structure(114:116, .Label = c("String1", "String2", "String3", "String4", "String5", "String6", "String7", "String8", "String9", "String10", "String11", "String12", "String13", "String14", "String15"), class = "factor")

   # This will cause a crash
   write.table(PROBLEM_DATA, file=path.expand("~/test.csv"))

Further Discussion on Stack Overflow: 

Comment 1 Duncan Murdoch 2013-05-02 18:27:49 UTC
I will fix write.table for now, but perhaps the error should have occurred when the bad factor was created.