View source: R/05.network&graph.R
get.net | R Documentation |
Create a network (either an object of class network
from the package network
or a graph
object from the package igraph
) from a FF, FO, or FM matrix
get.net(
x,
vertex.size = NULL,
vertex.colour = NULL,
edge.width = NULL,
edge.greyscale = NULL,
format = c("igraph", "network"),
directed = TRUE,
loops = FALSE,
weighted = any(!x@M %in% c(0, 1)),
...
)
x |
A matrix-like object produced by |
vertex.size |
Which piece of information on the firms should be used to represent the nodes' size (see Details). |
vertex.colour |
Which piece of information on the firms should be used to represent the nodes' colours (see Details). |
edge.width |
Whether to use the edges' width to represent tie strength. Defaults to |
edge.greyscale |
Whether to use the edges' colour to represent tie strength through a grey scale. Defaults to |
format |
Which format to use for the network. Possible values: |
directed |
Whether the network should be directed. Defaults to |
loops |
Whether the network should have loops. Defaults to |
weighted |
Whether the ties/edges should be weighted. Defaults to |
... |
Aliases to the other parameters and additional settings (see Details). |
This function allows for a number of additional arguments.
A network in the desired format
vertex.colour
and vertex.size
The pieces of information that is possible to pass to vertex.size
and vertex.colour
are:
capitalisation
, will be arranged into steps (see capitalisation.bins
below)
revenue
, will be arranged into steps (see revenues.bins
below)
legal_form
sector
currency
edge.width
and edge.greyscale
The pieces of information that is possible to pass to edge.width
and edge.greyscale
are:
- capitalisation
- revenue
vertex.size
The effect of the additional parameters that modify the behaviour of vertex.size
are:
vertex.size.max
(defaults to 5
) :
if vertex.size
or one of its aliases is specified, this is the size of the biggest vertex;
if neither vertex.size
nor any of its aliases is given, this is the size of ALL vertices.
vertex.size.min
(defaults to 1
):
if vertex.size
or one of its aliases is specified, this is the size of the smallest vertex;
if neither vertex.size
nor any of its aliases is given, it is ignored.
vertex.colour
The only additional parameter related to vertex.colour
is vertex.colour.palette
.
It supports a vector of RGB or named colours (see colours
for all named colours in R
).
It also accepts complete calls to functions that return a such a vector like RColorBrewer::brewer.pal(n, name)
or viridisLite::viridis(n, option)
.
If the palette is too short, it will be extended automatically using colorRampPalette
.
If the palette is not declared, but this arguemnt is TRUE
, it will defaulr to the following vector of colours:
#00204D
, Oxford Blue
#31446B
, Police Blue
#666970
, Dim Gray
#958F78
, Artichoke
#CBBA69
, Dark Khaki
#FFEA46
, Gargoyle Gas
If the argument is FALSE
, NULL
or NA
, the vertex will be coloured of #081677
(Gentian blue).
edge.width
edge.width.max
(defaults to 5
) :
if edge.width
or one of its aliases is specified, this is the thickness of the thickest edge;
if neither edge.width
nor any of its aliases is given, this is the thickness of ALL edges
edge.width.min
(defaults to 1
):
if edge.width
or one of its aliases is specified, this is the thickness of the slimmest edge;
if neither edge.width
nor any of its aliases is given, it is ignored.
edge.greyscale
edge.greyscale.darkest
(defaults to 5
):
if edge.greyscale
or one of its aliases is specified, this is the thickness of the thickest edge;
if neither edge.greyscale
nor any of its aliases is given, this is the thickness of ALL edges
edge.greyscale.fairest
(defaults to 1
):
if edge.greyscale
or one of its aliases is specified, this is the thickness of the slimmest edge;
if neither edge.greyscale
nor any of its aliases is given, it is ignored.
Several aliases are accepted for all arguments, except M
:
for vertex.size
: node.size
for vertex.colour
: vertex.color
, node.colour
, and node.color
;
for edge.width
: tie.width
for edge.greyscale
: tie.grayscale
, tie.greyscale
, and edge.grayscale
Telarico, Fabio Ashtar
FF.net FF.net.custom FF.graph FF.graph.custom
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.