Gitlab migration complete. If you have any issue please read the FAQ.

Commit 0cf917ad authored by Rauschenberger's avatar Rauschenberger
Browse files

automation

parent e1fbb7a7
......@@ -929,7 +929,7 @@ test.multiple <- function(Y,X,map,rho=c(0,0.5,1),spec=1,min=100,steps=20){
#' Plot grid
#'
#' @description
#' This function tests for alternative splicing.
#' This function combines a scatter plot with a density plot.
#'
#' @param x
#' vector
......@@ -937,40 +937,44 @@ test.multiple <- function(Y,X,map,rho=c(0,0.5,1),spec=1,min=100,steps=20){
#' @param y
#' vector
#'
#' @param xlim
#' horizontal limits
#'
#' @param ylim
#' vertical limits
#'
#' @param n
#' grid resolution
#'
#' @param ...
#' graphical parameters
#'
#' @examples
#' x <- stats::rbeta(n=100,shape1=0.2,shape2=0.5)
#' y <- stats::rbeta(n=100,shape1=0.2,shape2=0.5)
#' x <- stats::rbeta(n=100,shape1=0.3,shape2=0.5)
#' y <- stats::rbeta(n=100,shape1=0.3,shape2=0.5)
#' grid(x,y)
#'
grid <- function(x,y,xlim=NULL,ylim=NULL,n=10){
grid <- function(x,y,n=10,...){
#default values
par <- list(...)
if(is.null(par$xlim)){par$xlim <- range(x)}
if(is.null(par$ylim)){par$ylim <- range(y)}
if(is.null(par$pch)){par$pch <- 16}
if(is.null(par$cex)){par$cex <- 0.5}
if(is.null(par$xlab)){par$xlab <- "x"}
if(is.null(par$ylab)){par$ylab <- "y"}
# open plot
if(is.null(xlim)){xlim <- range(x)}
if(is.null(ylim)){ylim <- range(y)}
graphics::plot.new()
graphics::plot.window(xlim=xlim,ylim=ylim)
graphics::plot.window(xlim=par$xlim,ylim=par$ylim)
graphics::box()
graphics::axis(side=1)
graphics::axis(side=2)
# density
xc <- seq(from=xlim[1],to=xlim[2],length.out=n+1)
yc <- seq(from=ylim[2],to=ylim[1],length.out=n+1)
xc <- seq(from=par$xlim[1],to=par$xlim[2],length.out=n+1)
yc <- seq(from=par$ylim[2],to=par$ylim[1],length.out=n+1)
M <- matrix(integer(),nrow=n,ncol=n)
for(i in seq_len(n)){
for(j in seq_len(n)){
M[i,j] <- sum(x >= xc[i] & x <= xc[i+1] & y <= yc[j] & y >= yc[j+1])
}
}
M <- sqrt(M)/(1.25*sqrt(max(M)))
M <- M/(1.25*max(M))
# fill plot
for(i in seq_len(n)){
......@@ -980,9 +984,10 @@ grid <- function(x,y,xlim=NULL,ylim=NULL,n=10){
col=gray(level=1-M[i,j]),border=NA)
}
}
graphics::segments(x0=xc,y0=ylim[1],y1=ylim[2],col="white")
graphics::segments(x0=xlim[1],x1=xlim[2],y0=yc,col="white")
graphics::points(x=x,y=y,pch=16,cex=0.5)
graphics::segments(x0=xc,y0=par$ylim[1],y1=par$ylim[2],col="white")
graphics::segments(x0=par$xlim[1],x1=par$xlim[2],y0=yc,col="white")
graphics::points(x=x,y=y,pch=par$pch,cex=par$cex,col="black")
graphics::title(xlab=par$xlab,ylab=par$ylab)
}
......
......@@ -54,6 +54,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......@@ -180,7 +183,7 @@
<a class="sourceLine" id="cb5-9" data-line-number="9">}</a></code></pre></div>
<p>On the virtual machine, execute this chunk to compare the results between the Geuvadis and the BBMRI project.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">cor &lt;-<span class="st"> </span>chisq &lt;-<span class="st"> </span><span class="kw">rep</span>(<span class="ot">NA</span>,<span class="dt">length=</span><span class="dv">22</span>)</a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="cf">for</span>(chr <span class="cf">in</span> <span class="dv">22</span><span class="op">:</span><span class="dv">1</span>){</a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="cf">for</span>(chr <span class="cf">in</span> <span class="kw">c</span>(<span class="dv">22</span>,<span class="dv">1</span>,<span class="dv">21</span>,<span class="dv">20</span>)){</a>
<a class="sourceLine" id="cb6-3" data-line-number="3"> sel &lt;-<span class="st"> "rho=1"</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval.Geuvadis.chr"</span>,chr,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb6-5" data-line-number="5"> a &lt;-<span class="st"> </span>pvalue; pvalue &lt;-<span class="st"> </span><span class="ot">NA</span></a>
......
......@@ -80,6 +80,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......@@ -115,6 +118,7 @@
<ul>
<li><a href="code.html">rainbow (code)</a></li>
<li><a href="text.html">rainbow (text)</a></li>
</ul>
</div>
</div>
......
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>rainbow (text) • spliceQTL</title>
<!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../jquery.sticky-kit.min.js"></script><script src="../pkgdown.js"></script><meta property="og:title" content="rainbow (text)">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">spliceQTL</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">0.0.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/spliceQTL">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>rainbow (text)</h1>
<small class="dont-index">Source: <a href="https://github.com/rauschenberger/spliceQTL/blob/master/vignettes/text.Rmd"><code>vignettes/text.Rmd</code></a></small>
<div class="hidden name"><code>text.Rmd</code></div>
</div>
<p>This vignette describes the data analysis. All functions are included in the R package <code>spliceQTL</code>.</p>
<div id="data" class="section level2">
<h2 class="hasAnchor">
<a href="#data" class="anchor"></a>1. Data</h2>
<div id="get-snps-geuvadis" class="section level3">
<h3 class="hasAnchor">
<a href="#get-snps-geuvadis" class="anchor"></a><code>get.snps.geuvadis</code>
</h3>
<p>This function obtains the Geuvadis SNP data. It downloads missing genotype data from ArrayExpress, transforms variant call format to binary files, removes SNPs with a low minor allele frequency, labels SNPs in the format “chromosome:position”, and changes sample identifiers.</p>
</div>
<div id="get-snps-bbmri" class="section level3">
<h3 class="hasAnchor">
<a href="#get-snps-bbmri" class="anchor"></a><code>get.snps.bbmri</code>
</h3>
<p>This function obtains the BBMRI SNP data. It limits the analysis to specified biobanks, reads in genotype data in chunks, removes SNPs with missing values (multiple biobanks/technologies), removes SNPs with a low minor allele frequency, and fuses data from multiple biobanks/technologies.</p>
</div>
<div id="get-exons-geuvadis" class="section level3">
<h3 class="hasAnchor">
<a href="#get-exons-geuvadis" class="anchor"></a><code>get.exons.geuvadis</code>
</h3>
<p>This function obtains the Geuvadis exon data. It retains exons on the autosomes, labels exons in the format “chromosome_start_end”, and extracts the corresponding gene names.</p>
</div>
<div id="get-exons-bbmri" class="section level3">
<h3 class="hasAnchor">
<a href="#get-exons-bbmri" class="anchor"></a><code>get.exons.bbmri</code>
</h3>
<p>This function obtains the BBMRI exon data. It loads quality controlled gene expression data, extracts sample identifiers, removes samples without SNP data, loads exon expression data, extracts sample identifiers, retains samples that passed quality control, and retains exons on the autosomes.</p>
</div>
<div id="match-samples" class="section level3">
<h3 class="hasAnchor">
<a href="#match-samples" class="anchor"></a><code>match.samples</code>
</h3>
<p>This function removes duplicate samples from each matrix, only retains samples appearing in all matrices, and brings the samples into the same order.</p>
</div>
</div>
<div id="analysis" class="section level2">
<h2 class="hasAnchor">
<a href="#analysis" class="anchor"></a>2. Analysis</h2>
<p>The <span class="math inline">\(n \times q\)</span> matrix <span class="math inline">\(\boldsymbol{Y}\)</span> represents the exons, and the <span class="math inline">\(n \times p_{chr}\)</span> matrices <span class="math inline">\(\boldsymbol{X}_{chr}\)</span> represents the SNPs, where <span class="math inline">\(chr \in \{1,\ldots,22\}\)</span>. The row names contain the sample identifiers, and the column names indicate the genomic location of the variables.</p>
<div id="adjust-samples" class="section level3">
<h3 class="hasAnchor">
<a href="#adjust-samples" class="anchor"></a><code>adjust.samples</code>
</h3>
<p>This function adjusts RNA-seq expression data for different library sizes. The <span class="math inline">\(n \times q\)</span> matrix <span class="math inline">\(\boldsymbol{Y}\)</span> contains the exon data. The library size are <span class="math inline">\(\boldsymbol{s}=(s_1,\ldots,s_n)^T\)</span>, where <span class="math inline">\(s_i=\sum_{j=1}^p Y_{ij}\)</span> for all <span class="math inline">\(i\)</span>. The mean library size is <span class="math inline">\(\bar{s}=\sum_{i=1}^n s_i / n\)</span>. We use edgeR to compute the normalisation factors <span class="math inline">\(\boldsymbol{\eta}=(\eta_1,\ldots,\eta_n)^T\)</span>. We then calculate the adjusted normalisation factors <span class="math inline">\(\boldsymbol{\gamma}=(\gamma_1,\ldots,\gamma_n)^T\)</span>, where <span class="math inline">\(\gamma_i=\eta_i*s_i / \bar{s}\)</span> for all <span class="math inline">\(i\)</span>. The adjusted value equals <span class="math inline">\(Y_{ij}/\gamma_i\)</span> for all samples <span class="math inline">\(i\)</span> and all covariates <span class="math inline">\(j\)</span>.</p>
</div>
<div id="adjust-variables" class="section level3">
<h3 class="hasAnchor">
<a href="#adjust-variables" class="anchor"></a><code>adjust.variables</code>
</h3>
<p>This function adjusts exon expression data for different exon lengths. We do this separately for each chromosome to decrease memory usage. For this adjustment, we temporarily transform matrices to vectors. An <span class="math inline">\(n \times p\)</span> matrix becomes a vector of length <span class="math inline">\(n \times p\)</span>, with the first <span class="math inline">\(p\)</span> entries corresponding to covariate <span class="math inline">\(1\)</span> and samples <span class="math inline">\(1\)</span> to <span class="math inline">\(n\)</span>, and the last <span class="math inline">\(p\)</span> entries corresponding to covariate <span class="math inline">\(p\)</span> and samples <span class="math inline">\(1\)</span> to <span class="math inline">\(n\)</span>. Let the vector <span class="math inline">\(\boldsymbol{y}=(Y_{11},\ldots,Y_{n1} \boldsymbol{,} \ldots \boldsymbol{,} Y_{1q},\ldots,Y_{nq})^T\)</span> represent exon expression. Let <span class="math inline">\(\boldsymbol{\gamma}=(\gamma_1,\ldots,\gamma_1 \boldsymbol{,} \ldots \boldsymbol{,} \gamma_q \ldots \gamma_q)^T\)</span> represent exon lengths. And let <span class="math inline">\(\boldsymbol{k}=(k_1,\ldots,k_1 \boldsymbol{,} \ldots \boldsymbol{,} k_q,\ldots,k_q)^T\)</span> represent gene names. So, <span class="math inline">\(\boldsymbol{\gamma}\)</span> and <span class="math inline">\(\boldsymbol{k}\)</span> contain <span class="math inline">\(q\)</span> blocks of <span class="math inline">\(n\)</span> equal entries. We regress <span class="math inline">\(\boldsymbol{y}\)</span> (exon expression) on a fixed effect for <span class="math inline">\(\gamma\)</span> (exon length) and a random effet for <span class="math inline">\(\boldsymbol{k}\)</span> (gene name). The residuals from this mixed model become our adjusted exon data.</p>
</div>
<div id="map-genes-map-exons-map-snps-drop-trivial" class="section level3">
<h3 class="hasAnchor">
<a href="#map-genes-map-exons-map-snps-drop-trivial" class="anchor"></a><code>map.genes</code>, <code>map.exons</code>, <code>map.snps</code>, <code>drop.trivial</code>
</h3>
<p>These functions select the variables for the spliceQTL test. First, we retrieve all protein-coding genes, excluding pseudogenes and other transcripts. Second, we attribute exons to genes, including exons within the gene. Third, we attribute SNPs to genes, including SNPs between (1) <span class="math inline">\(10\,000\)</span> base pairs before the start position of the gene, and (2) the end position of the gene. Although this might not occur in practice, exons or SNPs may be attributed to more than one gene. Finally, we exclude genes without any SNPs or with a single exon. It does not make sense to test whether these genes show alternative splicing.</p>
</div>
<div id="test-multiple" class="section level3">
<h3 class="hasAnchor">
<a href="#test-multiple" class="anchor"></a><code>test.multiple</code>
</h3>
<p>We want to test for alternative splicing along the whole genome. We do not calculate <span class="math inline">\(p\)</span>-values from an asymptotic distribution, but estimate them by permutation. If we tested a single gene, we could use a large number of permutations and obtain a precise estimate. We need at least <span class="math inline">\(21\)</span> permutations (including the identity) to reach the <span class="math inline">\(5\%\)</span> significance level. If one or two test statistics for the permuted data are larger than the one for the observed data, the estimated <span class="math inline">\(p\)</span>-value equals <span class="math inline">\(0.0476\)</span> (<span class="math inline">\(&lt;0.05\)</span>) or <span class="math inline">\(0.0952\)</span> (<span class="math inline">\(&gt;0.05\)</span>), respectively. If we test multiple genes, we will need more permutations to reach Bonferroni-significance. Using a fixed number of permutations would be too computationally expensive. This is why we invest less in genes with large <span class="math inline">\(p\)</span>-values and more in genes with small <span class="math inline">\(p\)</span>-values. For each gene, we use between <span class="math inline">\(100\)</span> and <span class="math inline">\(p/0.05+1\)</span> permutations, where <span class="math inline">\(p\)</span> is the number of genes. From <span class="math inline">\(100\)</span> permutations onwards, we repeatedly check whether two or more test statistics for the permuted data are larger than the one for the observed data. If yes, we interrupt permutation for this gene. If one or two test statistics for the permuted data are larger than the one for the observed data, the Bonferroni-adjusted estimated <span class="math inline">\(p\)</span>-value equals <span class="math inline">\(0.05*p/(p+0.05)\)</span> (<span class="math inline">\(&lt;0.05\)</span>) or <span class="math inline">\(0.1*p/(p+0.05)\)</span> (<span class="math inline">\(&gt;0.05\)</span>), respectively. These values converge to <span class="math inline">\(0.05\)</span> and <span class="math inline">\(0.1\)</span> when <span class="math inline">\(p\)</span> tends to infinity. Bonferroni-significance requires between <span class="math inline">\(8\,000\)</span> and <span class="math inline">\(60\,000\)</span> permutations on the chromosome level, depending on the number of genes, and about <span class="math inline">\(400\,000\)</span> permutations on the genome level. We therefore adjust for multiple testing for each chromosome, and not for the whole genome.</p>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#data">1. Data</a></li>
<li><a href="#analysis">2. Analysis</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Armin Rauschenberger, Renee Menezes.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>
......@@ -80,6 +80,9 @@
<li>
<a href="articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -54,6 +54,9 @@
<li>
<a href="articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -80,6 +80,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -3,4 +3,5 @@ pkgdown: 1.0.0
pkgdown_sha: d43ca38c74827d1d6babc3a80d48cd3a8e8fad8c
articles:
code: code.html
text: text.html
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -90,6 +90,9 @@ retains exons on the autosomes" />
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -86,6 +86,9 @@ extracts corresponding gene names" />
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -88,6 +88,9 @@ fuses data from multiple biobanks/technologies" />
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -88,6 +88,9 @@ changes sample identifiers" />
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
docs/reference/grid-1.png

11.2 KB | W: | H:

docs/reference/grid-1.png

11.3 KB | W: | H:

docs/reference/grid-1.png
docs/reference/grid-1.png
docs/reference/grid-1.png
docs/reference/grid-1.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -30,7 +30,7 @@
<meta property="og:title" content="Plot grid — grid" />
<meta property="og:description" content="This function tests for alternative splicing." />
<meta property="og:description" content="This function combines a scatter plot with a density plot." />
<meta name="twitter:card" content="summary" />
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......@@ -116,11 +119,11 @@
<div class="ref-description">
<p>This function tests for alternative splicing.</p>
<p>This function combines a scatter plot with a density plot.</p>
</div>
<pre class="usage"><span class='fu'>grid</span>(<span class='no'>x</span>, <span class='no'>y</span>, <span class='kw'>xlim</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>ylim</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>n</span> <span class='kw'>=</span> <span class='fl'>10</span>)</pre>
<pre class="usage"><span class='fu'>grid</span>(<span class='no'>x</span>, <span class='no'>y</span>, <span class='kw'>n</span> <span class='kw'>=</span> <span class='fl'>10</span>, <span class='no'>...</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
......@@ -133,24 +136,20 @@
<th>y</th>
<td><p>vector</p></td>
</tr>
<tr>
<th>xlim</th>
<td><p>horizontal limits</p></td>
</tr>
<tr>
<th>ylim</th>
<td><p>vertical limits</p></td>
</tr>
<tr>
<th>n</th>
<td><p>grid resolution</p></td>
</tr>
<tr>
<th>...</th>
<td><p>graphical parameters</p></td>
</tr>
</table>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='no'>x</span> <span class='kw'>&lt;-</span> <span class='kw pkg'>stats</span><span class='kw ns'>::</span><span class='fu'><a href='http://www.rdocumentation.org/packages/stats/topics/Beta'>rbeta</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='fl'>100</span>,<span class='kw'>shape1</span><span class='kw'>=</span><span class='fl'>0.2</span>,<span class='kw'>shape2</span><span class='kw'>=</span><span class='fl'>0.5</span>)
<span class='no'>y</span> <span class='kw'>&lt;-</span> <span class='kw pkg'>stats</span><span class='kw ns'>::</span><span class='fu'><a href='http://www.rdocumentation.org/packages/stats/topics/Beta'>rbeta</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='fl'>100</span>,<span class='kw'>shape1</span><span class='kw'>=</span><span class='fl'>0.2</span>,<span class='kw'>shape2</span><span class='kw'>=</span><span class='fl'>0.5</span>)
<pre class="examples"><div class='input'><span class='no'>x</span> <span class='kw'>&lt;-</span> <span class='kw pkg'>stats</span><span class='kw ns'>::</span><span class='fu'><a href='http://www.rdocumentation.org/packages/stats/topics/Beta'>rbeta</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='fl'>100</span>,<span class='kw'>shape1</span><span class='kw'>=</span><span class='fl'>0.3</span>,<span class='kw'>shape2</span><span class='kw'>=</span><span class='fl'>0.5</span>)
<span class='no'>y</span> <span class='kw'>&lt;-</span> <span class='kw pkg'>stats</span><span class='kw ns'>::</span><span class='fu'><a href='http://www.rdocumentation.org/packages/stats/topics/Beta'>rbeta</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='fl'>100</span>,<span class='kw'>shape1</span><span class='kw'>=</span><span class='fl'>0.3</span>,<span class='kw'>shape2</span><span class='kw'>=</span><span class='fl'>0.5</span>)
<span class='fu'>grid</span>(<span class='no'>x</span>,<span class='no'>y</span>)</div><div class='img'><img src='grid-1.png' alt='' width='700' height='433' /></div><div class='input'>
</div></pre>
</div>
......
......@@ -80,6 +80,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -85,6 +85,9 @@ and brings samples into the same order." />
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -85,6 +85,9 @@ Some functions only work on the virtual machine (see below)." />
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -83,6 +83,9 @@
<li>
<a href="../articles/code.html">rainbow (code)</a>
</li>
<li>
<a href="../articles/text.html">rainbow (text)</a>
</li>
</ul>
</li>
<li>
......
......@@ -4,25 +4,23 @@
\alias{grid}
\title{Plot grid}
\usage{
grid(x, y, xlim = NULL, ylim = NULL, n = 10)
grid(x, y, n = 10, ...)
}
\arguments{