Produces ggplots and/or SVG source code with IDEA data produced by either compute_idea()
or old_idea()
call.
Usage
plot_idea(IDEA_data, choices = c("dimensions", "trees", "radars"))
Arguments
- IDEA_data
an IDEA_data or IDEA_group_data object
- choices
Which type of plots should be produced ? Can be either "dimensions", "trees" or "radars" or a combination of these 3. Ignored if IDEA_data is of class
IDEA_group_data
.
Value
a named list of plots of class IDEA_plots
or IDEA_group_plots
. The algorithm also adds a "data" attribute containing data introduced in the input of this function.
Details
This function will produce different plots depending on whether the input data is of class IDEA_data
or IDEA_group_data
.
The IDEA_data
class implies that the data comes from an individual analysis pipeline, so individual plots will be produced according to the user's choices specified in the function call :
- dimensions
This option will produce histograms for dimensions, components, and indicators along with a polarised synthetic representation for components.
- trees
This option will produce the colored trees describing the qualitative agregation in the property approach.
- radars
This option will produce polarised histograms (also called 'radars') giving the score (in %) of each indicator, grouped by property
Important note : All 3 types of plots are required for the "report" option of the write_idea()
function.
The IDEA_group_data
class can only be generated by a "diag_idea()
" group call which will iterate either "read_idea() |> compute_idea()
" or "old_idea()
" on each data file before aggregating results and assigning this grouped class.
As the IDEA_group_data
class implies that the data comes from a group analysis pipeline, the choices
argument will be ignored. The plots produced for the dimension approach are almost the same as in the individual analysis pipeline but with the histograms being replaced by boxplots. Concerning properties, the only visualization currently considered as relevant is a matrix (or heatmap) of properties * farms, with the cells colored according to the qualitative evaluation for each farm for a given property.
Note that plots are using a "theme_idea()
" theme defined in this package.
A copy of the blank canvas used for colored trees can be locally exported as svg files with :
IDEATools::show_canvas()
Further information about the colored trees ans canvas can be found in this vignette :
Examples
library(IDEATools)
## Example given for a single analysis. See diag_idea() for a group analysis.
path <- system.file("example_data/idea_example_1.json", package = "IDEATools")
my_data <- read_idea(path)
computed_data <- compute_idea(my_data)
## Example without radars or dimensions
idea_plots <- plot_idea(computed_data, choices = c("trees"))