Working with calculus in R
In this section, we will use the mosaicCalc
package to perform calculus-related operations. The functions we will work with are mostly analytical (have explicit expression) and simple in nature. The following code snippet checks if this package is installed and will install the package if the condition evaluates to true
, followed by importing the package to the current session:
if(!require("mosaicCalc")){ install.packages("mosaicCalc") } library(mosaicCalc)
To avoid too much imagination, a good way to learn about unknown functions is to plot them out. Let us see how to plot a function using the mosaicCalc
package.
Plotting basic functions
There are a few input parameters we need to specify upon plotting a function using the mosaicCalc
package. Overall, we need to specify the expression of the function, the input variable(s), the domain of each input variable used to plot the function, and the values of other parameters...