- Fix bug in
get_model_data()calling objects of classmgidiwithwhat = "PCA". - Improve output of
gmd()forggeobjects. - New option
projectioningmd()forggeobjects to get the projection of each genotype in the AEC coordinates.
progress()andrun_progress()for text progress bar in the terminal.rbind_fill_id()To implement the common pattern ofdo.call(rbind, dfs)with data frame identifier and filling of missing values.hmgv(),rpgv(),hmrpgv(),blup_indexes()to compute stability indexes based on a mixed-effect model.mps()andmtmps()for uni- and multivariate-based mean performance and stability in multi-environment trials.
ge_reg()now returns hypotesis testing for slope and deviations from the regression. Thanks to @LeonardoBehring and @MichelSouza for the suggestion.Resende_indexes()now removeNAs before computing harmonic and arithmetic means.- Improved outputs in
plot_scoresthat now has ahighlightargument to highlight genotypes or environments by hand. Thanks to Ibrahim Elbasyoni for his suggestions. - Licecycle badges added to the functions' documentation.
- Fix bug in
clustering()when using withbyargument and defacultnclustargument. get_model_data()now extract BLUEs from objects computed withgamem()andgamem_met(). Thanks to @MdFarhad for suggesting me this improvement.g_simula()andge_simula()now have ares_effto control the residual effect.mgidi()now have an optionalweightsargument to assign different weights for each trait in the selection process. Thanks to @MichelSouza for his suggestion.
get_levels_comb()to get the combination of the levels of a factor.g_simula()to simulate replicated genotype data.add_row_id()to add a column as the row id.remove_rownames(),column_to_rownames()andrownames_to_column()to deal with rownames.
- New argument
sel.var()incorr_ci()to filter correlations with a selected variable - New arguments
fillandposition.fillinplot_ci()to fill correlations by levels of a factor variable. - Remove deprecated arguments in
arrange_ggplot()andgge(). - New argument
themein arrange_ggplot()to control the theme of the plot. - Include
byargument ingafem(). mgid()now understands models of classgafem_grouped.- Fix bug in
get_levels()to get the levels even if the variable is not a factor.
set_union(),set_difference()andset_intersect()for set operations with many sets.venn_plot()to produce Venn diagrams.
gge()now have abyargument and understand data passed fromgroup_by.- New arguments
col.strokeandsize.strokeinplot.gge() gtbandgytbnow produces biplots with lines for genotype's vectors intype = 1.get_model_data()now understand objects of classfai_blupandsh.
get_dist()to get distance matrices from objects of classclustering.get_corvars()to get normal, multivariate correlated variables.get_covmat()to obtain covariance matrix based on variances and correlation values.as_numeric(),as_integer(),as_logical(),as_character(), andas_factor()to coerce variables to specific formats quickly.n_valid(),n_missing(), andn_unique()to count valid, missing, and unique values, respectively.tidy_colnames()to clean up column names. It is a shortcut totidy_strings()applied to the column names of a data frame.env_stratification()to perform environment stratification using factor analysis.
-
as_*()now handles vectors. -
plot.corr_coef()now shows both stars or p-values for reporting the significance of correlations. -
gamem(),gamem_met(), andwaasb()now have abyargument and understand data passed fromgroup_by. -
mtsi()andmgidi()now returns the ranks for the contribution of each factor and understand models fitted withgamem()andwaasb()using thebyargument. -
plot.mtsi()andplot.mgidi()now returns a radar plot by default when usingtype = "contribution". -
get_model_data()now returns the genotypic and phenotypic correlation matrices from objects of classwaasbandgamem. -
replace_string(),replace_number(),extract_string(), andextract_number()now accepts tidy evaluation in the new...argument.
- New functions
add_prefix()andadd_suffix()to add prefixes and suffixes to variable names, respectively. - New function
select_pred()to selects a best subset of predictor variables. - New function
acv()to compute the adjusted coefficient of variation to account for the systematic dependence of$\sigma^2$ from$\mu$ . - New function
ge_acv()to compute yield stability index based on the adjusted coefficient of variation. - New function
ge_polar()to compute yield stability index based on Power Law Residuals (POLAR) statistics. - New function
mantel_test()to performs a Mantel test between two matrices. - New arguments
prefixandsuffixinconcatenate()to add prefixes and suffixes to concatenated values, respectively. - List packages providing the Rd macros in 'Imports' instead of 'Suggests' as suggested by the CRAN team.
- Use
\doi{}markup in Rd files.
- New function
gytb()to generate the Genotype by yield*trait biplot. - New functions
row_col_mean()androw_col_sum()to add a row with the mean/sum of each variable and a column with the mean/sum for each row of a matrix or data frame. - New functions
has_zero(),remove_cols_zero(),remove_rows_zero(),select_cols_zero(),select_rows_zero(), andreplace_zero()to deal with 0s in a data frame. - Fix bug of inconsistent color legend when plotting objects of class
gge. - Include class
ggeandcan_corringet_model_data(). - New argument
positioninplot.gamem()andplot.mtsi()to control the position adjustment of the bar plot. - New argument
col.byincorr_plot()to map the color of the points by a categorical variable. - New argument
use_datain functionsmgidi(),fai_blup(), andSmith_Hazel()to control which data is used (BLUPs or phenotypic means) to compute the index. inspect()now generate a warning if zero values are observed in data.
- New functions
clip_read()andclip_write()to read from the clipboard and write to the clipboard, respectively. - New function
sum_by()to compute the sum by levels of factors. - Update wsmp.R (#7). Thank you @BartoszKozak for your contribution.
mgidi()now allows using a fixed-effect model fitted withgafem()as input data.round_cols()now can be used to round whole matrices.
plot.mgidi()can now plot the contribution for all genotypes.plot_bars()andplot_factbars()now shows the values withvalues = TRUE- Update the functions by using the new
dplyr::across() - Update citation field by including number and version of the published paper.
Smith_Hazel()andprint.sh()andplot.sh()for computing the Smith and Hazel selection index.coincidence_index()for computing the coincidence index.
get_model_data()now extracts the genotypic and phenotypic variance-covariance matrix from objects of classgamemandwaasb.fai_blup()now returns the total genetic gain and the list with the ideotypes' construction.mgidi()now computes the genetic gain when a mixed-model is used as input data.- The S3 method
plot()for objects of classmgidihas a new argumenttype = "contribution"to plot the contribution of each factor in the MGIDI index. plot_scores()now can produce a biplot showing other axes besides PC1 and PC2. To change the default IPCA in each axis use the new argumentsfirstandsecond.
plot_bars()andplot_factbars()now align vertically the labels to the error bars.fai_blup()now returns the eigenvalues and explained variance for each axis and variables into columns instead row names.- Fixes the error with
donttest{}examples. Now, the correct data set is used in the example offai_blup()
select_rows_na()andselect_cols_na()to select rows or columns with withNAvalues.mgidi()to compute the multi-trait genotype-ideotype distance index.plot_bars()to create bar plots quickly. Thanks to @MariaDiel for her suggestion.
- Deprecated functions
hm_mean()andgm_mean()removed in favour ofhmean()andgmean(), respectively. - Deprecated argument
repretired inFox(),ge_effects(),Huehn(),resp_surf(),superiority(), andThennarasu() - Deprecated argument
verboseretired inanova_ind() - Deprecated argument
regionretired inresp_surf() - Remove dependency on dendextend by using ggplot2-based graphics in
plot.wsmp(). - Update package site with pkgdown v1.5.0.
- Update documentation in
ge_plot() - Allow using
fai_blup()withgamem() - Improve checking process with
inspect() - Improve feedback for results, indicating random and fixed effects. Thanks to @NelsonJunior for his suggestion.
plot()call on objects of classgamem,waasbandwaasnow returns the variable names automatically. Thanks to @MdFarhad for suggesting me this change.plot.gamem()andplot.waasb()have a new argument (type = "vcomp") to produce a plot showing the contribution of the variance components to the phenotypic variancecv_ammi(),cv_ammif(), andcv_blup()now check for missing values and unbalanced data before computing the cross-validation. (#3)
- Fix problems from a recent upgrade of package
tibbleto version 3.0.0. get_model_data()now fills rows that don't matches across columns withNA. Thanks to @MdFarhad for his report.get_model_data()called now report mean squares, F-calculated and P-values for blocks within replicates inanova_ind().
- Factor columns can now have custom names rather than
ENV,GEN, andREPonly (#2).
gmd()a shortcut toget_model_data()gtb()to generate a genotype-by-trait biplot.gamem_met()to analyze genotypes in multi-environment trials using mixed- or random-effect models allowing unbalanced data. Thanks to @EderOliveira for his e-mail.has_class()to check if a class exists.impute_missing_val()to impute missing values in a two-way table based on Expectation-Maximization algoritms.non_collinear_vars()to select a set of predictors with minimal multicollinearity.replace_na()to replaceNAvalues quicly.random_na()to generate randomNAvalues based on a desired proportion.
gge(),performs_ammi(),waas(), andwaasb()now handle with unbalanced data by implementing a low-rank matrix approximation using singular value decomposition to impute missing entires. Imputation generates a warning message.NAvalues are checked and removed with a warning when computing stability indexes. Thanks to @MdFarhad for alerting me.- New argument
plot_resinpath_coeff()to create a residual plot of the multiple regression model. - Update the citation file to include the published official reference.
- Argument
verbosedeprecated in functionsanova_ind()andsplit_factors() - Argument
repdeprecated in functionsFox(),Huehn(),superiority(), andThennarasu(). - Deprecated argument
means_byremoved in functionscan_corr()andclustering(). - Deprecated argument
verboseremoved in functionscolindiag()andsplit_factors(). - Deprecated argument
valuesremoved in functionsdesc_stat()andfind_outliers(). - Deprecated argument
varremoved in functiondesc_wider(). - Remove dependency on lattice by using ggplot2 in
plot.resp_surf(). - An up-to-date cheat sheet was included.
alpha_color()To get a semi-transparent colorgafem()To analyze genotypes using fixed-effect models.residual_plots()A helper function to create residuals plots.stars_pval()To generate significance stars from p-valuesdoo()An alternative todplyr::dofor doing anything
cv_by()For computing coefficient of variation by levels of a factor.max_by()For computing maximum values by levels of a factor.means_by()For computing arithmetic means by levels of a factor.min_by()For computing minimum values by levels of a factor.n_by()For getting the length.sd_by()For computing sample standard deviation.sem_by()For computing standard error of the mean by levels of a factor.av_dev()computes the average absolute deviation.ci_mean()computes the confidence interval for the mean.cv()computes the coefficient of variation.hm_mean(),gm_mean()computes the harmonic and geometric means, respectively. The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals. The geometric mean is the nth root of n products.kurt()computes the kurtosis like used in SAS and SPSS.range_data()Computes the range of the values.sd_amo(),sd_pop()Computes sample and populational standard deviation, respectively.sem()computes the standard error of the mean.skew()computes the skewness like used in SAS and SPSS.sum_dev()computes the sum of the absolute deviations.sum_sq_dev()computes the sum of the squared deviations.var_amo(),var_pop()computes sample and populational variance.valid_n()Return the valid (not NA) length of a data.
colnames_to_lower(),colnames_to_upper(), andcolnames_to_title()to translate column names to lower, upper and title cases quickly.
all_lower_case(),all_upper_case(), andall_title_case()to translate strings vectors or character columns of a data frame to lower, upper and title cases, respectively.tidy_strings()Tidy up characters strings, non-numeric columns, or any selected columns in a data frame by putting all word in upper case, replacing any space, tabulation, punctuation characters by'_', and putting'_'between lower and upper cases.find_text_in_num()Find text fragments in columns assumed to be numeric. This is especially useful wheneverything()is used in argumentrespto select the response variables.
anova_ind(),anova_joint(),performs_ammi(),waas()andwaasb(), now have the argumentblockto analyze data from trials conducted in an alpha-lattice design. Thanks to @myaseen208 for his suggestion regarding multi-environment trial analysis with alpha-lattice designs.- argument
repelincluded inplot_scores()to control wheater the labels are repelled or not to avoid overlapping.
Argument means_by was deprecated in functions can_corr() and clustering(). Use means_by() to pass data based on means of factor to these functions.
- Change "#000000FF" with "#FFFFFF00" in
transparent_color() desc_stat()now handles grouped data passed fromdplyr::group_by()plot_scores()now support objects of classwaas_mean.- Include inst/CITATION to return a reference paper with
citation("metan"). - Change 'PC2' with 'PC1' in y-axis of
plot_scores(type = 2)(#1) get_model_data()now support models of classanova_jointandgafemand extract random effects of models fitted withwaasb()andgamem().- Update
plot.waasb()andplot.gamem()to show distribution of random effects. inspect(),cv_blup(),cv_ammif(), andcv_ammi()now generate a warning message saying that is not possible to compute cross-validation procedures in experiments with two replicates only. Thanks to @Vlatko for his email.plot.wsmp()now returns heatmaps created with ggplot2. Thus, we removed dependency ongplots.- Vignettes updated
- References describing the methods implemented in the package were included in description field of DESCRIPTION file as suggested by the CRAN team.
-
Minor changes
corr_plot()now don't write a warning message to the console by default.select_numeric_cols()now is used as a helper function inmetan.metannow reexportsmutate()fromdplyrpackage.get_model_data()now set default values for each class of models.- Argument
bythat calls internallysplit_factors()included to facilitate the application of the functions to each level of one grouping variable.
-
New functions
add_cols(), andadd_rows()for adding columns and rows, respectively.remove_cols(), andremove_rows()for removing columns and rows, respectively.select_cols()andselect_rows()for selecting columns and rows, respectively.select_numeric_cols(), andselect_non_numeric_cols()for selecting numeric and non-numeric variables quickly.round_cols()for rounding a whole data frame to significant figures.all_lower_case(), andall_upper_case()for handling with cases.extract_number(),extract_string(),remove_strings(),replace_number(), andreplace_string(), for handling with numbers and strings.get_level_size(), andget_levels()for getting size of levels and levels of a factor.means_by()for computing means by one or more factors quickly.ge_means()for computing genotype-environment meansge_winners()for getting winner genotypes or ranking genotypes within environments.env_dissimilarity()for computing dissimilarity between test environments.
- Reexport select_helpers
starts_with(),ends_with(),contains(),contains(),num_range(),one_of(),everything(), andlast_col(). - When possible, argument
resp(response variable(s) now support select helpers. - New helper function
sem()for computing standard error of mean. - New helper functions
remove_rows_na()andremove_cols_na()for removing rows or columns withNAvalues quickly. - New select helpers
difference_var(),intersect_var(), andunion_var()for selecting variables that match an expression. - New function
Schmildt()for stability analysis. - Plot regression slope and mean performance in objects of class
ge_reg. - Update
get_model_data()to support objects of classSchmildtandAnnicchiarico.
- Now
on.exit()is used in S3 generic functionsprint()to ensure that the settings are reset when a function is excited. - Computationally intensive parts in vignettes uses pre-computed results.
I'm very pleased to announce the release of metan 1.1.0, This is a minor release with bug fixes and new functions. The most important changes are described below.
- New function
corr_stab_ind()for computing Spearman's rank correlation between stability indexes; - New function
corr_coef()for computing correlation coefficients and p-values; - New S3 method
plot.corr_coef()for creating correlation heat maps; - New S3 method
print.corr_coef()for printing correlation and p-values; - New helper functions
make_lower_tri()andmake_upper_tri()for creating lower and upper triangular matrices, respectively. - New helper function
reorder_cormat()for reordering a correlation matrix according to the correlation coefficients; - Improve usability of
get_model_data()by supporting new classes of models. Now,get_model_data()can be used to get all statistics or ranks computed with the wrapper functionge_stats(). arrange_ggplot()now support objects of classggmatrix.- Change the default plot theme to
theme_metan() - Update function's documentation;
- Update vignettes.
- New function
arrange_ggplot()for arranging ggplot2 graphics; - New function
ge_effects()for computing genotype-environment effects; - New function
gai()for computing the geometric adaptability index; - New helper function
gm_mean()for computing geometric mean; - New helper function
hm_mean()for computing harmonic mean; - New helper function
Huehn()for computing Huehn's stability statistic; - New helper function
Thennasaru()for computing Thennasaru's stability statistic; - Improve usability of
get_model_data()by supporting new classes of models; - Update function's documentation;
- Update vignettes;
- New function
gamem()for analyzing genotypes in one-way trials using mixed-effect models; - New function
desc_wider()to convert an output of the functiondesc_stat()to a 'wide' format; - New function
Fox()for Stability analysis; - New function
Shukla()for stability analysis; - New function
to_factor()to quickly convert variables to factors; - Improve usability of
get_model_data()function; - Update function's documentation;
- Update vignettes;
The changes in this version were made based on suggestions received when metan was submitted to CRAN for the first time.
The documentation of the following functions was updated by including/updating the \value section of .Rd files.
AMMI_indexes()Annichiarico()anova_ind()as.lpcor()as.split_factors()bind_cv()can_cor()comb_vars()corr_ci()corr_plot()covcor_design()cv_ammi()cv_ammif()cv_blup()desc_stat()ecovalence()fai_blup()ge_factanal()ge_plot()ge_reg()ge_stats()get_model_data()is.lpcorr()is.split_factors()mahala()mahala_design()make_mat()make_sym()mtsi()pairs_mantel()plot.*()andplot_*()functionsrbind_fill()resca()resp_surf()waas()wsmp()waasb()
To allow automatic testing, the examples of the following functions were unwrapped by deleting \dontrun{}.
bind_cv()clustering()comb_vars()corr_ci()corr_plot()covcor_design()desc_stat()ecovalence()path_coefff()plot.fai_blup()plot.mtsi()plot.wsmp()plot_ci()wsmp()
In the examples of the functions for cross-validation \dontrun{} was changed with \donttest{}
cv_ammi()cv_ammif()cv_blup()plot.cv_ammif()
This is the first version that will be submitted to CRAN. In this version, deprecated functions in the last versions were defunct. Some new features were implemented.
-
New functions
fai_blup()computes the FAI-BLUP index (https://onlinelibrary.wiley.com/doi/full/10.1111/gcbb.12443)gge()computes the genotype plus genotype-vs-environment model.plot_factbars()andplot_factlines()are used to create bar and line plots, respectively, considering an one- or two-way experimental design.desc_stat()computes several descriptive statistics.can_corr()computes canonical correlation coefficients.resp_surf()computes response surface model using two quantitative factors.make_mat()is used to create a two-way table using two columns (factors) and one response variable.make_sym()is used to create a symmetric matrix using a upper- or lower-diagonal matrix.
-
Minor improvements
- New evaluation for text vectors are now used in the functions
AMMI_indexes()andfai_blup()anddesc_stat(). For example, to indicate the statistics to be computed indesc_stat()you must use nowstats = c("mean, SE.mean, CV, max, min"))insteadstats = c("mean", "SE.mean", "CV", "max", "min"))
- New evaluation for text vectors are now used in the functions
In the latest development version, the package METAAB was renamed to metan (multi-environment trials analysis). Aiming at a cleaner coding, in this version, some functions were deprecated and will be defunct in the near future. Alternative functions were implemented.
- For
WAAS.AMMI(), usewaas(). - For
WAASBYratio(), usewsmp(). - For
WAASratio.AMMI(), usewsmp(). - For
autoplot.WAAS.AMMI(), useautoplot.waas(). - For
plot.WAASBYratio(), useplot.wsmp(). - For
plot.WAASratio.AMMI(), useplot.wsmp(). - For
predict.WAAS.AMMI(), usepredict.waas(). - For
summary.WAAS.AMMI(), usesummary.waas()
Widely-known parametric and nonparametric methods were implemented, using the following functions.
Annicchiarico()to compute the genotypic confidence index.ecovalence()to compute the Wricke's ecovalence.ge_factanal()to compute to compute the stability and environmental.ge_reg()to compute the joint-regression analysis. stratification using factor analysis.superiority()to compute the nonparametric superiority index.
In the latest development version, some useful functions were included. One of the most interesting features included in this version was allowing the functions to receive data from the forward-pipe operator %>%. Bellow are the functions included in this version.
anova_ind()to perform a within-environment analysis of variance easily;colindiag()to perform a collinearity diagnostic of a set of predictors;afind_outliers()to easily find possible outliers in the dataset;group_factors()to split a dataset into a list of subsets using one or more grouping factors. This function may be used befor some functions, e.g.,find_outliers(),colindiag(),path_coeff()to compute the statistics for each level of the factor (or combination of levels of factors).lpcor()to compute linear and partial correlation coefficients.pairs_mantel()to compute a graphic pairwise Mantel's test using a set of correlation matrices;path_coeff()to compute path coefficients with minimal multicollinearity;
The following S3 Methods were also implemented:
is.group_factors()andas.group_factors()to check or easily coerce a dataframe that has one or more factor columns to an object ofgroup_factors;is.lpcorr()andas.lpcorr()to check or easily coerce a list of correlation matrices to an object oflpcorr;
- AMMI-based stability indexes;
- Allow analyzing multiple variables at the same time;
- S3 methods such as
plot(),predict(),summary()implemented.
- Mixed-effect model with environment random effect;
- Random-effect model.
- The first version of the package