MyNixOS website logo
Description

Construction of Selection Index.

Selection index is one of the efficient and acurrate method for selection of animals. This package is useful for construction of selection indices. It uses mixed and random model least squares analysis to estimate the heritability of traits and genetic correlation between traits. The package uses the sire model as it is considered as random effect. The genetic and phenotypic (co)variances along with the relative economic values are used to construct the selection index for any number of traits. It also estimates the accuracy of the index and the genetic gain expected for different traits. Fisher (1936) <doi:10.1111/j.1469-1809.1936.tb02137.x>.

seliNDRIx: Your Package Description Here

buld+_b— output: github_document —

seliNDRIx

The goal of seliNDRIx is to construct the selection index from the animal breeding data using the mixed and random sire models.

Installation

You can install the development version of seliNDRIx like so:

``` r # FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE? install.packages(“seliNDRIx”) require(seliNDRIx) ## Example This is a basic example which shows you how to solve a common problem:

library(seliNDRIx)

Example using mixed function

Read the data

data <- data("data", package = "seliNDRIx") # Define your parameters traits <- c(“tmy”, “py”, “fatyield”) fixed <- c(“farm”, “soc”, “poc”) random <- c(“sire”) economic_values <- c(1, 0.85, 0.65)

# Run the analysis results \<- mixed_si( data = data, traits = traits, fixed = fixed, random = random, economic_values = economic_values ) results \# To calculate the overall selection index for each animal SI \<- c(results\$SelectionIndex) \# Selection index estimates (weights) for traits traits \<- c(“tmy”, “py”, “fatyield”) \# Define the trait columns to use overall_index \<- function(data, SI, traits) { \# Ensure the number of weights matches the number of trait columns if (length(SI) != length(traits)) { stop(“The number of weights must match the number of trait columns.”) } \# Select only the defined trait columns and calculate the index data %\>% rowwise() %>% mutate(Index = sum(c_across(all_of(traits)) * SI)) %>% ungroup() } # Calculate the selection index result3 <- overall_index(data, SI, traits) # Print the result print(result3)

# Select the top 20% of animals with the highest selection index values top20 \<- result3 %\>% arrange(desc(Index)) %>% # Sort by Index in descending order slice_head(prop = 0.2) # Select the top 20%

# Example using random function # Read the data data \<- data("data", package = "seliNDRIx") \# Run the analysis results2 \<- random_si(data, traits = c(“tmy”, “py”, “fatyield”), economic_values = c(1, 0.85, 0.65)) results2 \# To calculate the overall selection index for each animal SI \<- c(results\$SelectionIndex) \# Selection index estimates (weights) for traits traits \<- c(“tmy”, “py”, “fatyield”) \# Define the trait columns to use overall_index \<- function(data, SI, traits) { \# Ensure the number of weights matches the number of trait columns if (length(SI) != length(traits)) { stop(“The number of weights must match the number of trait columns.”) } \# Select only the defined trait columns and calculate the index data %\>% rowwise() %>% mutate(Index = sum(c_across(all_of(traits)) * SI)) %>% ungroup() }

# Calculate the selection index result3 <- overall_index(data, SI, traits)

# Print the result print(result3)

# Select the top 20% of animals with the highest selection index values top20 \<- result3 %\>% arrange(desc(Index)) %>% # Sort by Index in descending order slice_head(prop = 0.2) # Select the top 20%

What is special about using README.Rmd instead of just README.md? You can include R chunks like so:

You’ll still need to render README.Rmd regularly, to keep README.md up-to-date. devtools::build_readme() is handy for this.

You can also embed plots, for example:

In that case, don’t forget to commit and push the resulting figure files, so they display on GitHub and CRAN.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows