Question
data set= 90.40,60.49,56.88,58.55,74.84,70.26,79.34,59.85,72.21,61.29,61.14,75.37,62.24,75.80,77.56,78.25,60.40,58.71,59.69,65.41,68.32,65.42,72.98,67.77 Task 1: Create a vector to enter car speed data. Use the vector to enter and save the car speed data from
data set= 90.40,60.49,56.88,58.55,74.84,70.26,79.34,59.85,72.21,61.29,61.14,75.37,62.24,75.80,77.56,78.25,60.40,58.71,59.69,65.41,68.32,65.42,72.98,67.77
Task 1: Create a vector to enter car speed data. Use the vector to enter and save the car speed data from the table below. Provide any name of your choice. Task 2: Obtain and present the average speed. Create an object to calculate mean speed and present it using the print(paste()) code combination. Use code round() to present the result using only two decimals. Note: Since this is the first time you will do it, I will help you with the codes, see the image above containing R codes. Task 3: Obtain and present the standard deviation. Create an object to calculate standard deviation and present it using the print(paste()) code combination. Use code round() to present the result using only two decimals.
Task 4: Obtain and present the median speed. Create an object named median_speed to calculate median and present it using the print(paste()) code combination. Use code round() to present the result using only two decimals. Task 5: Obtain and present the quantiles. Quantiles help you to understand distribution of your data, in this case, we will see what the values are at every quarter. Create objects to obtain and present: The minimum speed The 25th quantile The 50th quantile The 75th quantile The maximum value. Task 6: Delete values. Create a new object to delete the 90.40 value from your vector. Obtain the new mean. Note: There are different codes you can use to complete this task. Task 7: Add values. Add the value 55.87 mph to the new vector and obtain the new mean. Note: There are different codes you can use to complete this task. Task 8: Create vector sales. Create a vector named sales to store the following data: 180, 172, 129, 234, 258, 133, 215 Task 9: Create a title vector days. Create a vector named days to store the days of the week in the following order: Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday Task 10: Link the days of the week with the sales values. Note: See the Vectors and Matrices.R file. Task 11: Present sales again and observe the difference. After you link days to sales present the vector sales, it should contain the values and their corresponding day of the week. Presented as a matrix, this way, the days of the week are displayed in vertical order. Task 12: Create a vector indicating sales above $200. Create a new vector to store all sales above $200. Hint: TRUE and FALSE outcomes. Presented the new vector as a matrix (vertical order).
This table will list the days of the weeks and TRUE for all days with sales above $200. Task 13. Present good sales days using a table library. Using the console, install the package knitr on your computer (do not run the install package code on your report file). Then use code knitr::kable() to present only the days of the week with more than $200 in sales. Hint: Use square brackets [] to select observations of interest. Notice that this table will present only the days of the week with sales over $200, and their corresponding values. Task 14. Present only the days with sales below $200 Notice that this time you will use codes to extract and present only the days of the week, not their values. For this, repeat the above code selecting for values below $200. Then, from the list, use the names() code to list only the days of the week. Task 15. Present the total sales (sum) on the days with sales above $200. Task 16. Duplicate the following table using R codes. The following table shows customers average visits per day to four stores in three different African cities. Using the matrix strategy presented in the file Vectors and Matrices.R, enter the data from the table into your R Script file and present it using one of the two following codes: knitr::kable() or DT::datatable(). Important: Tasks 1 to 16 must be presented using an R script file. Once your file is ready, select all the codes together (select all) and run them together. You must not observe any mistakes and all codes must run correctly and show the outcomes in the console. Remember to use hashtags (#) to mark all non-coding text.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started