Question: The data file called countries . csv in the DataForLabs folder contains information about all the countries on Earth. Each row is a country, and
The data file called countriescsv in the DataForLabs folder contains information about all the countries on Earth. Each row is a country, and each column contains a variable.
Use read.csv to read the data from this file into a data frame called countries.
Use summary to get a quick description of this data set. What are the first three variables?
Using the output of summary how many countries are from Africa in this data set?
What kinds of variables ie categorical or numerical are continents, cellphonesubscriptionsperpeople totalpopulationinthousands and finesfortobaccoadvertisingDont go by their variable names look at the data in the summary results to decide.
Add a new column to your countries data frame that has the difference in ecological footprint between and What is the mean of this difference? Note: this variable will have missing data which means that some of the countries do not have data in this file for one or the other of the years of ecological footprint. By default, R doesnt calculate a mean unless all the data are present. To tell R to ignore the missing data, add an option to the mean command that says narmTRUE. Well learn more about this later.
Using the countries data again, create a new data frame called AfricaData, that only includes data for countries in Africa. What is the sum of the totalpopulationinthousands for this new data fram
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
