Changelog
Source:NEWS.md
MetricGraph (development version)
 Added an INLA implementation for
alpha=2
.  Added a vignette for handling multiple likelihoods in
RINLA
andinlabru
, and updated thegraph_spde_data()
function for such cases.  Added an INLA implementation for directional models.
 Added support for directional edge weights.
 Added support for creating metric graphs from
SSN
,osmdata_sp
andosmdata_sf
objects. In such cases, if available, edge weights and data will be automatically added to the graph.  Now if one creates the metric graph from
SpatialLinesDataFrame
,LINESTRING
,MULTILINESTRING
, etc., if the object contain edge data, they will be automatically added as edge weights.  Added an option to not perform merges (which is now the default), that makes the graph creation faster and using less memory.
 Added vignettes with a river example and with an example of directional models.
 Updated the vignettes to account for the additions.

prune_vertices
now has an option to avoid creating circles when pruning.  Several updates and quality of life improvements for building very large graphs faster.
 Added the
export()
method, that allows one to export a MetricGraph object as ansf
,sp
orSSN2
object.  Added wrappers for
leaflet
andmapview
as methods.  Added
get_edges()
andget_vertices()
methods were created, that return the edges and vertices, respectively, in either ‘sf’, ‘sp’ or the internal formats.  Added an option
format
to theget_data()
method that allows one to also return the data insf
orsp
formats.  The
plot
method now has an argumenttype
, that now also allows one to settype
tomapview
, thus it can returnggplot2
,plotly
andmapview
objects.  Adding methods to do data manipulation on weights,
mutate_weight
,select_weights
,filter_weights
,summarise_weights
anddrop_na_weights
. They have aformat
argument that allows one to also returnsf
orsp
objects.  Updated the methods,
mutate
,filter
,select
,drop_na
andsummarise
to have a format argument to also returnsf
orsp
objects.  Very significative improvement on the
observation_to_vertex
method.
MetricGraph 1.3.0
CRAN release: 20240227
 Handlers were added in
add_observations()
for situations where observations are projected at the same location, specifically for theduplicated_strategy
argument.  A
simulate
method was added forgraph_lme
objects.  The possibility of fixing parameters during estimation was added.
 The
Spoints
argument inadd_observations()
has been deprecated. Now,SpatialPointsDataFrame
can be added directly in thedata
argument. 
sf
objects containing data can also be directly added using theadd_observations()
method in thedata
argument.  The option of using a
graph_lme
object to provide starting values when fitting a model usinggraph_lme()
was added.  The option of fitting a directional WhittleMatérn model with
alpha=1
when usinggraph_lme()
was added.  The
kirchhoff_weights
argument was added to obtain weights for Kirchhoff vertex conditions fromedge_weights
.  Handling of edge weights was improved. For example, if pruning changes any edge weight, a warning will be given.
 The
edgeweight_to_data()
method was added to turn edge weights into data in the internal metric graph format. 
edge_weight
andedge_width_weight
were added to theplot()
method so that plots on metric graphs can be produced with the weights providing colors to the edges, and also with (possibly different) weights providing the thickness of the edges. 
edge_weights
were added tograph_components
so that the connected components will have the correct corresponding edge weights. 
edge_weight
andedge_width_weight
were added to theplot_function()
method, where they work in a similar manner to their counterparts for theplot()
method. The difference is that the weights are plotted as piecewise constant functions.  The
prune_vertices
now has an option to not prune vertices whose edges have incompatible edge weights.  The
plot
method has aninteractive
argument that returns the 2D plot as a plotly object, which is interactive when usingggplotly
.  The dependency on the
viridis
package has been removed.
MetricGraph 1.2.0
CRAN release: 20231107
 Changed argument
data
tonewdata
inpredict
methods. The argumentdata
was deprecated.  Bugfixes on sample_spde and when adding observations based on Euclidean positions.
 Added options
vertex_unit
andlength_unit
on graph creations. Units are given in edge lengths with theget_edge_lengths()
method.  Added a method to check if the graph is a tree.
 The graph construction was thoroughly refactored. The resulting construction is faster and cleaner.
 The graph constructions now accepts list of coordinates (where the coordinates are given as either matrices or data frames),
SpatialLines
,SpatialLinesDataFrames
orMULTILINESTRING
.  Adding two options (
sf
package orsp
package) for handlinglonglat
by using thewhich_longlat
option.  Adding
crs
(if usingsf
) andproj4string
(if usingsp
) for handling general coordinate reference systems.  Moving
data
to theprivate
environment.  Several data manipulation helper tools and methods were introduced, together with a vignette with a brief tutorial on these tools.
 The method
mesh_A()
has been deprecated, usefem_basis()
instead.  Several quality of life improvements.
 Improved the
plot()
method with the optionplotly=TRUE
.  Improved the
plot_function()
method to acceptdata
andnewdata
.  Included a
process_data()
method for metric graphs  Renamed the data internal structure from “__group”, “__edge_number”, “__distance_on_edge”, “__coord_x”, “__coord_y” to “.group”, “.edge_number”, “.distance_on_edge”, “.coord_x” and “.coord_y”.
 Added an “advanced grouping” option, in which the group variable can be a combination of several columns.
 Improved graph_lme() behavior to avoid having NaN as std.errors.
 Added check for distance consistency and, more generally, check to see if the graph has euclidean edges.
 Added method
get_groups()
to get the unique groups, and also to retrieve the columns that were used to create the group variable.  Added the
get_data()
method to get the data in a userfriendly manner.  Added
glance()
andaugment()
methods forgraph_lme()
objects.  Added
get_vertices_incomp_dir()
method to return vertices with incompatible directions.  Added
print()
,summary()
,compute_characteristics()
,check_euclidean()
,check_distance_consistency()
methods.  Added support for edge weights.
 Created
vertices
element in the metric graph object, containing information such as degrees, indegrees, outdegrees.  Created
print
methods foredges
,vertices
, and for their entries.  Added the
improve_plot
option onplot_function
.  Added support for discontinuous meshes (at the vertices).
 Added support for discontinuous functions (at the vertices) for
plot_function()
.