R Tutorials

Solve a Polynomial in R

A polynomial p(x) is an expression of the form: \(p(x) = a_0 + a_1x + a_2x^2 + a_3x^3 + … + a_nx^n\) Where n is any non-negative integer. Solve a polynomial p(x) in R To solve the equation \(p(x) = 0\) in R, we can use the function: polyroot. For example, let’s solve the equation: …

Solve a Polynomial in R Read More »

How to Solve an Equation in R

In this article, will use the uniroot.all() function from the rootSolve package to find all the solutions of an equation over a given interval (or domain). Input: uniroot.all() takes 2 arguments: a function f and an interval. How it works: Its searches the interval for all possible roots of f. Output: uniroot.all() returns a vector …

How to Solve an Equation in R Read More »