NA_Generator: Function to introduce additional NAs for prediction error...

Description Usage Arguments Value Examples

View source: R/Generate_NA.R

Description

Function to introduce additional NAs for prediction error calculation.

Usage

1
NA_Generator(SNP_df, percent)

Arguments

SNP_df

Original data of SNP. It may contain some SNP

percent

The final percentage of total NA's we want in the dataset.

Value

a list of variables: 1. SNP_NA_df: the dataset with additional SNPs. 2. NA_percent_orig: original missing percentable in the dataset. 3. NA_percent_generate: introduced NA percentage. 4. NP_generate_positions: the positions of the introduced NA's.

Examples

1
2
3
4
5
6
7
8
data("SNP_orig_sub")
## original NA ratio is 0.018
SNP_NA_df02 <- NA_Generator(SNP_orig_sub, 0.2)
## Introduced another 18% of NAs. 

SNP_NA_df <- NA_Generator(SNP_orig_sub, 0.01)
## Should report an error: alread has 1.8% NA's, higher than the 
## target percentage. 

GaoGN517/689_SNP_FastImpute documentation built on Jan. 2, 2020, 11:44 a.m.