Question: Now create another new data frame with only the temperature data for the Brazilian city of Canoas. The data includes the average monthly temperature (

Now create another new data frame with only the temperature data for the Brazilian city of Canoas. The data includes the average monthly temperature (in degrees Fahrenheit) for each month for a large number of years (in the column AverageTemperatureFahr). Next, create a vector called **temp_cat** that re-codes the quantitative AverageTemperatureFahr data into a categorical variable as follows: * If the temperature is greater than or equal to 74, code it as "High" * If the temperature is greater than or equal to 60 and less than 74, code it as "Medium" * If the temperature is less than 60, code it as "Low" That is, each element of **temp_cat** should contain a value of "High", "Medium" or "Low", depending on the corresponding element of AverageTemperatureFahr in the Canoas data frame. Finally, use the **table()** function of R to show how many months in the Canoas data frame are classified as "High", "Medium" or "Low" average monthly temperature.

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 Databases Questions!