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 tempcat that recodes the quantitative AverageTemperatureFahr data into a categorical variable as follows: If the temperature is greater than or equal to code it as "High" If the temperature is greater than or equal to and less than code it as "Medium" If the temperature is less than code it as "Low"That is each element of tempcat 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
