clockrate_reg_plot {EvoPhylo} | R Documentation |

## Plot regression lines between sets of rates

### Description

Displays a scatterplot and fits regression line of one set of clock rates against another, optionally displaying their Pearson correlation coefficient (r) and R-squared values (R^2).

### Usage

```
clockrate_reg_plot(rate_table, clock_x, clock_y,
method = "lm", show_lm = TRUE,
...)
```

### Arguments

`rate_table` |
A table of clock rates, such as from the output of |

`clock_x` , `clock_y` |
The clock rates that should go on the x- and y-axes, respectively. |

`method` |
The method (function) used fit the regression of one clock on the other. Check the |

`show_lm` |
Whether to display the Pearson correlation coefficient (r) and R-squared values (R^2) between two sets of clock rates. |

`...` |
Other arguments passed to |

### Details

`clockrate_reg_plot()`

can only be used when multiple clocks are present in the clock rate table. Unlike `clockrate_summary`

and `clockrate_dens_plot`

, no "clade" column is required.

### Value

A `ggplot`

object, which can be modified using ggplot2 functions.

### See Also

`vignette("rates-selection")`

for the use of this function as part of an analysis pipeline.

### Examples

```
# See vignette("rates-selection") for how to use this
# function as part of an analysis pipeline
data("RateTable_Means_3p_Clades")
#Plot correlations between clocks 1 and 3
clockrate_reg_plot(RateTable_Means_3p_Clades,
clock_x = 1, clock_y = 3)
#Use arguments supplied to geom_smooth():
clockrate_reg_plot(RateTable_Means_3p_Clades,
clock_x = 1, clock_y = 3,
color = "red", se = FALSE)
```

*EvoPhylo*version 0.3.2 Index]