Skip to content
Snippets Groups Projects
  • felixcheung's avatar
    1a93323c
    [SPARK-11339][SPARKR] Document the list of functions in R base package that... · 1a93323c
    felixcheung authored
    [SPARK-11339][SPARKR] Document the list of functions in R base package that are masked by functions with same name in SparkR
    
    Added tests for function that are reported as masked, to make sure the base:: or stats:: function can be called.
    
    For those we can't call, added them to SparkR programming guide.
    
    It would seem to me `table, sample, subset, filter, cov` not working are not actually expected - I investigated/experimented with them but couldn't get them to work. It looks like as they are defined in base or stats they are missing the S3 generic, eg.
    ```
    > methods("transform")
    [1] transform,ANY-method       transform.data.frame
    [3] transform,DataFrame-method transform.default
    see '?methods' for accessing help and source code
    > methods("subset")
    [1] subset.data.frame       subset,DataFrame-method subset.default
    [4] subset.matrix
    see '?methods' for accessing help and source code
    Warning message:
    In .S3methods(generic.function, class, parent.frame()) :
      function 'subset' appears not to be S3 generic; found functions that look like S3 methods
    ```
    Any idea?
    
    More information on masking:
    http://www.ats.ucla.edu/stat/r/faq/referencing_objects.htm
    http://www.sfu.ca/~sweldon/howTo/guide4.pdf
    
    This is what the output doc looks like (minus css):
    ![image](https://cloud.githubusercontent.com/assets/8969467/11229714/2946e5de-8d4d-11e5-94b0-dda9696b6fdd.png)
    
    Author: felixcheung <felixcheung_m@hotmail.com>
    
    Closes #9785 from felixcheung/rmasked.
    1a93323c
    History
    [SPARK-11339][SPARKR] Document the list of functions in R base package that...
    felixcheung authored
    [SPARK-11339][SPARKR] Document the list of functions in R base package that are masked by functions with same name in SparkR
    
    Added tests for function that are reported as masked, to make sure the base:: or stats:: function can be called.
    
    For those we can't call, added them to SparkR programming guide.
    
    It would seem to me `table, sample, subset, filter, cov` not working are not actually expected - I investigated/experimented with them but couldn't get them to work. It looks like as they are defined in base or stats they are missing the S3 generic, eg.
    ```
    > methods("transform")
    [1] transform,ANY-method       transform.data.frame
    [3] transform,DataFrame-method transform.default
    see '?methods' for accessing help and source code
    > methods("subset")
    [1] subset.data.frame       subset,DataFrame-method subset.default
    [4] subset.matrix
    see '?methods' for accessing help and source code
    Warning message:
    In .S3methods(generic.function, class, parent.frame()) :
      function 'subset' appears not to be S3 generic; found functions that look like S3 methods
    ```
    Any idea?
    
    More information on masking:
    http://www.ats.ucla.edu/stat/r/faq/referencing_objects.htm
    http://www.sfu.ca/~sweldon/howTo/guide4.pdf
    
    This is what the output doc looks like (minus css):
    ![image](https://cloud.githubusercontent.com/assets/8969467/11229714/2946e5de-8d4d-11e5-94b0-dda9696b6fdd.png)
    
    Author: felixcheung <felixcheung_m@hotmail.com>
    
    Closes #9785 from felixcheung/rmasked.