Bug 17129 - as.data.frame.table inconsistency wrt strings
Summary: as.data.frame.table inconsistency wrt strings
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: R 3.3.*
Hardware: Other Linux
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2016-08-11 19:01 UTC by Terry Therneau
Modified: 2018-08-04 16:47 UTC (History)
1 user (show)

See Also:

modify as.data.frame.table to use default.stringsAsFactors() (593 bytes, patch)
2018-08-04 16:47 UTC, Benjamin Tyner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Terry Therneau 2016-08-11 19:01:55 UTC
I would expect the as.data.frame methods to obey the global stringsAsFactors option.  Many do, one doesn't (as.data.frame.table);  
For most the issue is not applicable, e.g., as.data.frame.ordered will never have the opportunity to turn a string into a factor so need not be told what to do in such a case.

Ones that do obey the global option: matrix, array, character, list

One that does not: as.data.frame.table

This is a potential source of confusion.
Comment 1 Benjamin Tyner 2018-08-04 16:47:38 UTC
Created attachment 2359 [details]
modify as.data.frame.table to use default.stringsAsFactors()

here is a patch