<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/the-trapezoidal-rule-of-numerical-integration-in-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.aaronschlegel.com/the-trapezoidal-rule-of-numerical-integration-in-r/"> R – Aaron Schlegel</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>Part of 8 in the series <a rel="nofollow" href="http://www.aaronschlegel.com/series/numerical-analysis/" title="Numerical Analysis" target="_blank">Numerical Analysis</a></div>
<p>The Trapezoidal Rule is another of <a rel="nofollow" href="https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas" target="_blank">Closed Newton-Cotes formulas</a> for approximating the definite integral of a function. The trapezoidal rule is so named due to the area approximated under the integral <img alt="\int^a_b f(x) \space dx" title="\int^a_b f(x) \space dx" src="https://s0.wp.com/latex.php?latex=%5Cint%5Ea_b+f%28x%29+%5Cspace+dx&bg=ffffff&fg=000&s=0" class="latex"> representing a trapezoid. Although there exist much more accurate quadrature methods, the trapezoidal rule converges rather fast comparatively and is known to be extremely accurate when approximating the definite integral of periodic functions.</p>
<h6>The Trapezoidal Rule</h6>
<p>The trapezoidal rule is a 2-point Closed Newton-Cotes formula that is based somewhat on the midpoint rule, in which the interval <img alt="[a, b]" title="[a, b]" src="https://s0.wp.com/latex.php?latex=%5Ba%2C+b%5D&bg=ffffff&fg=000&s=0" class="latex"> is divided into <img alt="n" title="n" src="https://s0.wp.com/latex.php?latex=n&bg=ffffff&fg=000&s=0" class="latex"> subintervals of equal width:</p>
<img alt=" \large{h = \frac{b - a}{n}} " title=" \large{h = \frac{b - a}{n}} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7Bh+%3D+%5Cfrac%7Bb+-+a%7D%7Bn%7D%7D+&bg=ffffff&fg=000&s=0" class="latex">
<p>Summed over the <img alt="n" title="n" src="https://s0.wp.com/latex.php?latex=n&bg=ffffff&fg=000&s=0" class="latex"> points, the approximation becomes:</p>
<img alt=" \large{\int^b_a f(x) dx \approx \frac{h}{2}[f(x_0) + f(x_1)] \qquad h = x_1 - x_0} " title=" \large{\int^b_a f(x) dx \approx \frac{h}{2}[f(x_0) + f(x_1)] \qquad h = x_1 - x_0} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint%5Eb_a+f%28x%29+dx+%5Capprox+%5Cfrac%7Bh%7D%7B2%7D%5Bf%28x_0%29+%2B+f%28x_1%29%5D+%5Cqquad+h+%3D+x_1+-+x_0%7D+&bg=ffffff&fg=000&s=0" class="latex">
<p>Which is the definition of the Trapezoidal Rule for a uniformly-spaced grid of points. The error term is <img alt="\frac{h^3}{12} f^{\prime\prime}(\epsilon)" title="\frac{h^3}{12} f^{\prime\prime}(\epsilon)" src="https://s0.wp.com/latex.php?latex=%5Cfrac%7Bh%5E3%7D%7B12%7D+f%5E%7B%5Cprime%5Cprime%7D%28%5Cepsilon%29&bg=ffffff&fg=000&s=0" class="latex">, which indicates the error can be computed exactly if <img alt="f \in C^2 [a, b]" title="f \in C^2 [a, b]" src="https://s0.wp.com/latex.php?latex=f+%5Cin+C%5E2+%5Ba%2C+b%5D&bg=ffffff&fg=000&s=0" class="latex"> (the function is twice differentiable on the interval <img alt="[a, b]" title="[a, b]" src="https://s0.wp.com/latex.php?latex=%5Ba%2C+b%5D&bg=ffffff&fg=000&s=0" class="latex">). The Trapezoidal Rule with the error term applied becomes:</p>
<img alt=" \large{\int^b_a f(x) dx = \frac{h}{2}[f(x_0) + f(x_1)] - \frac{h^3}{12} f^{\prime\prime}(\epsilon)} " title=" \large{\int^b_a f(x) dx = \frac{h}{2}[f(x_0) + f(x_1)] - \frac{h^3}{12} f^{\prime\prime}(\epsilon)} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint%5Eb_a+f%28x%29+dx+%3D+%5Cfrac%7Bh%7D%7B2%7D%5Bf%28x_0%29+%2B+f%28x_1%29%5D+-+%5Cfrac%7Bh%5E3%7D%7B12%7D+f%5E%7B%5Cprime%5Cprime%7D%28%5Cepsilon%29%7D+&bg=ffffff&fg=000&s=0" class="latex">
<h6>Trapezoidal Rule Example</h6>
<p>We will use the Trapezoidal Rule to approximate the following definite integral:</p>
<img alt=" \large{\int_0^{\frac{\pi}{4}} x \space sin \space x \space dx} " title=" \large{\int_0^{\frac{\pi}{4}} x \space sin \space x \space dx} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint_0%5E%7B%5Cfrac%7B%5Cpi%7D%7B4%7D%7D+x+%5Cspace+sin+%5Cspace+x+%5Cspace+dx%7D+&bg=ffffff&fg=000&s=0" class="latex">
<p>The following image depicts how the trapezoidal rule approximates the integral of the function in the interval. The darker area represents the actual area under the function. The trapezoid rule approximates the area under the function by constructing the trapezoid and calculating its area.</p>
<pre>
# Replicate the function in R
f &lt;- function(x) {
  return(x * sin(x))
}

