$29.99
Assignment – 6
Q1. Create the following data set with 20 different years and perform the following operations using ‘dplyr’ library.
Dataset:-
Features Data Type Characterstics
Country Char Name of country
Continent Char Name of continent
Year Int Year of data collection
LifeExp Dbl Life expectancy
Pop Int Population
gdpPerc Dbl GDP of the year
1. How many unique countries are represented per continent?
2. Which European nation had the lowest GDP per capita in a given year?
3. According to the data available, what was the average life expectancy across each continent in a given year?
4. What 5 countries have the highest total GDP over all years combined?
5. What countries and years had life expectancies of at least 80 years?
6. What 10 countries have the strongest correlation (in either direction) between life expectancy and per capita GDP?
7. Which combinations of continent (besides Asia) and year have the highest average population across all countries?
8. Which three countries have had the most consistent population estimates (i.e. lowest standard deviation) across the years of available data?
9. Excluding records from a given year, which observations indicate that the population of a country has decreased from the previous year and the life expectancy has increased?
Q2. Use the R to answer the following questions:
1. Create a database file “DataSet.csv” that contains 10 records of medicine with attribute : MedID, Med_Name, Company, Manf_year, Exp_date, Quantity_in_stock, Sales.
2. Read the data file and show the first 4 record of the file.
3. Read the data file and show the last 4 record of the file.
4. Find the coorelation between Quantity_in_stock and Exp_date.
5. Plot the bar graph for the Sales with year of manufacturing.
6. Find the company having more than one type of medicine.
7. Find the type of Medicine available.
8. Which medicines are expiring? Show by box plots.
9. Find the average stock in the store.
10. Draw the regression line between Manufacturing year and Sales.