EVOLUTION-MANAGER
Edit File: subset.cross.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Subsetting data for QTL experiment</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for subset.cross {qtl}"><tr><td>subset.cross {qtl}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Subsetting data for QTL experiment</h2> <h3>Description</h3> <p>Pull out a specified set of chromosomes and/or individuals from a <code>cross</code> object. </p> <h3>Usage</h3> <pre> ## S3 method for class 'cross' subset(x, chr, ind, ...) ## S3 method for class 'cross' x[chr, ind] </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>An object of class <code>cross</code>. See <code><a href="read.cross.html">read.cross</a></code> for details.</p> </td></tr> <tr valign="top"><td><code>chr</code></td> <td> <p>Optional vector specifying which chromosomes to keep or discard. This may be a logical, numeric, or character string vector. See Details, below.</p> </td></tr> <tr valign="top"><td><code>ind</code></td> <td> <p>Optional vector specifying which individuals to keep discard. This may be a logical, numeric or chacter string vector. See Details, below.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Ignored at this point.</p> </td></tr> </table> <h3>Details</h3> <p>The <code>chr</code> argument may be a logical vector with length equal to the number of chromosomes in the input cross <code>x</code>. Alternatively, it should be a vector of character strings referring to chromosomes by name. Numeric values are converted to strings. Refer to chromosomes with a preceding <code>-</code> to have all chromosomes but those considered. </p> <p>If the <code>ind</code> argument is a logical vector (<code>TRUE</code>/<code>FALSE</code>), it should have length equal to the number of individuals in the input cross <code>x</code>. The individuals with corresponding <code>TRUE</code> values are retained. </p> <p>If the <code>ind</code> argument is numeric, it should have values either between 1 and the number of individuals in the input cross <code>x</code> (in which case these individuals will be retained), or it should have values between <code>-1</code> and <code>-n</code>, where <code>n</code> is the number of individuals in the input cross <code>x</code>, in which case all <em>except</em> these individuals will be retained. </p> <p>If the input cross object <code>x</code> contains individual identifiers (a phenotype column labeled <code>"id"</code> or <code>"ID"</code>), and if the <code>ind</code> argument contains character strings, then these will be matched against the individual identifiers. If all values in <code>ind</code> are preceded by a <code>-</code>), we omit those individuals whose IDs match those in <code>ind</code>. Otherwise, we retain those individuals whose IDs match those in <code>ind</code>. </p> <h3>Value</h3> <p>The input <code>cross</code> object, but with only the specified subset of the data.</p> <h3>Author(s)</h3> <p>Karl W Broman, <a href="mailto:broman@wisc.edu">broman@wisc.edu</a> </p> <h3>See Also</h3> <p><code><a href="pull.map.html">pull.map</a></code>, <code><a href="drop.markers.html">drop.markers</a></code>, <code><a href="subset.map.html">subset.map</a></code> </p> <h3>Examples</h3> <pre> data(fake.f2) fake.f2.A <- subset(fake.f2, chr=c("5","13")) fake.f2.B <- subset(fake.f2, ind = -c(1,5,10)) fake.f2.C <- subset(fake.f2, chr=1:5, ind=1:50) data(listeria) y <- pull.pheno(listeria, 1) listeriaB <- subset(listeria, ind = (!is.na(y) & y < 264)) # individual identifiers listeria$pheno$ID <- paste("mouse", 1:nind(listeria), sep="") listeriaC <- subset(listeria, ind=c("mouse1","mouse11","mouse21")) listeriaD <- subset(listeria, ind=c("-mouse1","-mouse11","-mouse21")) # you can also use brackets (like matrix with rows=chromosomes and columns=individuals) temp <- listeria[c("5","13"),] # chr 5 and 13 temp <- listeria[ , 1:10] # first ten individuals temp <- listeria[5, 1:10] # chr 5 for first ten individuals </pre> <hr /><div style="text-align: center;">[Package <em>qtl</em> version 1.46-2 <a href="00Index.html">Index</a>]</div> </body></html>