Question: What is the correct way to define a function in R that calculates the cube of a number? a . cube < - function (

What is the correct way to define a function in R that calculates the cube of a number?
a.
cube <- function(x){ x * x * x }
b.
cube(x)<- x^3
c.
cube = x => x^3
d.
function cube(x)= x^3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!