#set path directory #loading of dataset globst <- read.csv(“Lab 7 Dataset.csv”, header = TRUE,sep =‘,’) globst

#using tibble function to load the dataset library(tidyverse) as_tibble(globst)

#Finding missing values is.na(globst) sum(is.na(globst)) mean(is.na(globst))

#Displaying column names in a dataset names(globst)

#Finding the sum of 2011 tonnage produced by different headquarters sum(globst$“X2011.Tonnage..Millions.”)

#Sorting the headquarters of different companies globst[order(-globst$X2011.Tonnage..Millions.),]

Finding total tonnage of steel produced between 2011-2016 by headquarters

globst<-aggregate(x = globst\(X2011.Tonnage..Millions.,globst\)X2012.Tonnage..Millions.,globst\(X2013.Tonnage..Millions.,globst\)X2014.Tonnage..Millions.,globst\(X2015.Tonnage..Millions.,globst\)X2016.Tonnage..Millions., # Specify data column by = list(globst$Headquarters), # Specify group indicator FUN = sum) globst

plotting the barchart of different headquarters production

ggplot(data=globst, aes(x=Group.1, y=x)) + geom_bar(stat=“identity”, width=0.5)

plotting the piechart of different headquarters production

pie = ggplot(globst, aes(x=““, y=x, fill=Group.1)) + geom_bar(stat=”identity”, width=1) pie