The cubble class

A cubble object can be created from separate spatial and temporal component with make_cubble(). Coercion from tbl_df, ncdf4, stars and sftime objects is made available in as_cubble().

cubble() make_cubble()

Create a cubble object


Coerce foreign objects into a cubble object

is_cubble() is_cubble_spatial() is_cubble_temporal() is_sf() is_tsibble()

Predicate functions on the object class

print(<cubble_df>) tbl_sum(<spatial_cubble_df>) tbl_sum(<temporal_cubble_df>)

Print methods

`[`(<spatial_cubble_df>) `[`(<temporal_cubble_df>) `names<-`(<spatial_cubble_df>) `names<-`(<temporal_cubble_df>) `[[<-`(<cubble_df>)

Accessors to a cubble object

key_vars(<cubble_df>) key(<cubble_df>) key_data(<cubble_df>) coords() spatial() index() index_var()

Extract cubble attributes

Main functionalities

A cubble object allows you to wrangle spatio-temporal data through pivoting the data into its spatial and temporal component.


Check on key when create cubble from two components (spatial/temporal)

face_temporal() face_spatial()

Pivot a cubble object between the nested/long (spatial/temporal) form


Augment spatial component into the long (temporal) form

match_sites() match_spatial() match_temporal()

Match stations in two cubbles by spatial distance/ temporal similarity

geom_glyph() geom_glyph_line() geom_glyph_box()

Create glyph map with ggplot2

Compatibility with dplyr

The cubble class support on the following dplyr verbs: mutate(), filter(), arrange(), select(), group_by(), ungroup(), summarise(). rename(), bind_cols() rowwise(), relocate(), the slice family (slice_head(), slice_tail(), slice_max(), slice_min(), slice_sample()) and the join family (left_join(), right_join(), inner_join(), full_join(), anti_join(), semi_join())

arrange(<temporal_cubble_df>) select(<spatial_cubble_df>) select(<temporal_cubble_df>) group_by(<spatial_cubble_df>) group_by(<temporal_cubble_df>) ungroup(<spatial_cubble_df>) ungroup(<temporal_cubble_df>) summarise(<spatial_cubble_df>) summarise(<temporal_cubble_df>) rename(<spatial_cubble_df>) rename(<temporal_cubble_df>) bind_rows.temporal_cubble_df() bind_cols.spatial_cubble_df() bind_cols.temporal_cubble_df() rowwise(<spatial_cubble_df>) rowwise(<temporal_cubble_df>) dplyr_col_modify(<cubble_df>) dplyr_row_slice(<spatial_cubble_df>) dplyr_row_slice(<temporal_cubble_df>) dplyr_reconstruct(<spatial_cubble_df>) dplyr_reconstruct(<temporal_cubble_df>) mutate(<spatial_cubble_df>) filter(<spatial_cubble_df>) arrange(<spatial_cubble_df>)

dplyr methods

Compatibility with sf and tsibble

You can promote the spatial component of a cubble object to also include the sf class with make_spatial_sf() (or create initially with an sf object in make_cubble()). The sf functionalities that work on the sf column carry over to a cubble object. Similarly, the temporal component of a cubble object can be updated to a tsibble object with make_temporal_tsibble() (or created originally with a tsibble object in make_cubble()). Functionalities applied to the tsibble class can then be applied to a temporal cubble object.


Update the spatial cubble to include the sf class


Update the temporal cubble to include the tsibble class (tbl_ts)

fill_gaps(<temporal_cubble_df>) scan_gaps(<temporal_cubble_df>)

Gap-filling on the temporal component of a cubble object

In-built data

climate_aus historical_tmax

Australia climate data

stations stations_sf meteo meteo_ts climate_flat climate_mel

Toy climate data


Australia river data

covid lga

Daily COVID count data (in tsibble) and Victoria LGA (in sf)



Temporary update cubble if the sf class take precedent of cubble classes