Q Create an R Function In this activity, you will need to review the formula for finding the distance between two points on a Cartesian coordinate system. You can visit the Purplemath website to learn how to calculate The Distance Formula.Links to an external site. Create an R function that calculates the distance between two points (x1,y1) and (x2,y2). The function will have four arguments that represent the x- and y-values of the two points and return the distance between the two points. Execute your function for the following four sets of points: 1. (2,3) and (13,8) 2. (?4,?1) and (7,?3) 3. (73,15) and (13,65) 4. (23,6) and (?3,56) Note: Do not change the fractions nor the square roots to decimal numbers for use in the function arguments. Enter the arguments as fractions and square roots. You may want to investigate how to enter a square root in R. Submit a document containing your R code and a screenshot of the execution and results for the four sets of points. ________________________________________ Save your assignments using a naming convention that includes your first and last name and the activity number (or description). Do not add punctuation or special characters.
View Related Questions