Skip to contents

Print a sh object in two ways. By default, the results are shown in the R console. The results can also be exported to the directory.

Usage

# S3 method for sh
print(x, export = FALSE, file.name = NULL, digits = 4, ...)

Arguments

x

An object of class sh.

export

A logical argument. If TRUE, a *.txt file is exported to the working directory

file.name

The name of the file if export = TRUE

digits

The significant digits to be shown.

...

Options used by the tibble package to format the output. See tibble::print() for more details.

Author

Tiago Olivoto tiagoolivoto@gmail.com

Examples

# \donttest{
vcov <- covcor_design(data_g, GEN, REP, everything())
means <- as.matrix(vcov$means)
pcov <- vcov$phen_cov
gcov <- vcov$geno_cov

index <- Smith_Hazel(means, pcov = pcov, gcov = gcov, weights = rep(1, 15))
print(index)
#> 
#> -----------------------------------------------------------------------------------
#> Index coefficients
#> -----------------------------------------------------------------------------------
#> # A tibble: 15 × 3
#>    VAR          b gen_weights
#>    <chr>    <dbl>       <dbl>
#>  1 PH    -1953.             1
#>  2 EH     -465.3            1
#>  3 EP      345.2            1
#>  4 EL      251.0            1
#>  5 ED      133.3            1
#>  6 CL     -229.5            1
#>  7 CD     -233.7            1
#>  8 CW     -176.0            1
#>  9 KW      -94.02           1
#> 10 NR      -82.86           1
#> 11 NKR    -181.0            1
#> 12 CDED    -34.27           1
#> 13 PERK   -415.9            1
#> 14 TKW      53.78           1
#> 15 NKE      43.13           1
#> 
#> -----------------------------------------------------------------------------------
#> Genetic worth
#> -----------------------------------------------------------------------------------
#>    GEN        V1
#> 1   H7 -28058.73
#> 2  H12 -28060.55
#> 3   H2 -28069.01
#> 4   H5 -28085.19
#> 5   H3 -28115.99
#> 6  H13 -28132.23
#> 7   H9 -28204.45
#> 8   H6 -28242.55
#> 9   H1 -28243.94
#> 10 H10 -28247.07
#> 11 H11 -28266.74
#> 12  H8 -28296.72
#> 13  H4 -28339.60
#> 
#> -----------------------------------------------------------------------------------
#> Selection gain
#> -----------------------------------------------------------------------------------
#> # A tibble: 15 × 7
#>    VAR         Xo       Xs       SD  SDperc sense     goal
#>    <chr>    <dbl>    <dbl>    <dbl>   <dbl> <chr>    <dbl>
#>  1 PH      2.167    2.304   0.1371   6.328  increase   100
#>  2 EH      1.078    1.22    0.1420  13.18   increase   100
#>  3 EP      0.4958   0.5227  0.02689  5.423  increase   100
#>  4 EL     14.67    14.25   -0.4193  -2.859  increase     0
#>  5 ED     47.87    48.27    0.3990   0.8335 increase   100
#>  6 CL     28.45    28.02   -0.4240  -1.490  increase     0
#>  7 CD     15.77    14.99   -0.7769  -4.927  increase     0
#>  8 CW     20.78    22.55    1.765    8.494  increase   100
#>  9 KW    146.8    152.0     5.198    3.540  increase   100
#> 10 NR     15.78    15.93    0.1487   0.9422 increase   100
#> 11 NKR    30.4     29.6    -0.8000  -2.632  increase     0
#> 12 CDED    0.5946   0.5800 -0.01454 -2.445  increase     0
#> 13 PERK   87.65    87.05   -0.5997  -0.6842 increase     0
#> 14 TKW   317.7    320.8     3.122    0.9825 increase   100
#> 15 NKE   467.9    478.8    10.87     2.323  increase   100
#> 
#> -----------------------------------------------------------------------------------
#> Phenotypic variance-covariance matrix
#> -----------------------------------------------------------------------------------
#>           PH      EH       EP       EL      ED       CL      CD      CW      KW
#> PH    0.0280  0.0190  0.00190  0.00580  0.2189  -0.0362 -0.0287   0.139   1.970
#> EH    0.0190  0.0163  0.00285 -0.02238  0.1524  -0.0109 -0.0486   0.096   1.130
#> EP    0.0019  0.0028  0.00088 -0.01172  0.0193   0.0056 -0.0149   0.014   0.056
#> EL    0.0058 -0.0224 -0.01172  0.37517  0.1178   0.0488  0.3479   0.499   4.269
#> ED    0.2189  0.1524  0.01931  0.11785  6.1789   3.7315  0.2053   8.643  34.340
#> CL   -0.0362 -0.0109  0.00562  0.04882  3.7315   4.7407  0.3090   8.619  13.099
#> CD   -0.0287 -0.0486 -0.01492  0.34792  0.2053   0.3090  0.4508   0.673   3.513
#> CW    0.1388  0.0962  0.01410  0.49897  8.6429   8.6186  0.6726  20.972  49.106
#> KW    1.9698  1.1300  0.05606  4.26873 34.3402  13.0992  3.5130  49.106 274.442
#> NR    0.1514  0.1005  0.01161 -0.10612  2.1678   0.3145 -0.1293   1.771  14.432
#> NKR  -0.0262 -0.0732 -0.02513  0.38921 -2.1832  -3.1529  0.4191  -4.440  -0.989
#> CDED -0.0034 -0.0021 -0.00014  0.00024  0.0013   0.0526  0.0044   0.074  -0.144
#> PERK  0.0556  0.0242 -0.00297  0.01109 -2.1099  -3.5815 -0.1025  -7.471  -6.722
#> TKW   0.4550  0.4704  0.11429  6.64529 51.1086  60.8129  7.0140 125.436 276.147
#> NKE   5.5613  2.8220 -0.00892  4.32251 36.2582 -45.2534  1.9641 -20.768 489.456
#>          NR     NKR     CDED    PERK     TKW      NKE
#> PH    0.151  -0.026 -0.00341   0.056    0.45  5.6e+00
#> EH    0.101  -0.073 -0.00213   0.024    0.47  2.8e+00
#> EP    0.012  -0.025 -0.00014  -0.003    0.11 -8.9e-03
#> EL   -0.106   0.389  0.00024   0.011    6.65  4.3e+00
#> ED    2.168  -2.183  0.00133  -2.110   51.11  3.6e+01
#> CL    0.315  -3.153  0.05261  -3.582   60.81 -4.5e+01
#> CD   -0.129   0.419  0.00444  -0.102    7.01  2.0e+00
#> CW    1.771  -4.440  0.07352  -7.471  125.44 -2.1e+01
#> KW   14.432  -0.989 -0.14378  -6.722  276.15  4.9e+02
#> NR    1.605   0.130 -0.02024   0.068   -1.47  4.9e+01
#> NKR   0.130   4.746 -0.03809   2.322  -48.48  7.0e+01
#> CDED -0.020  -0.038  0.00108  -0.049    0.65 -1.4e+00
#> PERK  0.068   2.322 -0.04859   3.426  -47.06  4.6e+01
#> TKW  -1.472 -48.480  0.64659 -47.057 1180.42 -8.2e+02
#> NKE  48.839  70.119 -1.38172  45.583 -816.10  2.8e+03
#> 
#> -----------------------------------------------------------------------------------
#> Genotypic variance-covariance matrix
#> -----------------------------------------------------------------------------------
#>            PH       EH       EP       EL       ED       CL      CD      CW
#> PH    0.01708  0.00888 -0.00012  3.0e-03  0.18583  -0.0556 -0.0287   0.106
#> EH    0.00888  0.00501  0.00017 -2.5e-02  0.12777  -0.0298 -0.0463   0.082
#> EP   -0.00012  0.00017  0.00015 -1.2e-02  0.01583   0.0019 -0.0143   0.015
#> EL    0.00303 -0.02515 -0.01226  4.7e-02  0.00053  -0.0337  0.1487   0.090
#> ED    0.18583  0.12777  0.01583  5.3e-04  5.36879   3.3347  0.1667   7.676
#> CL   -0.05561 -0.02982  0.00185 -3.4e-02  3.33474   4.2690  0.3234   8.248
#> CD   -0.02873 -0.04627 -0.01425  1.5e-01  0.16666   0.3234  0.2396   0.378
#> CW    0.10646  0.08249  0.01542  9.0e-02  7.67557   8.2480  0.3784  18.458
#> KW    1.53382  0.82217  0.01174  6.2e-01 28.50002  10.8906  0.8898  37.657
#> NR    0.13286  0.08405  0.00867 -1.2e-01  1.86537   0.1827 -0.1515   1.632
#> NKR  -0.08098 -0.13532 -0.04097 -2.6e-01 -2.59771  -3.2041 -0.1574  -5.468
#> CDED -0.00342 -0.00223 -0.00018  4.3e-05  0.00318   0.0477  0.0052   0.078
#> PERK  0.04600  0.01193 -0.00674 -4.3e-02 -2.05591  -3.5398 -0.1430  -7.102
#> TKW  -0.21096  0.01407  0.04693  3.9e+00 44.49990  57.0469  5.8305 110.666
#> NKE   5.10010  2.44637 -0.06371 -3.5e+00 26.63104 -47.0664 -4.8728 -35.643
#>           KW      NR     NKR     CDED     PERK      TKW      NKE
#> PH     1.534  0.1329  -0.081 -3.4e-03   0.0460   -0.211    5.100
#> EH     0.822  0.0841  -0.135 -2.2e-03   0.0119    0.014    2.446
#> EP     0.012  0.0087  -0.041 -1.8e-04  -0.0067    0.047   -0.064
#> EL     0.620 -0.1159  -0.261  4.3e-05  -0.0430    3.905   -3.468
#> ED    28.500  1.8654  -2.598  3.2e-03  -2.0559   44.500   26.631
#> CL    10.891  0.1827  -3.204  4.8e-02  -3.5398   57.047  -47.066
#> CD     0.890 -0.1515  -0.157  5.2e-03  -0.1430    5.831   -4.873
#> CW    37.657  1.6321  -5.468  7.8e-02  -7.1018  110.666  -35.643
#> KW   180.972 13.0598 -12.058 -1.2e-01  -7.9108  175.110  344.314
#> NR    13.060  1.1809  -0.184 -1.9e-02   0.0477    2.739   36.598
#> NKR  -12.058 -0.1839   2.147 -3.4e-02   2.0327  -48.942   34.725
#> CDED  -0.117 -0.0191  -0.034  9.6e-04  -0.0483    0.646   -1.294
#> PERK  -7.911  0.0477   2.033 -4.8e-02   3.1367  -46.969   42.024
#> TKW  175.110  2.7390 -48.942  6.5e-01 -46.9689  840.939 -627.503
#> NKE  344.314 36.5977  34.725 -1.3e+00  42.0240 -627.503 1982.321
# }