Learn R Programming

archeofrag (version 1.2.0)

make_frag_object: Makes a "frag.object" object.

Description

Makes a "frag.object" object.

Usage

make_frag_object(cr, sr, fragments)

Value

An object of "frag.object" class.

Arguments

cr

A matrix or a data frame with two columns giving the vertex id of each pair of connected fragments.

sr

Optional. A matrix or a data frame with two columns: the first gives the fragment id, the second gives the "similarity group" id. Optional if mode is "cr".

fragments

A matrix or a data frame with information about each fragment. The first column must contain the fragments' id.

Author

Sebastien Plutniak <sebastien.plutniak at posteo.net>

Details

This function checks the dataset and returns a "frag.object" which can be turned into a fragmentation graph using the make_cr_graph, make_sr_graph, or make_crsr_graph functions.

Examples

Run this code
cr.df <- matrix(c(1,2, 1,3, 2,3, 4,5, 4,6, 7,8), ncol=2, byrow=TRUE)
sr.df <- matrix( c(1,1, 9,1, 10,1, 11,2, 12,2, 13,2), ncol=2, byrow=TRUE)
fragments.df <- data.frame(1:13, letters[1:13]) 

make_frag_object(cr=cr.df, fragments=fragments.df)
make_frag_object(cr=cr.df, sr=sr.df, fragments=fragments.df)

Run the code above in your browser using DataLab