Learn R Programming

comato (version 1.1)

as.matrix.conceptmaps: Convert a conceptmaps object to a matrix

Description

as.matrix converts a conceptmaps object into a matrix. The output can be fed back into conceptmaps.matrix.

Usage

# S3 method for conceptmaps
as.matrix(x, ...)

Arguments

x

A conceptmaps object.

...

-

Value

A matrix with 4 columns and one row for each proposition of one of the concept maps. The 4 columns contain an id of the map (starting from 1) and then the start and end node of each proposition as well as the label of the edge (as character vectors).

Examples

Run this code
# NOT RUN {
data = rbind(
 cbind("1", "Object", "Class", "is instance of"),
 cbind("1", "Object", "Attribute", "has"),
 cbind("2", "Class", "Attribute", "possesses"),
 cbind("2", "Attribute", "Data-type", "has"),
 cbind("3", "Object", "Class", "is instance of")
 )
 cms = conceptmaps(data)
 as.matrix(cms) 
# }

Run the code above in your browser using DataLab