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.
eco.rankplot(input, XY, xlabel = NULL, ylabel = NULL, title = NULL, legendlabel = NULL, background = c("grey", "white"), ...) # S4 method for 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 numeric,dataframeORmatrix,missing eco.rankplot(input, XY, xlabel, ylabel, title, legendlabel, background = c("grey", "white"), interactivePlot = TRUE) # S4 method for factor,dataframeORmatrix,missing eco.rankplot(input, XY, xlabel, ylabel, title, legendlabel, background = c("grey", "white"), interactivePlot = TRUE)
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 |
rescaled | rescale values to [-1, 1] range? |
ns | Color for non significant individuals, when significant = TRUE.
This argument can be used with |
interactivePlot | Show an interactive plot via plotly? (default: TRUE) |
# 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 # }