library(mosaicCalc)
## Loading required package: 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
## Loading required package: mosaicCore
##
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
##
## count, tally
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
#contoh memplot fungsi garis lurus:
slice_plot(3 * x + 2 ~ x, domain(x = range(0, 100)))
library(mosaicCalc)
A = 3
slice_plot( A * x ^ 2 ~ x, domain(x = range(0, 10)), color="red" )
slice_plot( cos(t) ~ t, domain(t = range(0,2*pi) ))
#Anda dapat menggunakan makeFun( )untuk memberi nama pada fungsi. Contohnya:
g <- makeFun(3*x^2 + 5*x + 2 ~ x)
slice_plot(g(x) ~ x , domain(x = range(-2, 2)))
#membuat ekspresi baru dari fungsi
library(mosaicCalc)
slice_plot(sqrt(abs(g(x))) ~ x, domain(x = range(-5,10)))
sumber : https://dtkaplan.github.io/RforCalculus/graphing-functions.html