landscape: Aggregating the maps of a conceptmaps object into a concept...

Description Usage Arguments Value Examples

Description

landscape transforms a set of concept maps into a concept landscape using one of several possible methods. Depending on the value of result and accumulation or amalgamation is performed on the concept map data. The amalgamation forms a weighted graph based on the unified set of concepts. An accumulation transforms each concept map into a vector and returns a matrix of these vectors. Using FUN the process of transformation can be influenced in both cases.

Usage

1
landscape(maps, result = c("graph", "matrix"), mode, FUN = NULL)

Arguments

maps

A conceptmaps object.

result

Either "graph" or "matrix" defines the return type and the method of aggregation. An amalgamation results in a weighted graph and an accumulation results a matrix.

mode

If result is "graph", it can be either "directed" or "undirected" deciding how the graph should be formed. First, a weight matrix is formed from the set of concept maps. If FUN is NULL, the weights simply reflect the number of maps in which a given edge is present. Otherwise, FUN must be a function that accepts three parameters and returns a numeric value. For the first parameter the current conceptmap object will be passed and for the second and third parameters the start and end concepts of an edge is passed. The return value of the function will then be added to the weight matrix. If result is "matrix", it can be one of "graph.sim", "concept.vector", "edge.vector" or "custom". "graph.sim" return the graph similarity matrix, "concept.vector" and "edge.vector" return the concept matrix or edge matrix respectively. Finally, "custom" can be used for arbitrary transformations: For each map, the function passed to FUN and the resulting vector is forming a row of the returned matrix.

FUN

If result is "matrix" and mode is "custom", a function with one parameter of type conecptmap must be given that is called for each of the consituent maps. The function must return a numeric vector of equal length for all maps of a conceptmaps object.

Value

Depending on result either an igraph object or a numeric matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Create concept maps from three random graphs
require("igraph")
g1 = set.vertex.attribute(erdos.renyi.game(5, 0.7, type="gnp"), "name", value=1:5)
g2 = set.vertex.attribute(erdos.renyi.game(5, 0.7, type="gnp"), "name", value=1:5)
g3 = set.vertex.attribute(erdos.renyi.game(5, 0.7, type="gnp"), "name", value=1:5)

#Create conceptmaps object from three conceptmap objects
cms = conceptmaps(list(conceptmap(g1), conceptmap(g2), conceptmap(g3)))

landscape(cms, result="graph", mode="undirected")

landscape(cms, result="matrix", mode="concept.vector")

comato documentation built on May 2, 2019, 6:52 a.m.