Learn R Programming

fftab (version 0.1.0)

to_cplx: Convert a fftab Object Between Representations

Description

These functions convert a fftab object to a specified representation:

  • to_cplx(): Converts to complex representation (fx).

  • to_rect(): Converts to rectangular representation (re, im).

  • to_polr(): Converts to polar representation (mod, arg).

Usage

to_cplx(x, .keep = "unused")

to_rect(x, .keep = "unused")

to_polr(x, .keep = "unused")

Value

A modified fftab object containing the specified representation:

  • to_cplx(): Adds the fx column for complex values.

  • to_rect(): Adds the re and im columns for rectangular components.

  • to_polr(): Adds the mod and arg columns for polar components.

Arguments

x

A fftab object.

.keep

Specifies which columns to retain. See dplyr::mutate().

Details

  • to_cplx(): Converts from rectangular (re, im) or polar (mod, arg) components to complex form.

  • to_rect(): Converts from complex (fx) or polar components to rectangular form.

  • to_polr(): Converts from complex (fx) or rectangular components to polar form.

See Also

has_cplx(), get_repr()

Examples

Run this code
fftab(c(1, 0, -1, 0)) |> to_cplx()

fftab(c(1, 0, -1, 0)) |> to_rect()

fftab(c(1, 0, -1, 0)) |> to_polr()

Run the code above in your browser using DataLab