Compute the covariance between two expressions.
Usagecov(x, ...)
covar_samp(col1, col2)
covar_pop(col1, col2)
# S4 method for class 'characterOrColumn'
cov(x, col2)
# S4 method for class 'characterOrColumn,characterOrColumn'
covar_samp(col1, col2)
# S4 method for class 'characterOrColumn,characterOrColumn'
covar_pop(col1, col2)
# S4 method for class 'SparkDataFrame'
cov(x, colName1, colName2)
Arguments
a Column or a SparkDataFrame.
additional argument(s). If x
is a Column, a Column should be provided. If x
is a SparkDataFrame, two column names should be provided.
the first Column.
the second Column.
the name of the first column
the name of the second column
The covariance of the two columns.
Detailscov
: 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.
cov since 1.6.0
covar_samp since 2.0.0
covar_pop since 2.0.0
cov since 1.6.0
Examplesif (FALSE) { # \dontrun{
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")))} # }
if (FALSE) { # \dontrun{
cov(df, "mpg", "hp")
cov(df, df$mpg, df$hp)} # }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4