[
https://issues.apache.org/jira/browse/SPARK-17902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16208685#comment-16208685
]
Hyukjin Kwon edited comment on SPARK-17902 at 10/18/17 1:29 AM:
----------------------------------------------------------------
Hi [~falaki] and [~shivaram], I was thinking a just simple way such as :
{code}
if (stringsAsFactors) {
df[sapply(df, is.character)] <- lapply(df[sapply(df, is.character)],
as.factor)
}
{code}
Would it make sense?
was (Author: hyukjin.kwon):
Hi [~falaki] and [~shivaram], I was thinking a just simple way such as :
{quote}
if (stringsAsFactors) {
df[sapply(df, is.character)] <- lapply(df[sapply(df, is.character)],
as.factor)
}
{quote}
Would it make sense?
> collect() ignores stringsAsFactors
> ----------------------------------
>
> Key: SPARK-17902
> URL: https://issues.apache.org/jira/browse/SPARK-17902
> Project: Spark
> Issue Type: Bug
> Components: SparkR
> Affects Versions: 2.0.1
> Reporter: Hossein Falaki
>
> `collect()` function signature includes an optional flag named
> `stringsAsFactors`. It seems it is completely ignored.
> {code}
> str(collect(createDataFrame(iris), stringsAsFactors = TRUE)))
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]