Description Usage Arguments Details Value Examples
Read data from the data file that contains the trait data, haplotypes, and the probability of the haplotype pair occurring in the population.
1 |
path |
a character vector containing the absolute path for where the phenotype file is located. The default is that the data file is contained in the directory from which R is being run. |
file |
a character vector containing the name of the data file. |
csv |
a logical value. When |
Here, read_data
reads in the ASCII data into the package. A
space separated ASCII file with column headings is assumed. A csv
file can also be read if csv
is set to TRUE
. Each row of the
data file is the data for a seperate animal. The data file is
allowed to have any number of columns.
Four columns are mandatory in order for hapsampler
to function
correctly; a column with the trait data, two columns with the
haplotypes, and a column with the haploytpe probabilities. The trait column
can be named anything but the columns with the haplotypes and their probability
must be named hap1, hap2, and prob, respectively.
The columns hap1 and hap2 contain the haplotype indexes. These indexes can be any integer number.
Missing data are not allowed.
a data frame is returned of the data. The names of the columns will be as specified by the first row of the data file.
1 2 3 4 5 6 7 8 9 10 11 | # Read in example phenotypic data from ./inst/extdata/
# finding the full location of the phenotypic data
complete.name <- system.file("extdata", "dataexample.dat", package="HapSampler")
# read in phenotypic data which is in csv format
dt <- read_data(path=dirname(complete.name),
file=basename(complete.name))
## print a couple of lines of the data file
head(dt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.