Final answer:
To create an R script that defines the standardized tibble and then standardizes it, follow these steps: create a function called standardize_tibble() that takes in a tibble as input and applies the standardization process. Inside the standardize_tibble() function, create another function called standardize() that takes in a vector as input. Within the standardize() function, create two helper functions: center() to calculate the mean using the sum() function, and spread() to calculate the standard deviation using the sum() function. Finally, use the center() and spread() functions within the standardize() function to perform the centering and spreading operations on the input vector.
Step-by-step explanation:
To create an R script that defines the standardized tibble and then standardizes it, you can follow these steps:
- Create a function called standardize_tibble() that takes in a tibble as input and applies the standardization process.
- Inside the standardize_tibble() function, create another function called standardize() that takes in a vector as input.
- Within the standardize() function, create two helper functions: center() to calculate the mean using the sum() function, and spread() to calculate the standard deviation using the sum() function.
- Finally, use the center() and spread() functions within the standardize() function to perform the centering and spreading operations on the input vector.