Skip to contents

write_portfolio() writes a processed biodiversity portfolio to disk. In order to ensure interoperability with other geospatial software, the data has to be transformed to either long- or wide-format. With the long format, geometries will be repeated thus possibly resulting in a large file size. With the wide-format, indicators will be added to the portfolio as columns without repeating the geometries, but potentially resulting in a large number of columns

portfolio_long() transforms a portfolio to long-format, potentially dropping geometries in the process.

portfolio_wide() transforms a portfolio to wide-format, potentially dropping geometries in the process.

Usage

write_portfolio(x, dsn, format = c("long", "wide"), overwrite = FALSE, ...)

portfolio_long(x, indicators = NULL, drop_geoms = FALSE)

portfolio_wide(x, indicators = NULL, drop_geoms = FALSE)

Arguments

x

A portfolio object processed with mapme.biodiversity.

dsn

A file path for the output file.

format

A character indicating if data should be written in long or wide format.

overwrite

A logical indicating if the output file should be overwritten if it exists.

...

Additional arguments supplied to st_write()

indicators

If NULL (the default), all indicator columns will be detected and transformed automatically. If a character vector is supplied, only those indicators will be transformed.

drop_geoms

A logical, indicating if geometries should be dropped.

Value

write_portfolio() returns dsn, invisibly.

portfolio_long() returns the portfolio object in long-format.

portfolio_wide() returns the portfolio object in wide-format.