# Create a data frame to store all the points needed for the approximation trapezoid
df &lt;- data.frame(cbind(c(0, pi/4, pi/4, 0), c(0, f(pi/4), 0, 0)))

# Plot the function and its approximation by the trapezoidal rule
ggplot(data = data.frame(x = 0), mapping = aes(x = x)) + 
  stat_function(fun = f, size = 1.05, alpha = 0.75, color='blue') + 
  geom_segment(aes(x = 0, y = 0, xend = pi/4, yend = f(pi/4))) + 
  geom_segment(aes(x = pi/4, y = 0, xend = pi/4, yend = f(pi/4))) + 
  geom_polygon(data = df, aes(x=X1, y=X2), fill = 'blue', alpha = 0.2) + 
  geom_area(stat = 'function', fun = f, fill = 'black', alpha = 0.3, xlim = c(0, pi/4)) + 
  xlim(c(-0.5,1))
</pre>
<p><a rel="nofollow" href="http://www.aaronschlegel.com/?attachment_id=22600" target="_blank"><img sizes="(max-width: 1060px) 100vw, 1060px" src="https://i0.wp.com/www.aaronschlegel.com/wp-content/uploads/trapezoid1.png?resize=1060%2C757" alt="Trapezoidal rule approximation visualization" class="wp-image-22600" data-recalc-dims="1"></a></p>
<p>Approximating this integral with the Trapezoidal Rule:</p>
<img alt=" \large{\int_0^{\frac{\pi}{4}} x \space sin \space x \space dx \approx \frac{\frac{\pi}{4} - 0}{2}[(0 * sin(0)) + (\frac{\pi}{4} sin(\frac{\pi}{4}))] = 0.2180895} " title=" \large{\int_0^{\frac{\pi}{4}} x \space sin \space x \space dx \approx \frac{\frac{\pi}{4} - 0}{2}[(0 * sin(0)) + (\frac{\pi}{4} sin(\frac{\pi}{4}))] = 0.2180895} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint_0%5E%7B%5Cfrac%7B%5Cpi%7D%7B4%7D%7D+x+%5Cspace+sin+%5Cspace+x+%5Cspace+dx+%5Capprox+%5Cfrac%7B%5Cfrac%7B%5Cpi%7D%7B4%7D+-+0%7D%7B2%7D%5B%280+%2A+sin%280%29%29+%2B+%28%5Cfrac%7B%5Cpi%7D%7B4%7D+sin%28%5Cfrac%7B%5Cpi%7D%7B4%7D%29%29%5D+%3D+0.2180895%7D+&bg=ffffff&fg=000&s=0" class="latex">
<pre>
(pi/4)/2 * ((0 * sin(0)) + (pi/4 * sin(pi/4)))
## [1] 0.2180895
</pre>
<p>Integrating the function over the interval yields <img alt="\frac{\pi - 4}{4\sqrt{2}} = 0.15175" title="\frac{\pi - 4}{4\sqrt{2}} = 0.15175" src="https://s0.wp.com/latex.php?latex=%5Cfrac%7B%5Cpi+-+4%7D%7B4%5Csqrt%7B2%7D%7D+%3D+0.15175&bg=ffffff&fg=000&s=0" class="latex">, which gives an error of 0.0663395.</p>
<p>For a second example, apply the Trapezoidal Rule to approximate the definite integral:</p>
<img alt=" \large{\int^1_0 x^2 \space e^{-x} \space dx} " title=" \large{\int^1_0 x^2 \space e^{-x} \space dx} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint%5E1_0+x%5E2+%5Cspace+e%5E%7B-x%7D+%5Cspace+dx%7D+&bg=ffffff&fg=000&s=0" class="latex">
<p>Visualizing how the trapezoidal rule approximates the integral:</p>
<pre>
f2 &lt;- function(x) {
  return(x^2 * exp(-x))
}

