Skip to content

Add Series

Source code

Description

Method equivalent of addition operator series + other.

Usage

<Series>$add(other)

Arguments

other Series like object of numeric or string values. Converted to Series by as_polars_series() in this method.

Value

Series

See Also

  • Arithmetic operators

Examples

library("polars")

as_polars_series(1:3)$add(as_polars_series(11:13))
#> polars Series: shape: (3,)
#> Series: '' [i32]
#> [
#>  12
#>  14
#>  16
#> ]
as_polars_series(1:3)$add(11:13)
#> polars Series: shape: (3,)
#> Series: '' [i32]
#> [
#>  12
#>  14
#>  16
#> ]
as_polars_series(1:3)$add(1L)
#> polars Series: shape: (3,)
#> Series: '' [i32]
#> [
#>  2
#>  3
#>  4
#> ]
as_polars_series("a")$add("-z")
#> polars Series: shape: (1,)
#> Series: '' [str]
#> [
#>  "a-z"
#> ]