Dataset class
Dataset class
Definition for the Dataset class.
Note that this method has no effect if the dataset does not have file path on disk.
id
character
identifier.
spatial_path
character
file path.
attribute_path
character
file path.
boundary_path
character
file path.
spatial_data
NULL
, sf::st_sf()
, or raster::raster()
object.
attribute_data
NULL
, or tibble::tibble()
object.
boundary_data
NULL
, or Matrix::sparseMatrix()
or NA
object.
new()
Create a Dataset object.
Dataset$new(
id,
spatial_path,
attribute_path,
boundary_path,
spatial_data,
attribute_data,
boundary_data
)
id
character
value.
spatial_path
character
file path.
attribute_path
character
file path.
boundary_path
character
file path.
spatial_data
sf::st_sf()
, or raster::raster()
object.
attribute_data
tibble::tibble()
object.
boundary_data
Matrix::sparseMatrix()
object or NA.
A new Dataset object.
new()
Create a Dataset object.
Dataset$new(
id,
spatial_path,
attribute_path,
boundary_path,
spatial_data,
attribute_data,
boundary_data
)
id
character
value.
spatial_path
character
file path.
attribute_path
character
file path.
boundary_path
character
file path.
spatial_data
sf::st_sf()
, or raster::raster()
object.
attribute_data
tibble::tibble()
object.
boundary_data
Matrix::sparseMatrix()
object or NA.
A new Dataset object.
print()
Print the object.
Dataset$print(...)
...
not used.
print()
Print the object.
Dataset$print(...)
...
not used.
repr()
Generate a character
summarizing the representation of the object.
Dataset$repr()
character
value.
repr()
Generate a character
summarizing the representation of the object.
Dataset$repr()
character
value.
import()
Import the data into memory.
Dataset$import()
import()
Import the data into memory.
Dataset$import()
write()
Write the data to disk.
Dataset$write(spatial_path, attribute_path, boundary_path)
spatial_path
character
file path.
attribute_path
character
file path.
boundary_path
character
file path.
write()
Write the data to disk.
Dataset$write(spatial_path, attribute_path, boundary_path)
spatial_path
character
file path.
attribute_path
character
file path.
boundary_path
character
file path.
clean()
Clean the dataset from memory.
Dataset$clean()
clean()
Clean the dataset from memory.
Dataset$clean()
get_spatial_data()
Get the spatial data.
Dataset$get_spatial_data()
sf::st_as_sf()
or raster::raster()
object.
get_spatial_data()
Get the spatial data.
Dataset$get_spatial_data()
sf::st_as_sf()
or raster::raster()
object.
get_attribute_data()
Get the attribute data.
Dataset$get_attribute_data()
tibble::tibble()
object.
get_attribute_data()
Get the attribute data.
Dataset$get_attribute_data()
tibble::tibble()
object.
get_boundary_data()
Get the spatial data.
Dataset$get_boundary_data()
Matrix::sparseMatrix()
object.
get_boundary_data()
Get the spatial data.
Dataset$get_boundary_data()
Matrix::sparseMatrix()
object.
get_crs()
Get the coordinate reference system.
Dataset$get_crs()
sf::st_crs()
object.
get_crs()
Get the coordinate reference system.
Dataset$get_crs()
sf::st_crs()
object.
get_bbox()
Get the bounding box.
Dataset$get_bbox(native = TRUE, expand = FALSE)
native
logical
indicating if the bounding box should
be in (TRUE
) the native coordinate reference system or (FALSE
)
re-projected to longitude/latitude?
expand
FALSE
should the bounding box be expanded by 10%?
list
object with "xmin"
, "xmax"
, "ymin"
, and "ymax"
elements.
get_bbox()
Get the bounding box.
Dataset$get_bbox(native = TRUE, expand = FALSE)
native
logical
indicating if the bounding box should
be in (TRUE
) the native coordinate reference system or (FALSE
)
re-projected to longitude/latitude?
expand
FALSE
should the bounding box be expanded by 10%?
list
object with "xmin"
, "xmax"
, "ymin"
, and "ymax"
elements.
get_planning_unit_indices()
Get planning unit indices.
Dataset$get_planning_unit_indices()
integer
vector of indices.
get_planning_unit_indices()
Get planning unit indices.
Dataset$get_planning_unit_indices()
integer
vector of indices.
get_names()
Get attribute names.
Dataset$get_names()
character
vector of field/layer names.
get_names()
Get attribute names.
Dataset$get_names()
character
vector of field/layer names.
get_planning_unit_areas()
Get area values.
Dataset$get_planning_unit_areas()
numeric
vector of values.
get_planning_unit_areas()
Get area values.
Dataset$get_planning_unit_areas()
numeric
vector of values.
get_index()
Get a data from the dataset at an index.
Dataset$get_index(index)
index
character
or integer
indicating the field/layer with
the data.
sf::st_as_sf()
or raster::raster()
object.
get_index()
Get a data from the dataset at an index.
Dataset$get_index(index)
index
character
or integer
indicating the field/layer with
the data.
sf::st_as_sf()
or raster::raster()
object.
has_index()
Check if the dataset has an index.
Dataset$has_index(index)
index
character
or integer
indicating the field/layer with
the data.
logical
indicating if data is present or not.
has_index()
Check if the dataset has an index.
Dataset$has_index(index)
index
character
or integer
indicating the field/layer with
the data.
logical
indicating if data is present or not.
max_index()
Maximum index.
Dataset$max_index()
integer
largest index.
max_index()
Maximum index.
Dataset$max_index()
integer
largest index.
add_index()
Add data at an index.
Dataset$add_index(index, values)
index
character
or integer
indicating the field/layer with
the data.
values
numeric
vector.
add_index()
Add data at an index.
Dataset$add_index(index, values)
index
character
or integer
indicating the field/layer with
the data.
values
numeric
vector.
clone()
The objects of this class are cloneable with this method.
Dataset$clone(deep = FALSE)
deep
Whether to make a deep clone.
clone()
The objects of this class are cloneable with this method.
Dataset$clone(deep = FALSE)
deep
Whether to make a deep clone.