get.ggplot: Get ggplot objects from 'get.data'

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/get.ggplot.R

Description

get.ggplot generates ggplot objects from get.data data-set

Usage

1
2
3
4
5
6
7
8
9
get.ggplot(data, data_network = NULL, correlated_group = NULL,
  merge_g_and_s = TRUE, ggplot.type = NULL, ggplot.display = NULL,
  ggplot.on = "son", x.axis = NULL, in.col = NULL, vec_variables = NULL,
  nb_parameters_per_plot_x.axis = NULL,
  nb_parameters_per_plot_in.col = NULL, vertex.size = 3,
  vertex.color = "year", organise.sl = FALSE, labels.on = "son",
  hide.labels.parts = "all", labels.sex = TRUE,
  labels.generation = "local", labels.size = 3, location.map = "france",
  pie.size = 0.5)

Arguments

data

output from get.data with query.type = "network" or query.type = "data-...".

data_network

for ggplot.type == "data-pie.on.network", the network ot plot the variable coming from data argument (that must be "data-classic").

correlated_group

Name of the group of correlation in data. NULL by default meaning that shinemas2R::get.data()$data$data is taken.

merge_g_and_s

Fuse germplasm and selection name information in a column named germplasm. TRUE by default.

ggplot.type

the type of plot you wish. NULL by default: according to the type of data, it will be "network-all" or "data-all". "X-all" means that all the "X-" objects are done. The possibilites are:

  • for "network-": "network-network", "network-reproduction-sown", "network-reproduction-harvested", "network-reproduction-positive-inter-selected", "network-reproduction-negative-inter-selected", "network-reproduction-crossed", "network-diffusion-sent", "network-diffusion-received", "network-diffusion-relation", "network-mixture", "network-positive-intra-selected", "network-Mdist".

  • for "data-":

    • "data-barplot"

    • "data-boxplot"

    • "data-interaction"

    • "data-radar"

    • "data-biplot"

    • "data-pie.on.map" (only for data-classic).

    • "data-pie.on.network" (only for data-classic).

ggplot.display

For "network-" data: "barplot", "map". It can be a vector of several elements i.e. c("barplot", "map"). NULL by default: both are done.

ggplot.on

For "data-" type. "father" or "son" depending on which seed-lot you want to plot.

x.axis

factor displayed on the x.axis of a plot: "germplasm", "year" or "person" referring to the attributes of a seed-lots. If NULL, all the combinaison are done for x.axis and in.col.

in.col

factor displayed in color of a plot: "germplasm", "year" or "person" referring to the attributes of a seed-lot. If NULL, in.col is not displayed. Note that it is compulsory for data-biplot and data-radar as in these cases x.axis is not used.

vec_variables

For "data-" type : a vector of variables displayed.

nb_parameters_per_plot_x.axis

The number of parameters per plot on x axis arguments

nb_parameters_per_plot_in.col

The number of parameters per plot for in.col arguments

vertex.size

For ggplot.type = "network", size of the vertex

vertex.color

For ggplot.type = "network", color of the vertex. It can be chosen according to "person", "germplasm" or "year". If NULL, it is in black.

organise.sl

For ggplot.type = "network", organizes seed-lots for an easier visualization

labels.on

"son" or "father". For ggplot.type = "data-biplot" chooses if labels are on son or father seed-lots. For other "data-..." plots, there are no labels as it is managed by x.axis and in.col.

hide.labels.parts

For ggplot.type = network-network and data-biplot. Parts of the label hidden: "germplasm", "person", "year", "person:germplasm", "year:germplasm", "person:year", "all". "all" means that no labels are dispayed. If NULL labels are displayed. Labels are based on seed-lots names under the form germplasm_year_person_digit. For "data-biplot", the default value is NULL. For an easier visualization, digit is never displayed unless you choose NULL. Note that with ggplot.type "network-" and ggplot.display = "map", hide.labels.part can be NULL or "all" as only person can be displayed.

labels.sex

For ggplot.type = "network-network". If TRUE, displays the sex of the seed-lot if it has been used in a cross. Nothing is displayed if hide.labels.parts = "all".

labels.generation

For ggplot.type = "network-network". If "local", displays generation number on a given location for each reproduction. If "total", displays generation number since the information is known for each reproduction. A confidence in the information is given between brackets: 0 or 1. For exemple F8 (0) for the 8th generation with a confidence of 0.

labels.size

Size of the labels

location.map

Location of the map. See ?map_data, argument map, for more details.

pie.size

Size of the pie when using pies

Details

For data coming from query.type = "data-S" and "data-SR", NA are put when there are no data for bouquet AND vrac

For data-radar, it is the mean which is represented

For data-biplot note that no plots are possible for between raw data linked to individuals and raw data linked to relation.

Value

The function returns a list with several ggplot objects according to the data and ggplot.type used.

  1. For "network-" type it returns a list with ggplot objects representing the network and for each relation (i) barplots with the number of populations (ii) maps for each year

    • the network (ggplot.type = "network-network")

    • a series of ggplots for reproduction:

      • sown seed-lots (ggplot.type = "network-reproduction-sown")

      • harvested seed-lots (ggplot.type = "network-reproduction-harvested")

      • positive inter selected seed-lots (ggplot.type = "network-reproduction-positive-inter-selected")

      • negative inter selected seed-lots (ggplot.type = "network-reproduction-negative-inter-selected")

      • seed-lots involved in crosses (ggplot.type = "network-reproduction-crossed")

    • a series of ggplots for diffusion representing:

      • the seed-lots sent (ggplot.type = "network-diffusion-sent")

      • the seed-lots received (ggplot.type = "network-diffusion-received")

      • the relation between seed-lots on maps (ggplot.type = "network-diffusion-relation"). The size of the arrows is proportionnal to the number of diffusions.

    • a series of ggplots for mixtures representing:

      • the seed-lots coming from 'real' mixtures (ggplot.type = "network-mixture-real")

      • the seed-lots coming from mixtures of replication (ggplot.type = "network-mixture-rep")

      • the seed-lots coming from all mixtures (ggplot.type = "network-mixture-all")

    • a series of ggplots for selection (ggplot.type = "network-positive-intra-selected")

  2. For "data-" type, plots are displayed for each variable of vec_variables for "data-barplot", "data-boxplot", "data-interation". It is all possible pairs for "data-biplot". It is all the variables for "data-radar".

Author(s)

Pierre Riviere

See Also

get.data

Examples

1
# See the vignette

priviere/shinemas2R documentation built on Oct. 17, 2017, 11:24 a.m.