Question: 1 2 . Write a function called add _ four ( that adds the number 4 to each element of a numeric vector. (

12. Write a function called "add_four(" that adds the number 4 to each element of a numeric vector. (2pt)
13. Write a function called "my_fun()" that divides each element of a numeric vector by the sum of that vector. (2pt)
14. Write a for loop that calculates the mean of each of the first three variables in the data frame trees (accessible in base R) and saves them to an output vector. (4pts) This is multipart:
- create empty output vector (2pt)
- write for loop that fills the empty vector with calculated means (2pt)
1 2 . Write a function called "add _ four ( "

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!