Writing Functions


  1. Copy the following function into an R chunk of your Rmd file and replace the spaces ________ with variables names for the input and output.
     convert_pounds_to_grams <- function(________) {
         grams = 453.6 * pounds
         return(________)
     }
    
  2. Use the function to calculate how many grams there are in 3.75 pounds.
  3. What are the following parts of the function called:
    • a)
        convert_pounds_to_grams
      
    • b)
        {
         grams = 453.6 * pounds
         return(________)
        }
      
    • c)
        function(________)