Github user NarineK commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12989#discussion_r62619916
  
    --- Diff: R/pkg/inst/tests/testthat/test_sparkSQL.R ---
    @@ -2070,6 +2072,16 @@ test_that("dapply() on a DataFrame", {
       rownames(expected) <- NULL
       expect_identical(expected, result)
     
    +  result <- dapplyCollect(
    +              df,
    +              function(x) {
    +                y <- x[x$a > 1, ]
    +                y <- cbind(y, y$a + 1L)
    --- End diff --
    
    Well, let's assume I use dapply to train linear model. The model object 
contains a list of different attributes for example coefficients, residuals , 
... etc. 
    model <- lm(Species ~ ., iris).
    dapply wraps my model in a data.frame which is fine.
    
    Now, as next I'd like to make predictions using dapply and the model which 
I've previously trained.
    This means, that I probably need something like this: 
    ```
    df1 <- dapply(
        df, 
       model,
        function (x, model) {
           predict (model, x, ... )
       }
    )
    ```
    Can we do something similar ?


---
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