mgidi().*_wd_here() to set and get the WorkingDirectory (wd) quicky.get_wd_here() gets the working directory to the path ofthe current script.set_wd_here() sets the working directory to the path ofthe current script.open_wd_here() open the File Explorer at the directorypath of the current script.open_wd() open the File Explorer at the current workingdirectory.corr_coef() now can compute both linear and partialcorrelation, controled by the argumenttype.network_plot() to produce a network plotof a correlation matrix or an object computed withcorr_coef().sample_random() andsample_systematic() for random and systematic sampling,respectively.plot.waasb() now has new arguments to control whetherto show the percentage values within bars and the order of variables onthe x-axis.corr_coef() now handles grouped data passed fromgroup_by()size.varnames andcol.varnames added incorr_plot().gmd(mod, "h2"), whenmod iscomputed withrandom = "env".repel inplot.gge().plot method forpath_coeff_*()functions.path_coeff_seq() to implement a sequential(two chains) path analysis.prop_na() to measure the proportion ofNAs in each column.remove_cols_all_na() andremove_rows_all_na() to remove columns and rows that haveall values asNAs.ci_mean_z() andci_mean_t()to compute z- and t-confidence intervals, respectively.set_wd_here() to set the working directoryto the path of the current script.rowname_to_column().mps() where stab was being rewritten withstab_res.mgidi() example thatoverwrites the function.x.lab andy.lab fromplot_scores(). Now it accepts an object fromexpression()plot_waasby() now accepts objects of classwaas_means.get_model_data() now includes new optionscoefs, andanova for objects computed withge_reg().max_overlaps inplot_scores()to exclude text labels that overlap too many things.plot_scores() (shape, alpha, color, and size).ge_stats() to include the new stabilitymethods.wsmp() now accepts objects computed withmps(),waas(), andwaasb().AMMI_indexes() has been deprecated in favour ofammi_indexes().ammi_indexes()data_ge().gmd(., "data")fai_blup() when genotypes has distance as0.inspect() when some trait has charactervalues.gmd(model, "blupge")get_model_data() calling objects of classmgidi withwhat = "PCA".path_coeff() when generating sequences ofdirect effects depending on the constant added to the diagonal ofcorrelation matrix.gmd() forggeobjects.projection ingmd() forgge objects to get the projection of each genotype in theAEC coordinates.mtsi() with an object of classwaas.progress() andrun_progress() for textprogress bar in the terminal.rbind_fill_id() To implement the common pattern ofdo.call(rbind, dfs) with data frame identifier and fillingof missing values.hmgv(),rpgv(),hmrpgv(),blup_indexes() to compute stability indexes based on amixed-effect model.mps() andmtmps() for uni- andmultivariate-based mean performance and stability in multi-environmenttrials.ge_reg() now returns hypotesis testing for slope anddeviations from the regression. Thanks toResende_indexes() now removeNAs beforecomputing harmonic and arithmetic means.plot_scores that now has ahighlight argument to highlight genotypes or environmentsby hand. Thanks toIbrahimElbasyoni for his suggestions.clustering() when using withbyargument and defacultnclust argument.get_model_data() now extract BLUEs from objectscomputed withgamem() andgamem_met(). Thankstog_simula() andge_simula() now have ares_eff to control the residual effect.mgidi() now have an optionalweightsargument to assign different weights for each trait in the selectionprocess. Thanks toget_levels_comb() to get the combination of the levelsof 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.sel.var() incorr_ci() tofilter correlations with a selected variablefill andposition.fill inplot_ci() to fill correlations by levels of a factorvariable.arrange_ggplot() andgge().themein arrange_ggplot() tocontrol the theme of the plot.by argument ingafem().mgid() now understands models of classgafem_grouped.get_levels() to get the levels even if thevariable 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 aby argument andunderstand data passed fromgroup_by.col.stroke andsize.strokeinplot.gge()gtb andgytb now produces biplots withlines for genotype’s vectors intype = 1.get_model_data() now understand objects of classfai_blup andsh.get_dist() to get distance matrices from objects ofclassclustering.get_corvars() to get normal, multivariate correlatedvariables.get_covmat() to obtain covariance matrix based onvariances and correlation values.as_numeric(),as_integer(),as_logical(),as_character(), andas_factor() to coerce variables to specific formatsquickly.n_valid(),n_missing(), andn_unique() to count valid, missing, and unique values,respectively.tidy_colnames() to clean up column names. It is ashortcut totidy_strings() applied to the column names of adata frame.env_stratification() to perform environmentstratification using factor analysis.as_*() now handles vectors.
plot.corr_coef() now shows both stars or p-valuesfor reporting the significance of correlations.
gamem(),gamem_met(), andwaasb() now have aby argument and understanddata passed fromgroup_by.
mtsi() andmgidi() now returns theranks for the contribution of each factor and understand models fittedwithgamem() andwaasb() using theby argument.
plot.mtsi() andplot.mgidi() nowreturns a radar plot by default when usingtype = "contribution".
get_model_data() now returns the genotypic andphenotypic correlation matrices from objects of classwaasbandgamem.
replace_string(),replace_number(),extract_string(), andextract_number() nowacceptstidyevaluation in the new... argument.
add_prefix() andadd_suffix() to add prefixes and suffixes to variablenames, respectively.select_pred() to selects a best subset ofpredictor variables.acv() to compute theadjustedcoefficient of variation to account for the systematic dependence of\(\sigma^2\) fromge_acv() to compute yield stability indexbased on the adjusted coefficient of variation.ge_polar() to compute yield stabilityindex based onPowerLaw Residuals (POLAR) statistics.mantel_test() to performs a Mantel testbetween two matrices.prefix andsuffix inconcatenate() to add prefixes and suffixes to concatenatedvalues, respectively.\doi{} markup in Rd files.gytb() to generate the Genotype byyield*trait biplot.row_col_mean() androw_col_sum()to add a row with the mean/sum of eachvariable and a column with the mean/sum for each row of a matrix or dataframe.has_zero(),remove_cols_zero(),remove_rows_zero(),select_cols_zero(),select_rows_zero(), andreplace_zero() to deal with 0s in a data frame.gge.gge andcan_corr inget_model_data().position inplot.gamem() andplot.mtsi() to control the position adjustment of the barplot.col.by incorr_plot() to mapthe color of the points by a categorical variable.use_data in functionsmgidi(),fai_blup(), andSmith_Hazel() to control which data is used (BLUPs orphenotypic means) to compute the index.inspect() now generate a warning if zero values areobserved in data.clip_read() andclip_write()to read from the clipboard and write to the clipboard,respectively.sum_by() to compute the sum by levels offactors.mgidi() now allows using a fixed-effect model fittedwithgafem() as input data.round_cols() now can be used to round wholematrices.plot.mgidi() can now plot the contribution for allgenotypes.plot_bars() andplot_factbars() now showsthe values withvalues = TRUEdplyr::across()Smith_Hazel() andprint.sh() andplot.sh() for computing the Smith and Hazel selectionindex.coincidence_index() for computing the coincidenceindex.get_model_data() now extracts the genotypic andphenotypic variance-covariance matrix from objects of classgamem andwaasb.fai_blup() now returns the total genetic gain and thelist with the ideotypes’ construction.mgidi() now computes the genetic gain when amixed-model is used as input data.plot()for objects of classmgidi has a new argumenttype = "contribution" to plot the contribution of eachfactor in the MGIDI index.plot_scores() now can produce a biplot showing otheraxes besides PC1 and PC2. To change the default IPCA in each axis usethe new argumentsfirst andsecond.plot_bars() andplot_factbars() now alignvertically the labels to the error bars.fai_blup() now returns the eigenvalues and explainedvariance for each axis and variables into columns instead rownames.donttest{} examples. Now, thecorrect data set is used in the example offai_blup()select_rows_na() andselect_cols_na() toselect rows or columns with withNA values.mgidi() to compute the multi-trait genotype-ideotypedistance index.plot_bars() to create bar plots quickly. Thanks tohm_mean() andgm_mean() removed in favour ofhmean() andgmean(), respectively.rep retired inFox(),ge_effects(),Huehn(),resp_surf(),superiority(), andThennarasu()verbose retired inanova_ind()region retired inresp_surf()plot.wsmp().ge_plot()fai_blup() withgamem()inspect()plot() call on objects of classgamem,waasb andwaas now returns the variable namesautomatically. Thanks toplot.gamem() andplot.waasb() have a newargument (type = "vcomp") to produce a plot showing thecontribution of the variance components to the phenotypic variancecv_ammi(),cv_ammif(), andcv_blup() now check for missing values and unbalanced databefore computing the cross-validation. (#3)tibble toversion 3.0.0.get_model_data() now fills rows that don’t matchesacross columns withNA. Thanks toget_model_data() called now report mean squares,F-calculated and P-values for blocks within replicates inanova_ind().ENV,GEN, andREP only (#2).gmd() a shortcut toget_model_data()gtb() to generate a genotype-by-trait biplot.gamem_met() to analyze genotypes in multi-environmenttrials using mixed- or random-effect models allowing unbalanced data.Thanks tohas_class() to check if a class exists.impute_missing_val() to impute missing values in atwo-way table based on Expectation-Maximization algoritms.non_collinear_vars() to select a set of predictors withminimal multicollinearity.replace_na() to replaceNA valuesquicly.random_na() to generate randomNA valuesbased on a desired proportion.gge(),performs_ammi(),waas(), andwaasb() now handle with unbalanceddata by implementing a low-rank matrix approximation using singularvalue decomposition to impute missing entires. Imputation generates awarning message.NA values are checked and removed with a warning whencomputing stability indexes. Thanks toplot_res inpath_coeff() tocreate a residual plot of the multiple regression model.verbose deprecated in functionsanova_ind() andsplit_factors()rep deprecated in functionsFox(),Huehn(),superiority(),andThennarasu().means_by removed in functionscan_corr() andclustering().verbose removed in functionscolindiag() andsplit_factors().values removed in functionsdesc_stat() andfind_outliers().var removed in functiondesc_wider().plot.resp_surf().alpha_color() To get a semi-transparent colorgafem() To analyze genotypes using fixed-effectmodels.residual_plots() A helper function to create residualsplots.stars_pval() To generate significance stars fromp-valuesdoo() An alternative todplyr::do fordoing anythingcv_by() For computing coefficient of variation bylevels of a factor.max_by() For computing maximum values by levels of afactor.means_by() For computing arithmetic means by levels ofa factor.min_by() For computing minimum values by levels of afactor.n_by() For getting the length.sd_by() For computing sample standard deviation.sem_by() For computing standard error of the mean bylevels of a factor.av_dev() computes the average absolute deviation.ci_mean() computes the confidence interval for themean.cv() computes the coefficient of variation.hm_mean(),gm_mean() computes the harmonicand geometric means, respectively. The harmonic mean is the reciprocalof the arithmetic mean of the reciprocals. The geometric mean is the nthroot of n products.kurt() computes the kurtosis like used in SAS andSPSS.range_data() Computes the range of the values.sd_amo(),sd_pop() Computes sample andpopulational standard deviation, respectively.sem() computes the standard error of the mean.skew() computes the skewness like used in SAS andSPSS.sum_dev() computes the sum of the absolutedeviations.sum_sq_dev() computes the sum of the squareddeviations.var_amo(),var_pop() computes sample andpopulational variance.valid_n() Return the valid (not NA) length of adata.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 charactercolumns of a data frame to lower, upper and title cases,respectively.tidy_strings() Tidy up characters strings, non-numericcolumns, or any selected columns in a data frame by putting all word inupper case, replacing any space, tabulation, punctuation characters by'_', and putting'_' between lower and uppercases.find_text_in_num() Find text fragments in columnsassumed to be numeric. This is especially useful wheneverything() is used in argumentresp toselect the response variables.anova_ind(),anova_joint(),performs_ammi(),waas() andwaasb(), now have the argumentblock toanalyze data from trials conducted in an alpha-lattice design. Thanks torepel included inplot_scores()to control wheater the labels are repelled or not to avoidoverlapping.Argumentmeans_by was deprecated in functionscan_corr() andclustering(). Usemeans_by() to pass data based on means of factor to thesefunctions.
transparent_color()desc_stat() now handles grouped data passed fromdplyr::group_by()plot_scores() now support objects of classwaas_mean.citation("metan").plot_scores(type = 2) (#1)get_model_data() now support models of classanova_joint andgafem and extract randomeffects of models fitted withwaasb() andgamem().plot.waasb() andplot.gamem() toshow distribution of random effects.inspect(),cv_blup(),cv_ammif(), andcv_ammi() now generate awarning message saying that is not possible to compute cross-validationprocedures in experiments with two replicates only. Thanks toplot.wsmp() now returns heatmaps created with ggplot2.Thus, we removed dependency ongplots.corr_plot() now don’t write a warning message to theconsole by default.select_numeric_cols() now is used as a helper functioninmetan.metan now reexportsmutate() fromdplyr package.get_model_data() now set default values for each classof models.by that calls internallysplit_factors() included to facilitate the application ofthe functions to each level of one grouping variable.add_cols(), andadd_rows() for addingcolumns and rows, respectively.remove_cols(), andremove_rows() forremoving columns and rows, respectively.select_cols() andselect_rows() forselecting columns and rows, respectively.select_numeric_cols(), andselect_non_numeric_cols() for selecting numeric andnon-numeric variables quickly.round_cols() for rounding a whole data frame tosignificant figures.all_lower_case(), andall_upper_case() forhandling with cases.extract_number(),extract_string(),remove_strings(),replace_number(), andreplace_string(), for handling with numbers andstrings.get_level_size(), andget_levels() forgetting size of levels and levels of a factor.means_by() for computing means by one or more factorsquickly.ge_means() for computing genotype-environmentmeansge_winners() for getting winner genotypes or rankinggenotypes within environments.env_dissimilarity() for computing dissimilarity betweentest environments.starts_with(),ends_with(),contains(),contains(),num_range(),one_of(),everything(), andlast_col().resp (response variable(s) nowsupport select helpers.sem() for computing standard errorof mean.remove_rows_na() andremove_cols_na() for removing rows or columns withNA values quickly.difference_var(),intersect_var(), andunion_var() for selectingvariables that match an expression.Schmildt() for stability analysis.ge_reg.get_model_data() to support objects of classSchmildtandAnnicchiarico.on.exit() is used in S3 generic functionsprint() to ensure that the settings are reset when afunction is excited.I’m very pleased to announce the release ofmetan 1.1.0,This is a minor release with bug fixes and new functions. The mostimportant changes are described below.
corr_stab_ind() for computing Spearman’srank correlation between stability indexes;corr_coef() for computing correlationcoefficients and p-values;plot.corr_coef() for creating correlationheat maps;print.corr_coef() for printingcorrelation and p-values;make_lower_tri() andmake_upper_tri() for creating lower and upper triangularmatrices, respectively.reorder_cormat() for reordering acorrelation matrix according to the correlation coefficients;get_model_data() by supporting newclasses of models. Now,get_model_data() can be used to getall statistics or ranks computed with the wrapper functionge_stats().arrange_ggplot() now support objects of classggmatrix.theme_metan()arrange_ggplot() for arranging ggplot2graphics;ge_effects() for computinggenotype-environment effects;gai() for computing the geometricadaptability index;gm_mean() for computing geometricmean;hm_mean() for computing harmonicmean;Huehn() for computing Huehn’sstability statistic;Thennasaru() for computingThennasaru’s stability statistic;get_model_data() by supporting newclasses of models;gamem() for analyzing genotypes in one-waytrials using mixed-effect models;desc_wider() to convert an output of thefunctiondesc_stat() to a ‘wide’ format;Fox() for Stability analysis;Shukla() for stability analysis;to_factor() to quickly convert variablesto factors;get_model_data() function;The changes in this version were made based on suggestions receivedwhen metan was submitted to CRAN for the first time.
The documentation of the following functions was updated byincluding/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 functionswere 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{} waschanged with \donttest{} *cv_ammi() *cv_ammif() *cv_blup() *plot.cv_ammif()
This is the first version that will be submitted to CRAN. In thisversion, deprecated functions in the last versions were defunct. Somenew features were implemented.
fai_blup() computes the FAI-BLUP index(https://onlinelibrary.wiley.com/doi/full/10.1111/gcbb.12443)gge() computes the genotype plusgenotype-vs-environment model.plot_factbars() andplot_factlines() areused to create bar and line plots, respectively, considering an one- ortwo-way experimental design.desc_stat() computes several descriptivestatistics.can_corr()computes canonical correlationcoefficients.resp_surf() computes response surface model using twoquantitative factors.make_mat() is used to create a two-way table using twocolumns (factors) and one response variable.make_sym() is used to create a symmetric matrix using aupper- or lower-diagonal matrix.AMMI_indexes() andfai_blup() anddesc_stat(). For example, to indicate the statistics to becomputed indesc_stat() you must use nowstats = c("mean, SE.mean, CV, max, min")) insteadstats = c("mean", "SE.mean", "CV", "max", "min"))In the latest development version, the packageMETAAB was renamed tometan(multi-environmenttrialsanalysis). Aiming at a cleanercoding, in this version, some functions were deprecated and will bedefunct in the near future. Alternative functions were implemented.
WAAS.AMMI(), usewaas().WAASBYratio(), usewsmp().WAASratio.AMMI(), usewsmp().autoplot.WAAS.AMMI(), useautoplot.waas().plot.WAASBYratio(), useplot.wsmp().plot.WAASratio.AMMI(), useplot.wsmp().predict.WAAS.AMMI(), usepredict.waas().summary.WAAS.AMMI(), usesummary.waas()Widely-known parametric and nonparametric methods were implemented,using the following functions.
Annicchiarico() to compute the genotypic confidenceindex.ecovalence() to compute the Wricke’s ecovalence.ge_factanal() to compute to compute the stability andenvironmental.ge_reg() to compute the joint-regression analysis.stratification using factor analysis.superiority() to compute the nonparametric superiorityindex.In the latest development version, some useful functions wereincluded. One of the most interesting features included in this versionwas allowing the functions to receive data from the forward-pipeoperator %>%. Bellow are the functions included in this version.
anova_ind() to perform a within-environment analysis ofvariance easily;colindiag() to perform a collinearity diagnostic of aset of predictors;afind_outliers() to easily find possible outliers in thedataset;group_factors() to split a dataset into a list ofsubsets using one or more grouping factors. This function may be usedbefor some functions, e.g.,find_outliers(),colindiag(),path_coeff() to compute thestatistics for each level of the factor (or combination of levels offactors).lpcor() to compute linear and partial correlationcoefficients.pairs_mantel() to compute a graphic pairwise Mantel’stest using a set of correlation matrices;path_coeff() to compute path coefficients with minimalmulticollinearity;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 factorcolumns to an object ofgroup_factors;is.lpcorr() andas.lpcorr() to check oreasily coerce a list of correlation matrices to an object oflpcorr;plot(),predict(),summary() implemented.