Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

=+What is the nature of the unions in the particular country?

Answered: 1 week ago