Publications by Muhammad Bilal

Assignment 07

29.11.2023

Formula method barplot(GNP ~ Year, data = longley) barplot(cbind(Employed, Unemployed) ~ Year, data = longley) 3rd form of formula - 2 categories op <- par(mfrow = 2:1, mgp = c(3,1,0)/2, mar = .1+c(3,3:1)) summary(d.Titanic <- as.data.frame(Titanic)) ## Class Sex Age Survived Freq ## 1st :8 Male :16 Child:16...

505 sym 24 img

Assignment 07

29.11.2023

library(dslabs) data("longley") head(longley) ## GNP.deflator GNP Unemployed Armed.Forces Population Year Employed ## 1947 83.0 234.289 235.6 159.0 107.608 1947 60.323 ## 1948 88.5 259.426 232.5 145.6 108.632 1948 61.122 ## 1949 88.2 258.054 368.2 161.6 109.773 1...

4375 sym R (4262 sym/26 pcs) 15 img

Assignment 06(d.f)

26.10.2023

For Merging Data frames : df1<-data.frame(age = c(23,13,27,36,14),name = c("Bilal","hamza","hassan","haseeb","Tooba")) df2<-data.frame(name = c("talha","manan","Abdullah","shayan","hanan"),gpa = c(2.1,1.3,2.5,2.6,3.6)) df3<-data.frame(age = c(21,13,25,26,23),name = c("saad","Adeel","Waleed","ubaid","Irum")) ndf1<-merge(df1,df3, all = TRUE) m...

105 sym

Assignment05(Ex 3.15)

24.10.2023

Exercise 3.15 Load Library and Data library(dslabs) data(murders) Question 01: Compute the per 100,000 murder rate for each state and store it in an object called murder_rate. Then use logical operators to create a logical vector named low that tells us which entries of murder_rate are lower than 1. murder_rate <- murders$total / murders$popu...

1582 sym R (2195 sym/19 pcs)

Assignment 05 (C.w)

24.10.2023

Classs Work Make Dataframe df <- data.frame(name = c("Ali","Ahmad","haseeb","Adil","Subhan","Arbaz","Athar","Hassan","Waleed","mehru", "bilal"), cgpa = c(2.5,3.2,3.9,2.99,3.10,2.99,2.91,2.87,3.2,3.52,3.47), grade = c("D","B","A","C","B","A","B","B","B","A","A")) (a) Which students have cgpa greater or equal 3.1...

221 sym

Assignment 04

19.10.2023

library(dslabs) data("murders") df<-murders Exercise 3.11 Question 01: Use the $ operator to access the population size data and store it as the object pop. Then use the sort function to redefine pop so that it is sorted. Finally, use the [ operator to report the smallest population size pop <- df$population pop <- sort(pop) pop[1] ## [1] ...

2244 sym R (2958 sym/23 pcs)

Document

17.10.2023

Loading Data library("dslabs") data("murders") df <- murders Question 1:Use the function c to create a vector with the average high temperatures in January for Beijing, Lagos,Paris, Rio de Janeiro, San Juan and Toronto, which are 35, 88, 42, 84, 81, and 30 degrees Fahrenheit.Call the object temp. temp<-c('Beijing'=35,'Lagos'=88,'Paris'=42,' R...

1333 sym R (2636 sym/27 pcs)

Assignment 03 (Ex 3.9)

17.10.2023

Loading Data library("dslabs") data("murders") df <- murders Question 1:Use the function c to create a vector with the average high temperatures in January for Beijing, Lagos,Paris, Rio de Janeiro, San Juan and Toronto, which are 35, 88, 42, 84, 81, and 30 degrees Fahrenheit.Call the object temp. temp<-c('Beijing'=35,'Lagos'=88,'Paris'=42,' R...

1333 sym R (2636 sym/27 pcs)

Assignment 03 (Ex 3.6)

17.10.2023

Loading Data library("dslabs") data("murders") df <- murders Question 1: Use the function str to examine the structure of the murders object. We can see that this object is a data frame with 51 rows and fve columns. Which of the following best describes the variables represented in this data frame? str(df) ## 'data.frame': 51 obs. of 5 va...

777 sym R (2312 sym/15 pcs)