This function produces a line plot for a graphical interpretation of the genotype-vs-environment interaction. By default, environments are in the x axis whereas the genotypes are depicted by different lines. The y axis contains the value of the selected variable. A heatmap can also be created.
ge_plot(
.data,
env,
gen,
resp,
type = 1,
values = TRUE,
text_col_pos = c("top", "bottom"),
text_row_pos = c("left", "right"),
average = TRUE,
row_col = TRUE,
row_col_type = c("average", "sum"),
order_g = NULL,
order_e = NULL,
xlab = NULL,
ylab = NULL,
width_bar = 1.5,
heigth_bar = 15,
plot_theme = theme_metan(),
colour = TRUE
)
An object of class gg, ggplot
.
The dataset containing the columns related to Environments, Genotypes, replication/block and response variable(s).
The name of the column that contains the levels of the environments
The name of the column that contains the levels of the genotypes.
The response variable.
The type of plot type = 1
for a heatmap or type = 2
for a line plot.
Show the values in the plot? Defaults to TRUE
.
The position of the text in the rows and columns. The defaults show the text at left and top.
Show the average values for environments and genotypes?
Defaults to TRUE
.
Shows row/column and defines what to show. Defaults to 'average'.
A charactere vector indicating the order of the levels for genotypes and environments, respectively. This can be used to change the default ordering of rows and columns.
The labels for x and y axis, respectively.
The width and heigth of the legend bar, respectively.
The graphical theme of the plot. Default is
plot_theme = theme_metan()
. For more details,see
ggplot2::theme()
.
Logical argument. If FALSE
then the plot will not be
colored.
Tiago Olivoto tiagoolivoto@gmail.com
# \donttest{
library(metan)
ge_plot(data_ge2, ENV, GEN, PH)
ge_plot(data_ge, ENV, GEN, GY, type = 2)
# }
Run the code above in your browser using DataLab