Github user zero323 commented on the pull request:

    https://github.com/apache/spark/pull/9099#issuecomment-148731721
  
    @sun-rui It is simple but not correct. Since `t` results in a matrix there 
is an automatic type coercion. So for example if you take iris you can expect 
something like this:
    
    ```
    iris_t <- t(iris)
    stopifnot(is.character(iris_t), is.matrix(iris_t)) # Type coercion, 
everything is character
    iris_t_df <- data.frame(iris_t)
    stopifnot(all(lapply(iris_t_df, class) == "factor")) # Now everything is 
factor
    ```
    
    The second coercion can be handled with `stringsAsFactors = FALSE`, but the 
first is the only possible behavior. Matrices can store only a single type so 
this is what we get. Situation gets even worse with non-atomic types. 
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to