Description Usage Arguments Details Value Note See Also Examples
Compute the covariance between two expressions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | cov(x, ...)
covar_samp(col1, col2)
covar_pop(col1, col2)
## S4 method for signature 'characterOrColumn'
cov(x, col2)
## S4 method for signature 'characterOrColumn,characterOrColumn'
covar_samp(col1, col2)
## S4 method for signature 'characterOrColumn,characterOrColumn'
covar_pop(col1, col2)
## S4 method for signature 'SparkDataFrame'
cov(x, colName1, colName2)
|
x |
a Column or a SparkDataFrame. |
... |
additional argument(s). If |
col1 |
the first Column. |
col2 |
the second Column. |
colName1 |
the name of the first column |
colName2 |
the name of the second column |
cov
: Compute the sample covariance between two expressions.
covar_sample
: Alias for cov
.
covar_pop
: Computes the population covariance between two expressions.
cov
: When applied to SparkDataFrame, this calculates the sample covariance of two
numerical columns of one SparkDataFrame.
The covariance of the two columns.
cov since 1.6.0
covar_samp since 2.0.0
covar_pop since 2.0.0
cov since 1.6.0
Other aggregate functions:
avg()
,
column_aggregate_functions
,
corr()
,
count()
,
first()
,
last()
Other stat functions:
approxQuantile()
,
corr()
,
crosstab()
,
freqItems()
,
sampleBy()
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
head(select(df, cov(df$mpg, df$hp), cov("mpg", "hp"),
covar_samp(df$mpg, df$hp), covar_samp("mpg", "hp"),
covar_pop(df$mpg, df$hp), covar_pop("mpg", "hp")))
## End(Not run)
## Not run:
cov(df, "mpg", "hp")
cov(df, df$mpg, df$hp)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.