powered by
Compute the sample covariance between two expressions.
Calculate the sample covariance of two numerical columns of a SparkDataFrame.
cov(x, ...)covar_samp(col1, col2)# S4 method for characterOrColumn cov(x, col2)# S4 method for characterOrColumn,characterOrColumn covar_samp(col1, col2)# S4 method for SparkDataFrame cov(x, colName1, colName2)
covar_samp(col1, col2)
# S4 method for characterOrColumn cov(x, col2)
# S4 method for characterOrColumn,characterOrColumn covar_samp(col1, col2)
# S4 method for SparkDataFrame cov(x, colName1, colName2)
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.
x
the first Column.
the second Column.
the name of the first column
the name of the second column
The covariance of the two columns.
Other math_funcs: acos, asin, atan2, atan, bin, bround, cbrt, ceil, conv, corr, cosh, cos, covar_pop, expm1, exp, factorial, floor, hex, hypot, log10, log1p, log2, log, pmod, rint, round, shiftLeft, shiftRightUnsigned, shiftRight, signum, sinh, sin, sqrt, tanh, tan, toDegrees, toRadians, unhex
acos
asin
atan2
atan
bin
bround
cbrt
ceil
conv
corr
cosh
cos
covar_pop
expm1
exp
factorial
floor
hex
hypot
log10
log1p
log2
log
pmod
rint
round
shiftLeft
shiftRightUnsigned
shiftRight
signum
sinh
sin
sqrt
tanh
tan
toDegrees
toRadians
unhex
Other stat functions: approxQuantile, corr, crosstab, freqItems, sampleBy
approxQuantile
crosstab
freqItems
sampleBy
# NOT RUN { cov(df$c, df$d) cov("c", "d") covar_samp(df$c, df$d) covar_samp("c", "d") # } # NOT RUN { df <- read.json("/path/to/file.json") cov <- cov(df, "title", "gender") # }
Run the code above in your browser using DataLab