You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.htmhttp://www.sfu.ca/~sweldon/howTo/guide4.pdf
This is what the output doc looks like (minus css):

Author: felixcheung <[email protected]>
Closes#9785 from felixcheung/rmasked.
Copy file name to clipboardExpand all lines: docs/sparkr.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,7 +286,7 @@ head(teenagers)
286
286
287
287
# Machine Learning
288
288
289
-
SparkR allows the fitting of generalized linear models over DataFrames using the [glm()](api/R/glm.html) function. Under the hood, SparkR uses MLlib to train a model of the specified family. Currently the gaussian and binomial families are supported. We support a subset of the available R formula operators for model fitting, including '~', '.', ':', '+', and '-'.
289
+
SparkR allows the fitting of generalized linear models over DataFrames using the [glm()](api/R/glm.html) function. Under the hood, SparkR uses MLlib to train a model of the specified family. Currently the gaussian and binomial families are supported. We support a subset of the available R formula operators for model fitting, including '~', '.', ':', '+', and '-'.
290
290
291
291
The [summary()](api/R/summary.html) function gives the summary of a model produced by [glm()](api/R/glm.html).
292
292
@@ -351,3 +351,38 @@ summary(model)
351
351
##Sepal_Width 0.404655
352
352
{% endhighlight %}
353
353
</div>
354
+
355
+
# R Function Name Conflicts
356
+
357
+
When loading and attaching a new package in R, it is possible to have a name [conflict](https://stat.ethz.ch/R-manual/R-devel/library/base/html/library.html), where a
358
+
function is masking another function.
359
+
360
+
The following functions are masked by the SparkR package:
361
+
362
+
<tableclass="table">
363
+
<tr><th>Masked function</th><th>How to Access</th></tr>
364
+
<tr>
365
+
<td><code>cov</code> in <code>package:stats</code></td>
366
+
<td><code><pre>stats::cov(x, y = NULL, use = "everything",
0 commit comments