Arithmetic operators for RPolars objects
Description
Arithmetic operators for RPolars objects
Usage
## S3 method for class 'RPolarsExpr'
x + y
# S3 method for class 'RPolarsExpr'
x - y
# S3 method for class 'RPolarsExpr'
x * y
# S3 method for class 'RPolarsExpr'
x / y
# S3 method for class 'RPolarsExpr'
x ^ y
# S3 method for class 'RPolarsExpr'
x %% y
# S3 method for class 'RPolarsExpr'
x %/% y
# S3 method for class 'RPolarsSeries'
x + y
# S3 method for class 'RPolarsSeries'
x - y
# S3 method for class 'RPolarsSeries'
x * y
# S3 method for class 'RPolarsSeries'
x / y
# S3 method for class 'RPolarsSeries'
x ^ y
# S3 method for class 'RPolarsSeries'
x %% y
# S3 method for class 'RPolarsSeries'
x %/% y
Arguments
x , y
|
numeric type of RPolars objects or objects that can be coerced such.
Only + can take strings.
|
Value
A Polars object the same type as the input.
See Also
-
\
$add() -
\
$sub() -
\
$mul() -
\
$div() -
\
$pow() -
\
$mod() -
\
$floor_div() -
\
$add() -
\
$sub() -
\
$mul() -
\
$div() -
\
$pow() -
\
$mod() -
\
$floor_div()
Examples
#> polars Expr: [(dyn float: 5.0) + (dyn float: 10.0)]
#> polars Expr: [(dyn float: 5.0) + (dyn float: 10.0)]
#> polars Expr: [(dyn float: 5.0) + (dyn float: 10.0)]
#> polars Expr: dyn float: 1.0
#> polars Expr: [(dyn float: 5.0) + (String(10))]
#> <RPolarsErr_error: Execution halted with the following contexts
#> 0: In R: in $select()
#> 0: During function call [.main()]
#> 1: Encountered the following error in Rust-Polars:
#> arithmetic on string and numeric not allowed, try an explicit cast first
#>
#> Resolved plan until failure:
#>
#> ---> FAILED HERE RESOLVING 'select' <---
#> SELECT [[(dyn float: 5.0) + (String(10))]] FROM
#> DF []; PROJECT */0 COLUMNS; SELECTION: None
#> >
#> polars Series: shape: (1,)
#> Series: '' [f64]
#> [
#> 15.0
#> ]
#> polars Series: shape: (1,)
#> Series: '' [f64]
#> [
#> 5.0
#> ]
#> polars Series: shape: (1,)
#> Series: '' [f64]
#> [
#> -5.0
#> ]