rankplot-methods: Rankplot graphs

Description Usage Arguments Author(s) Examples

Description

This function generates a plot for a numeric or factor variable. A data frame/matrix with XY coordinates is required. The X and Y axes in the plot correspond to the rank of the X and Y coordinates, respectively.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
eco.rankplot(input, XY, xlabel = NULL, ylabel = NULL, title = NULL,
  legendlabel = NULL, background = c("grey", "white"), ...)

## S4 method for signature 'eco.lsa,missing,missing'
eco.rankplot(input, XY, xlabel, ylabel,
  title, legendlabel, background = c("grey", "white"), significant = TRUE,
  rescaled = FALSE, ns = NULL, interactivePlot = TRUE)

## S4 method for signature 'numeric,dataframeORmatrix,missing'
eco.rankplot(input, XY, xlabel,
  ylabel, title, legendlabel, background = c("grey", "white"),
  interactivePlot = TRUE)

## S4 method for signature 'factor,dataframeORmatrix,missing'
eco.rankplot(input, XY, xlabel,
  ylabel, title, legendlabel, background = c("grey", "white"),
  interactivePlot = TRUE)

Arguments

input

Numeric/factor variable.

XY

Data frame or matrix with X-Y coordinates.

xlabel

Optional label for x axis.

ylabel

Optional label for y axis.

title

Optional title label.

legendlabel

Optional legend label.

background

Background color ("grey" or "white")-

...

Additional elements to the generic.

significant

Should only the individuals with significant result be colored?. This argument can be used with eco.lsa results. Default TRUE

rescaled

rescale values to [-1, 1] range?

ns

Color for non significant individuals, when significant = TRUE. This argument can be used with eco.lsa results.

interactivePlot

Show an interactive plot via plotly? (default: TRUE)

Author(s)

Leandro Roser [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
data(eco3)

# The data set eco3 has 50 points in two sites, 
# but points are not visible in a usual X-Y plot, 
# due to the small distance among them in relation to the large
# distance between sites

var <- eco3[["P"]][,1]
plot(eco3[["XY"]], col = var)
x <- sample(1:100, 30)
y <- sample(1:100, 30)

# in a rankplot graph, the inter-individual distances are
# reduced to a single scale
rankeco3 <- eco.rankplot(var, eco3[["XY"]])
rankeco3

# the rankplot method supports the use of ggplot2 syntax with ggplot2 graphs
require(ggplot2)
rankeco3 <- eco.rankplot(var, eco3[["XY"]], interactivePlot = FALSE)
rankeco3 <- rankeco3 + theme_bw() + theme(legend.position="none")
rankeco3

## End(Not run)

EcoGenetics documentation built on June 24, 2018, 5:02 p.m.