Publications by Fakhar Mahmood(DS-5121106)

Document

23.11.2023

#Example-1 data(“longley”) barplot(GNP ~ Year, data = longley) #Example-2 barplot(cbind(Employed, Unemployed) ~ Year, data = longley) #Example-3 op <- par(mfrow = 2:1, mgp = c(3,1,0)/2, mar = .1+c(3,3:1)) summary(d.Titanic <- as.data.frame(Titanic)) barplot(Freq ~ Class + Survived, data = d.Titanic, subset = Age == “Adult” & Sex == “M...

1180 sym

Document

23.11.2023

#boxplot graphs #method01 ### ** Examples boxplot on a formula: boxplot(count ~ spray, data = InsectSprays, col = “lightgray”) # add notches (somewhat funny here <–> warning “notches .. outside hinges”): boxplot(count ~ spray, data = InsectSprays, notch = TRUE, add = TRUE, col = “blue”) #method02 boxplot(decrease ~ treatment, data...

2196 sym

Document

24.10.2023

Load Library and Data library(dslabs) data(murders) Q1: 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$population * 100000 murder_...

1494 sym R (2195 sym/19 pcs)

Document

24.10.2023

Make Dataframe df <- data.frame(name = c("Ali", "Ahmad","Sania","Sara", "Adil","Sharjeel", "Subhan","Arbaz","Athar","Hassan","Waleed"), cgpa = c(2.5,3.2,3.9,2.99,3.10,2.99,2.91,2.87,3.2,3.52,2.50), grade = c("D","B","A","C","B","A","B","B","B","A","D")) (a) which students have cgpa gre...

207 sym

Document

19.10.2023

library(dslabs) ## Warning: package 'dslabs' was built under R version 4.2.3 data("murders") ** 1.. Use the $ operator to access the population size data and store it as the object pop. Then use the sort function to redefne pop so that it is sorted. Finally, use the [ operator to report the smallest population size. ** pop <- murders$population...

2911 sym R (11715 sym/35 pcs)

Document

17.10.2023

library(dslabs) ## Warning: package 'dslabs' was built under R version 4.2.3 data(murders) ##A.axemine str(murders) ## 'data.frame': 51 obs. of 5 variables: ## $ state : chr "Alabama" "Alaska" "Arizona" "Arkansas" ... ## $ abb : chr "AL" "AK" "AZ" "AR" ... ## $ region : Factor w/ 4 levels "Northeast","South",..: 2 4 4 2 4 4...

2074 sym R (9108 sym/63 pcs)

Publish Document

08.10.2023

1.How we load dataset? For loading data sets first we have to download Package “dslabs” then we run code library(dslabs) ## Warning: package 'dslabs' was built under R version 4.2.3 data("murders") 2.Store the state names in a vectors? state<-c(murders$state) state ## [1] "Alabama" "Alaska" "Arizona" ...

1913 sym R (10007 sym/119 pcs)