Question: What is the R code for below? Write a simple R function named circle.area() that takes a parameter d, which is the circles diameter, and

What is the R code for below?

Write a simple R function named circle.area() that takes a parameter d, which is the circles diameter, and returns the area of the corresponding circle. Note R has a number of embedded constants, such as pi, which is the well-known geometric constant. The area of a circle of diamter d is pi*d^2/4. Create a function to compute and return the area of a circle of diameter d. Close the function bracket and in the next line store a diamater value of 5 in a variable named d. Then, use the function paste() to output this result: "The area of a circle of diameter, d, is area.circle(d)**. Note: in some R routines, paste() will compute a value, but will not display a result (and sometimes it does). To ensure your results are printed, enclose everything in the paste() function within the print() function

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 Databases Questions!