Publications by kk

Document

08.12.2022

R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within t...

591 sym 1 img

Lab1

08.12.2022

Q2 Create a vector named num with four elements (2, 0, 4, 6). #a.Display the third element of the vector. n<-c(2, 0, 4, 6) print(n[3]) ## [1] 4 #b.Display the all elements of the vector except first element. print(n[-1]) ## [1] 0 4 6 #c.Count the number of elements in the vector. print(length(n)) ## [1] 4 Q3 Create a vector named q3 that add two...

750 sym

Lab2

08.12.2022

Q1 In each case, what is the value of x? print(x<-2-1*2) ## [1] 0 print(x<-6/3-2+1*0+3/3-3) ## [1] -2 print(x<-19%%17%%13) ## [1] 2 print(x<-(19%%17)%%13) ## [1] 2 print(x<-19%%(17%%13)) ## [1] 3 print(x<-2^17%%17) ## [1] 2 print(x<-3-2%%5+3*2-4/2) ## [1] 5 Q2 Shorten the notation of following vectors print(x<-c(157:164)) ## [1] 157 158 159 160 ...

1402 sym

Lab3

09.12.2022

Q1 Create a list using R with the following values g1=1:10, g2=“R Programming”, g3= “HTML”. Then, count the number of objects in the list. After that, get the length of the first two vectors of the given list. mylist<- list(g1=c(1:10), g2="R Programming", g3="HTML") print(mylist) ## $g1 ## [1] 1 2 3 4 5 6 7 8 9 10 ## ## $g2 ## ...

2223 sym

Lab4

11.12.2022

Q1 Write R scripts using the selection flow control for each of the following. Determine the biggest number among three numbers. A switch statement that displays Sunday, Monday, …, Saturday, if the number is 0, 1, … 6. Determine whether the year is a leap year. A leap year is divisible by 4 but not by 100. A leap year is also divisible by 40...

1974 sym

Lab5

11.12.2022

Q1 Write R scripts for each of the following. A multiprint function that consists of two arguments n and c that prints n copies of character c. An ismultiply function that returns TRUE if the third argument is equal to the multiplication of the first and second argument. The default value of all arguments is 1. An issquare function that returns ...

2246 sym