Get all important data for plotting a Cognitive Map in ggplot

data.ggCMap(
  project,
  min.weight = 1,
  filters = NULL,
  units = "all",
  weighted.icm = FALSE,
  label = "name",
  minlen = 1,
  fontsize = 16,
  shape = "box",
  layoutType = "neato",
  vertex.filter = NULL,
  edge.filter = NULL,
  limit.to.filters = FALSE,
  level = 0
)

Arguments

project

A QDA project, a list as generated by the ProjectCMap function.

min.weight

A integer that will determine the minimum (>=) weight of relationships that will be taken into account. Relationships with a lower weight (<) will not be shown. Default is set to 1 (i.e. all relationships are shown).

filters

A list of named strings that will filter the relationships showed in the SCM. e.g. =list(coding_class = "A_coding_class", document_part = "A_document_part")=. To date, these filters are linked to the nature of relationships.

units

A string vector giving the names of the units (i.e. classes linked to documents) that will be include in the SCM. It is a second type of filter.

weighted.icm

A boolean. If FALSE, the weight of the relationships in the ICM will be fixed to 1.

label

A character string that defines the text that will be print in the variables (vertex) of the cognitive maps. It can be "num", "name" or "numname" (which is of the form "NUM - Name"). The default is "num"

minlen

A graphical parameter that defines a relative lenght between the variable of the cognitive maps. See help from RGraphViz package.

fontsize

The fontsize of vertices (concepts), in r-base plot

shape

The shape of the verices (concepts), in r-base plot

layoutType

Type of graph. See detail in RGraphViz. Can be 'neato', 'dot', 'twopi', 'circo', and 'fdp'. The default is 'neato'.

vertex.filter

A vector of integers or characters given the 'id' of vertices (concepts) that will be included in the map. By default, all vertices are included (vertex.filter = NULL)

edge.filter

A vector of characters given the name "i~j" of edges (relationships from "i" to "j") that will be included in the map. By default, all edges are included (edge.filter = NULL)

limit.to.filters

A logical that will impact the position of the vertices. FALSE (the default) will filter vertices and edges (vertex.filter, edge.filter) keeping the position they would have in the unfiltered cognitive map (interesting with background). TRUE will fully re-compute the position of the vertices, building a cognitive map in its own (better readability).

level

0 or 1. Filter the edge/vertices at x level around the filtered edges/vertices (==Not implemented yet==)

Value

A list of two data frames : -edges -vertex. In each of these data frames, the main columns are linked to the coordinates of vertex (x, y, x.from, y.from, x.to, y.to)

Details

Get all important data for plotting a Cognitive Map in ggplot

Examples

project_name <- "a_new_project"
main_path <- paste0(system.file("testdata", package = "cogmapr"), '/')
my.project <- ProjectCMap(main_path, project_name)

data.ggCMap(my.project)
#> $edges
#>   from to edge coding_weight   name.to x.to y.to name.from x.from y.from
#> 1    1  2  1~2             4 Concept B  321  196 Concept A     27    152
#> 2    1  3  1~3             3 Concept C  196   27 Concept A     27    152
#> 3    1  4  1~4             2 Concept D  152  321 Concept A     27    152
#> 4    2  4  2~4             1 Concept D  152  321 Concept B    321    196
#> 5    3  2  3~2             1 Concept B  321  196 Concept C    196     27
#> 6    3  4  3~4             1 Concept D  152  321 Concept C    196     27
#>        midX      midY
#> 1 173.34921 172.61523
#> 2 111.23970  88.46226
#> 3  91.16983 238.32412
#> 4 235.05331 256.49384
#> 5 262.33820 111.54590
#> 6 177.26180 177.00607
#> 
#> $vertex
#>   num      name concept.description  concept.class   x   y
#> 1   1 Concept A            Descr. A       Classe I  27 152
#> 2   2 Concept B            Descr. B       Classe J 321 196
#> 3   3 Concept C            Descr. C       Classe J 196  27
#> 4   4 Concept D             Descr.D Concetp_type_Y 152 321
#> 
data.ggCMap(my.project, min.weight = 3)
#> $edges
#>   from to edge coding_weight   name.to x.to y.to name.from x.from y.from
#> 1    1  2  1~2             4 Concept B  294  362 Concept A    121    209
#> 2    1  3  1~3             3 Concept C   27   27 Concept A    121    209
#>        midX     midY
#> 1 210.71810 281.8082
#> 2  75.41679 116.6207
#> 
#> $vertex
#>   num      name concept.description  concept.class   x   y
#> 1   1 Concept A            Descr. A       Classe I 121 209
#> 2   2 Concept B            Descr. B       Classe J 294 362
#> 3   3 Concept C            Descr. C       Classe J  27  27
#> 4   4 Concept D             Descr.D Concetp_type_Y  NA  NA
#> 
data.ggCMap(my.project, edge.filter = "4")
#> $edges
#>   from to edge coding_weight   name.to x.to y.to name.from x.from y.from
#> 1    1  4  1~4             2 Concept D  152  321 Concept A     27    152
#> 2    2  4  2~4             1 Concept D  152  321 Concept B    321    196
#> 3    3  4  3~4             1 Concept D  152  321 Concept C    196     27
#>        midX     midY
#> 1  88.88088 240.7710
#> 2 238.14462 260.7528
#> 3 173.25291 175.6153
#> 
#> $vertex
#>   num      name concept.description  concept.class   x   y
#> 1   1 Concept A            Descr. A       Classe I  27 152
#> 2   2 Concept B            Descr. B       Classe J 321 196
#> 3   3 Concept C            Descr. C       Classe J 196  27
#> 4   4 Concept D             Descr.D Concetp_type_Y 152 321
#> 
data.ggCMap(my.project, units = "Belgium")
#> $edges
#>   from to edge coding_weight   name.to x.to y.to name.from x.from y.from
#> 1    1  2  1~2             3 Concept B  321  196 Concept A     27    152
#> 2    1  3  1~3             2 Concept C  196   27 Concept A     27    152
#> 3    1  4  1~4             1 Concept D  152  321 Concept A     27    152
#> 4    2  4  2~4             1 Concept D  152  321 Concept B    321    196
#> 5    3  2  3~2             1 Concept B  321  196 Concept C    196     27
#> 6    3  4  3~4             1 Concept D  152  321 Concept C    196     27
#>        midX      midY
#> 1 171.63746 171.91874
#> 2 110.49152  89.99217
#> 3  88.59957 238.40728
#> 4 237.40685 259.51108
#> 5 258.93043 111.93126
#> 6 175.85930 171.65221
#> 
#> $vertex
#>   num      name concept.description  concept.class   x   y
#> 1   1 Concept A            Descr. A       Classe I  27 152
#> 2   2 Concept B            Descr. B       Classe J 321 196
#> 3   3 Concept C            Descr. C       Classe J 196  27
#> 4   4 Concept D             Descr.D Concetp_type_Y 152 321
#>