df &lt;- data.frame(cbind(c(0, 1, 1, 0), c(0, f2(1), 0, 0)))

ggplot(data = data.frame(x = 0), mapping = aes(x = x)) + 
  stat_function(fun = f2, size = 1.05, alpha = 0.75, color='blue') + 
  geom_segment(aes(x = 0, y = 0, xend = 1, yend = f2(1))) + 
  geom_segment(aes(x = 1, y = 0, xend = 1, yend = f2(1))) + 
  geom_polygon(data = df, aes(x=X1, y=X2), fill = 'blue', alpha = 0.2) + 
  geom_area(stat = 'function', fun = f2, fill = 'black', alpha = 0.3, xlim = c(0, 1)) + 
  xlim(c(0,1))
</pre>
<p><a rel="nofollow" href="http://www.aaronschlegel.com/?attachment_id=22601" target="_blank"><img sizes="(max-width: 1060px) 100vw, 1060px" src="https://i1.wp.com/www.aaronschlegel.com/wp-content/uploads/trapezoid2.png?resize=1060%2C757" alt="Zoomed in approximation of function with trapezoidal rule" class="wp-image-22601" data-recalc-dims="1"></a></p>
<img alt=" \large{\int^1_0 x^2 \space e^{-x} \space dx \approx \frac{1 - 0}{2}[(0 * (0)^2 e^0) + ((1)^2 e^{-1})] = 0.1839397} " title=" \large{\int^1_0 x^2 \space e^{-x} \space dx \approx \frac{1 - 0}{2}[(0 * (0)^2 e^0) + ((1)^2 e^{-1})] = 0.1839397} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint%5E1_0+x%5E2+%5Cspace+e%5E%7B-x%7D+%5Cspace+dx+%5Capprox+%5Cfrac%7B1+-+0%7D%7B2%7D%5B%280+%2A+%280%29%5E2+e%5E0%29+%2B+%28%281%29%5E2+e%5E%7B-1%7D%29%5D+%3D+0.1839397%7D+&bg=ffffff&fg=000&s=0" class="latex">
<pre>
0.5 * ((0 * 0^2 * exp(0)) + (1^2 * exp(-1)))
## [1] 0.1839397
</pre>
<pre>
2 - 5/exp(1)
## [1] 0.1606028
</pre>
<p>The function integrated over the interval <img alt="[0, 1]" title="[0, 1]" src="https://s0.wp.com/latex.php?latex=%5B0%2C+1%5D&bg=ffffff&fg=000&s=0" class="latex"> is <img alt="2 - \frac{5}{e} = 0.1606028" title="2 - \frac{5}{e} = 0.1606028" src="https://s0.wp.com/latex.php?latex=2+-+%5Cfrac%7B5%7D%7Be%7D+%3D+0.1606028&bg=ffffff&fg=000&s=0" class="latex">. Therefore the error is 0.0233369.</p>
<h6>Trapezoidal Rule in R</h6>
<p>The Trapezoidal Rule is comparatively straightforward to implement in R.</p>
<pre>
trapezoid &lt;- function(f, a, b) {
  if (is.function(f) == FALSE) {
    stop('f must be a function with one parameter (variable)')
  }
  
  h &lt;- b - a
  
  fxdx &lt;- (h / 2) * (f(a) + f(b))
  
  return(fxdx)
}</pre>
<p>Test our implementation using the functions in the examples above.</p>
<pre>
trapezoid(f, 0, pi/4)
## [1] 0.2180895
</pre>
<pre>
trapezoid(f2, 0, 1)
## [1] 0.1839397
</pre>
<p>We see the function reports the same values as our manual calculations. Though the Trapezoidal Rule is straightforward to implement and is rather accurate in its approximations, it begins to fail (as do the other Newton-Cotes formulas) when applied over large integration intervals. A quick example using the function <img alt="x^2 - e^{-1}" title="x^2 - e^{-1}" src="https://s0.wp.com/latex.php?latex=x%5E2+-+e%5E%7B-1%7D&bg=ffffff&fg=000&s=0" class="latex"> integrated over the interval <img alt="[0, 10]" title="[0, 10]" src="https://s0.wp.com/latex.php?latex=%5B0%2C+10%5D&bg=ffffff&fg=000&s=0" class="latex">:</p>
<pre>
trapezoid(f2, 0, 10)
## [1] 0.02269996
</pre>
<pre>
# The function integrated over the interval
2 - (122/exp(10))
## [1] 1.994461</pre>
<p>The error becomes much higher as the integration interval increases. Composite methods, which implement a piecewise approach to numerical integration, are therefore generally preferred and used in actual practice.</p>
<h6>Composite Trapezoidal Rule</h6>
<p>The Composite Trapezoidal Rule, similar to other composite methods, divides the integral interval into <img alt="n" title="n" src="https://s0.wp.com/latex.php?latex=n&bg=ffffff&fg=000&s=0" class="latex"> subintervals. The Trapezoidal Rule is then performed on each of those <img alt="n" title="n" src="https://s0.wp.com/latex.php?latex=n&bg=ffffff&fg=000&s=0" class="latex"> subintervals. As before, we let the function <img alt="f" title="f" src="https://s0.wp.com/latex.php?latex=f&bg=ffffff&fg=000&s=0" class="latex"> be twice differentiable in the interval <img alt="[a, b]" title="[a, b]" src="https://s0.wp.com/latex.php?latex=%5Ba%2C+b%5D&bg=ffffff&fg=000&s=0" class="latex">, or more formally, <img alt="f \in C^2 [a, b]" title="f \in C^2 [a, b]" src="https://s0.wp.com/latex.php?latex=f+%5Cin+C%5E2+%5Ba%2C+b%5D&bg=ffffff&fg=000&s=0" class="latex">. We also let <img alt="h = (b - a) / n" title="h = (b - a) / n" src="https://s0.wp.com/latex.php?latex=h+%3D+%28b+-+a%29+%2F+n&bg=ffffff&fg=000&s=0" class="latex"> and <img alt="x_j = a + jh" title="x_j = a + jh" src="https://s0.wp.com/latex.php?latex=x_j+%3D+a+%2B+jh&bg=ffffff&fg=000&s=0" class="latex"> for each <img alt="j = 0, 1, \cdots, n" title="j = 0, 1, \cdots, n" src="https://s0.wp.com/latex.php?latex=j+%3D+0%2C+1%2C+%5Ccdots%2C+n&bg=ffffff&fg=000&s=0" class="latex">. The Composite Trapezoidal Rule, with its error term, is defined as:</p>
<img alt=" \large{\int^a_b f(x) \space dx = \frac{h}{2}\big[f(a) + 2 \sum^{n-1}_{j=1} f(x_j) + f(b) \big] - \frac{b - a}{12}h^2 f^{\prime\prime}(\mu)} " title=" \large{\int^a_b f(x) \space dx = \frac{h}{2}\big[f(a) + 2 \sum^{n-1}_{j=1} f(x_j) + f(b) \big] - \frac{b - a}{12}h^2 f^{\prime\prime}(\mu)} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint%5Ea_b+f%28x%29+%5Cspace+dx+%3D+%5Cfrac%7Bh%7D%7B2%7D%5Cbig%5Bf%28a%29+%2B+2+%5Csum%5E%7Bn-1%7D_%7Bj%3D1%7D+f%28x_j%29+%2B+f%28b%29+%5Cbig%5D+-+%5Cfrac%7Bb+-+a%7D%7B12%7Dh%5E2+f%5E%7B%5Cprime%5Cprime%7D%28%5Cmu%29%7D+&bg=ffffff&fg=000&s=0" class="latex">
<p>Where <img alt="a \leq \mu \leq b" title="a \leq \mu \leq b" src="https://s0.wp.com/latex.php?latex=a+%5Cleq+%5Cmu+%5Cleq+b&bg=ffffff&fg=000&s=0" class="latex">. As the Trapezoidal Rule only requires one interval in each iteration of the subintervals, <img alt="n" title="n" src="https://s0.wp.com/latex.php?latex=n&bg=ffffff&fg=000&s=0" class="latex"> can be either even or odd.</p>
<p>Let’s say we are interested in approximating the following integral using the Composite Trapezoidal Rule with <img alt="n = 8" title="n = 8" src="https://s0.wp.com/latex.php?latex=n+%3D+8&bg=ffffff&fg=000&s=0" class="latex"> subintervals:</p>
<img alt=" \large{\int_0^2 e^{2x} \space sin \space 3x \space dx} " title=" \large{\int_0^2 e^{2x} \space sin \space 3x \space dx} " src="https://s0.wp.com/latex.php?latex=+%5Clarge%7B%5Cint_0%5E2+e%5E%7B2x%7D+%5Cspace+sin+%5Cspace+3x+%5Cspace+dx%7D+&bg=ffffff&fg=000&s=0" class="latex">
<p>Replicate the function in R.</p>
<pre>
f3 &lt;- function(x) {
  return(exp(2 * x) * sin(3 * x))
}
</pre>
<p>Visualize the composite trapezoid rule and how it divides the interval <img alt="[a, b]" title="[a, b]" src="https://s0.wp.com/latex.php?latex=%5Ba%2C+b%5D&bg=ffffff&fg=000&s=0" class="latex"> into <img alt="n = 8" title="n = 8" src="https://s0.wp.com/latex.php?latex=n+%3D+8&bg=ffffff&fg=000&s=0" class="latex"> subintervals.</p>
<pre>
# Break the interval into n subintervals
seg &lt;- seq.int(0, 2, length.out = 9)

