-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
108 lines (82 loc) · 3.66 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
output: github_document
editor_options:
markdown:
wrap: 72
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# selection.index
<!-- badges: start -->
[](https://github.com/zankrut20/selection.index/actions)
[](https://cran.r-project.org/web/checks/check_results_selection.index.html)
[](https://CRAN.R-project.org/package=selection.index)
[](https://cran.r-project.org/package=selection.index)
[](https://cran.r-project.org/package=selection.index)
[](https://cran.r-project.org/package=selection.index)
[](https://cran.r-project.org/package=selection.index)
[](https://www.codefactor.io/repository/github/zankrut20/selection.index)
[](https://github.com/zankrut20/selection.index/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/zankrut20/selection.index?branch=master)
<!-- badges: end -->
The goal of selection.index is to easily construct the selection index
and based on the these indices select the plant traits for the overall
improvement of the plant.
## Installation
You can install the released version of selection.index from
[CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("selection.index")
```
from [github](https://github.com/zankrut20/selection.index) with:
``` r
devtools::install_github("zankrut20/selection.index")
```
## Example
This is a basic example which shows you how to solve a common problem:
Dataset `seldata` is included in package.
```{r example}
library(selection.index)
head(seldata)
```
### Genotypic Variance-Covariance Matrix
```{r}
genMat<- gen.varcov(data = seldata[,3:9], genotypes = seldata[,2],
replication = seldata[,1])
print(genMat)
```
### Phenotypic Variance-Covariance Matrix
```{r}
phenMat<- phen.varcov(data = seldata[,3:9], genotypes = seldata[,2],
replication = seldata[,1])
print(phenMat)
```
### Weight Matrix - Data is included in package `weight`
```{r}
weightMat <- weight.mat(weight)
weightMat
```
- Genetic gain of Yield
```{r}
GAY<- gen.advance(phen_mat = phenMat[1,1], gen_mat = genMat[1,1],
weight_mat = weightMat[1,1])
print(GAY)
```
### Construction of selection index/indices
For the construction of selection index we requires **phenotypic &
genotypic variance-covariance matrix as well weight matrix.**<br>
### Construction of all possible selection indices for a character combinations
```{r}
comb.indices(ncomb = 1, pmat = phenMat, gmat = genMat, wmat = weight[,2:3], wcol = 1, GAY = GAY)
```
### Construction of selection indices by removing desired single character from the combinations
```{r}
rcomb.indices(ncomb = 1, i = 1, pmat = phenMat, gmat = genMat, wmat = weight[,2:3], wcol = 1, GAY = GAY)
```