sedonafns

The goal of sedonafns is to provide function definitions and documentation to enhance the user experience writing SedonaDB code in practice.

Installation

sedonafns can be installed from R-multiverse:

install.packages("sedonafns", repos = "https://community.r-multiverse.org")

You can install the development version of sedonafns from GitHub with:

pak::pkg_install("apache/sedona-db/r/sedonafns")

Example

You can use sd_xxx() functions in SedonaDB pipelines and benefit from autocomplete and inline documentation. We use sd_ instead of st_ as a prefix to avoid name collisions with the sf package.

library(sedonadb)
library(sedonafns)

sd_read_sf(system.file("shape/nc.shp", package = "sf")) |>
  sd_transmute(
    NAME,
    area = sd_area(wkb_geometry)
  )
#> <sedonab_dataframe: ?? x 2>
#> ┌─────────────┬─────────────────────┐
#> │     NAME    ┆         area        │
#> │     utf8    ┆       float64       │
#> ╞═════════════╪═════════════════════╡
#> │ Ashe        ┆ 0.11428350451751612 │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Alleghany   ┆ 0.06139975567930378 │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Surry       ┆  0.1430162843025755 │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Currituck   ┆ 0.06977097556227818 │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Northampton ┆ 0.15275930054485798 │
#> ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
#> │ Hertford    ┆ 0.09715755874640308 │
#> └─────────────┴─────────────────────┘
#> Preview of up to 6 row(s)