R: Edit the Layout of a Haplotype Network

replot {pegas} | R Documentation

## Edit the Layout of a Haplotype Network

### Description

This function makes possible to change the layout of a haplotype network interactively or with specified coordinates.

### Usage

    replot(xy = NULL, ...)

### Arguments

`xy` | an optional list with vectors names `x` and `y` (or `xx` and `yy`) giving the coordinates of the nodes.
`...` | further arguments passed to `plot`.

### Details

This function can be used in two ways. By default (i.e., `replot()`), the user can edit a plotted haplotype network by clicking with the mouse on the graphical window: a message is printed asking to click once close to the node to move and then clicking again where this node should be placed (careful: two separate single clicks). Editing is stopped with a right click.

The second possible use is to specify the new coordinates of the nodes with the argument `xy`, typically, from a previous call to `replot` (see examples).

### Value

a named list with two numeric vertors (`x` and `y`).

### Author(s)

Emmanuel Paradis

### See Also

`haploNet`, `haploFreq`

### Examples

    ## Not run:
    data(woodmouse)
    net <- haploNet(haplotype(woodmouse))
    plot(net)
    o <- replot() # interactive
    ## click to rearrange the network at will...
    ## then do a different plot using the same coordinates:
    plot(net, bg = "red", labels = FALSE, show.mutation = 2)
    replot(o) # not interactive

    ## End(Not run)

[Package pegas version 0.13 Index]