reorder_by_vector: Reorder a Muller plot dataframe by a vector

Description Usage Arguments Value Author(s) See Also Examples

View source: R/MullerPlot.R

Description

Reorder a Muller plot dataframe by a vector

Usage

1

Arguments

df

Dataframe with column names "Identity", "Parent", and either "Generation" or "Time", in which each Identity appears exactly twice

vector

Vector of Identity values

Value

The reordered dataframe.

Author(s)

Rob Noble, robjohnnoble@gmail.com

See Also

path_vector

Examples

1
2
3
4
5
6
7
8
df <- data.frame(Generation = c(rep(0, 6), rep(1, 6)), 
 Identity = rep(1:6,2), Population = c(1, rep(0, 5), 10, rep(1, 5)))
df <- rbind(df, df) # duplicate rows
require(dplyr)
df <- arrange(df, Generation) # put in chronological order
edges1 <- data.frame(Parent = c(1,1,1,3,3), Identity = 2:6) # adjacency matrix
path <- path_vector(edges1) # path through the adjacency matrix
reorder_by_vector(df, path)

ggmuller documentation built on Sept. 5, 2019, 9:04 a.m.