library(mosaic)
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
Integrasi adalah proses untuk menghitung integral suatu fungsi. Ini digunakan untuk menemukan luas di bawah kurva fungsi atau menemukan nilai total suatu fungsi dalam suatu interval. Integral tentu merupakan salah satu contoh dari operasi integral
contoh integrasi :
# Menggunakan fungsi integrate() untuk menghitung integral
f <- function(x) {
return(x^3)
}
f
## function(x) {
## return(x^3)
## }
# Batas integral
a <- 1
b <- 3
# Menghitung integral tentu dari a hingga b
result <- integrate(f, lower = a, upper = b)
result
## 20 with absolute error < 2.2e-13
kode di atas menggunakan integrasi untuk menghitung nilai integral yang sudah di masukkan kedalam fungsi f(x)