# Initialize an empty vector to store function outputs
fx &lt;- vector(length = length(seg))

# For each subinterval, calculate the function
for (i in 1:length(seg)) {
  fx[i] &lt;- f3(seg[i])
}

# Collect the needed points into a data.frame
df &lt;- data.frame(xend = seg, 
                 y = rep(0, 9), 
                 yend = fx, 
                 yend1 = c(fx[2:9], fx[9]), 
                 xend1 = c(seg[2:9], seg[9]))

# plot the function and its approximation
ggplot(data = df) + 
  stat_function(fun = f3, size = 1.05, alpha = 0.75, color='blue') + 
  geom_segment(aes(x=xend, y=y, xend=xend, yend=yend)) + 
  geom_segment(aes(x=xend, y=yend, xend=xend1, yend=yend1)) + 
  geom_ribbon(aes(x=xend, ymin=y, ymax=yend), fill = 'blue', alpha = 0.3) + 
  geom_area(stat = 'function', fun = f3, fill = 'black', alpha = 0.3, xlim = c(0, 2)) + 
  xlim(c(-0.5, 2))</pre>
<p><a rel="nofollow" href="http://www.aaronschlegel.com/?attachment_id=22602" target="_blank"><img sizes="(max-width: 1060px) 100vw, 1060px" src="https://i1.wp.com/www.aaronschlegel.com/wp-content/uploads/composite_trapezoid.png?resize=1060%2C757" alt="Composite Trapezoidal Rule visualization" class="wp-image-22602" data-recalc-dims="1"></a></p>
<p>The following function is an implementation of the composite trapezoidal rule.</p>
<pre>
composite.trapezoid &lt;- function(f, a, b, n) {
  if (is.function(f) == FALSE) {
    stop('f must be a function with one parameter (variable)')
  }
  
  h &lt;- (b - a) / n
  
  j &lt;- 1:n - 1

  xj &lt;- a + j * h

  approx &lt;- (h / 2) * (f(a) + 2 * sum(f(xj)) + f(b))
  
  return(approx)
}
</pre>
<p>Use the function to perform the composite trapezoid procedure.</p>
<pre>
composite.trapezoid(f3, 0, 2, 8)
## [1] -13.57598
</pre>
<p>Integrating the function over the interval <img alt="[0, 2]" title="[0, 2]" src="https://s0.wp.com/latex.php?latex=%5B0%2C+2%5D&bg=ffffff&fg=000&s=0" class="latex"> gives the actual value:</p>
<img alt=" \int_0^2 e^{2x} \space sin \space 3x \space dx = \frac{1}{13} (3 + e^4 (2 sin(6) - 3 cos(6))) \approx -14.214 " title=" \int_0^2 e^{2x} \space sin \space 3x \space dx = \frac{1}{13} (3 + e^4 (2 sin(6) - 3 cos(6))) \approx -14.214 " src="https://s0.wp.com/latex.php?latex=+%5Cint_0%5E2+e%5E%7B2x%7D+%5Cspace+sin+%5Cspace+3x+%5Cspace+dx+%3D+%5Cfrac%7B1%7D%7B13%7D+%283+%2B+e%5E4+%282+sin%286%29+-+3+cos%286%29%29%29+%5Capprox+-14.214+&bg=ffffff&fg=000&s=0" class="latex">
<p>The error is therefore <img alt="-14.214 - (-13.57598) = -0.63802" title="-14.214 - (-13.57598) = -0.63802" src="https://s0.wp.com/latex.php?latex=-14.214+-+%28-13.57598%29+%3D+-0.63802&bg=ffffff&fg=000&s=0" class="latex">.</p>
<p>Though the error is relatively large in this case, the composite trapezoid rule was more accurate than the trapezoid rule.</p>
<pre>
trapezoid(f3, 0, 2)
## [1] -15.25557</pre>
<p>The error is <img alt="-15.25557 - (-13.57598) = -1.67959" title="-15.25557 - (-13.57598) = -1.67959" src="https://s0.wp.com/latex.php?latex=-15.25557+-+%28-13.57598%29+%3D+-1.67959&bg=ffffff&fg=000&s=0" class="latex">. As the wideness of the interval increases, the less accurate the trapezoid rule becomes. Since this example considered the interval <img alt="[0, 2]" title="[0, 2]" src="https://s0.wp.com/latex.php?latex=%5B0%2C+2%5D&bg=ffffff&fg=000&s=0" class="latex">, the difference in accuracy between the composite and standard trapezoidal rules is not as drastic as it would be with a wider interval.</p>
<h6>References</h6>
<p>Burden, R. L., &amp; Faires, J. D. (2011). Numerical analysis (9th ed.). Boston, MA: Brooks/Cole, Cengage Learning.</p>
<p>Weisstein, Eric W. “Trapezoidal Rule.” From MathWorld–A Wolfram Web Resource. <a rel="nofollow" href="http://mathworld.wolfram.com/TrapezoidalRule.html" target="_blank">http://mathworld.wolfram.com/TrapezoidalRule.html</a></p>
<p>The post <a rel="nofollow" href="http://www.aaronschlegel.com/the-trapezoidal-rule-of-numerical-integration-in-r/" target="_blank">The Trapezoidal Rule of Numerical Integration in R</a> appeared first on <a rel="nofollow" href="http://www.aaronschlegel.com/" target="_blank">Aaron Schlegel</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.aaronschlegel.com/the-trapezoidal-rule-of-numerical-integration-in-r/"> R – Aaron Schlegel</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/AZdQa7zjrR0" height="1"></a></div>