Question: 1. Given a triangle with sides L1, L2, L3 , its area is calculated via the formula Area = sqrt(p * (p - L1) *
1. Given a triangle with sides L1, L2, L3, its area is calculated via the formula Area = sqrt(p * (p - L1) * (p - L2) * (p - L3)), where p = (L1 + L2 + L3) / 2. Write an R function called tri_area that outputs the area of a triangle given its sides, and calculate the area of a triangle with sides L1 = 3, L2 = 4, L3 = 5.
2. in R, we use square brackets [ ] to refer to specific elements of a vector. How would you look up the third element of vector v?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
