LinkedIn skill assessment answers and questions — R (प्रोग्रामिंग भाषा)
“आर has established itself as a leading programming language in the realm of data analysis and statistical computing, renowned for its powerful capabilities and extensive library of packages. इस व्यापक मार्गदर्शिका में, we’re delighted to present a curated collection of skill assessment questions तथा जवाब के लिये आर.
Whether you’re a data scientist looking to enhance your analytical skills or a beginner eager to delve into the world of data science, this resource is tailored to help you become proficient in आर और इसके अनुप्रयोग. Join us as we explore the core concepts of R programming, including data manipulation, VISUALIZATION, statistical modelling, और अधिक, empowering you to unlock the full potential of this versatile language.”
Q1. How does a matrix differ from a data frame?
- A matrix may contain numeric values only.
- A matrix must not be singular.
- A data frame may contain variables that have different modes.
- A data frame may contain variables of different lengths.
What value does this statement return?
Q2.unclass(as.Date("1971-01-01"))
- 1
- 365
- 4
- 12
What do you use to take an object such as a data frame out of the workspace?
Q3.- remove()
- erase()
- detach()
- • ओएस इंस्टाल करने के विभिन्न तरीके()
Review the following code. What is the result of line 3?
Q4.xvect<-c(1,2,3)
xvect[2] <- "2"
xvect
- [1] 1 2 3
- [1] “1” 2 “3”
- [1] “1” “2” “3”
- [1] 7 9
The variable height is a numeric vector in the code below. Which statement returns the value 35?
Q5.-
height(length(height))
-
height[length(height)]
-
height[length[height]]
-
height(5)
the data frame is named rates. बयान sd(rates[, 2])
returns 39. As what does R regard Ellen’s product ratings?
Q6. नीचे दी गई छवि में, - sample with replacement
- आबादी
- trimmed sample
- नमूना <– not sure
Which choice does R regard as an acceptable name for a variable?
क्यू 7.-
Var_A!
-
\_VarA
-
.2Var_A
-
Var2_A
What is the principal difference between an array and a matrix?
क्यू 8.- A matrix has two dimensions, while an array can have three or more dimensions.
- An array is a subtype of the data frame, while a matrix is a separate type entirely.
- A matrix can have columns of different lengths, but an array’s columns must all be the same length.
- A matrix may contain numeric values only, while an array can mix different types of values.
Which is not a property of lists and vectors?
प्रश्न 9.- प्रकार
- लंबाई
- attributes
- अदिश
the data frame on lines 1 के माध्यम से 4 is named StDf. State and Capital are both factors. Which statement returns the results shown on lines 6 तथा 7?
प्र10. नीचे दी गई छवि में,- StDf[1:2,-3]
- StDf[1:2,1]
- StDf[1:2,]
- StDf[1,2,]
Which function displays the first five rows of the data frame named pizza?
प्रश्न 11.- BOF(pizza, 5)
- पहला(pizza, 5)
- सर्वश्रेष्ठ कॉलेज(pizza, 5)
- सिर(pizza, 5)
You accidentally display a large data frame on the R console, losing all the statements you entered during the current session. What is the best way to get the prior 25 statements back?
प्र12.- console(-25)
- console(reverse=TRUE)
- इतिहास()
- इतिहास(max.show = 25)
d.pizza is a data frame. It’s a column named temperature contains only numbers. If you extract temperature using the [] accessors, its class defaults to numeric. How can you access temperature so that it retains the class of data.frame?
प्रश्न 13.> class( d.pizza[ , "temperature" ] )
> "numeric"
-
class( d.pizza( , "temperature" ) )
-
class( d.pizza[ , "temperature" ] )
-
class( d.pizza$temperature )
-
class( d.pizza[ , "temperature", drop=F ] )
What does c contain?
प्र14.a <- c(3,3,6.5,8)
b <- c(7,2,5.5,10)
c <- a < b
- [1] NaN
- [1] -4
- [1] 4 -1 -1 2
- [1] TRUE FALSE FALSE TRUE
Review the statements below. Does the use of the dim function change the class of y, and if so what is y’s new class?
प्रश्न 15.> y <- 1:9
> dim(y) <- c(3,3)
- नहीं, y’s new class is “array”.
- हां, y’s new class is “आव्यूह”.
- नहीं, y’s new class is “vector”.
- हां, y’s new class is “integer”.
mydf$y
in this code?
प्र16. क्या है mydf <- data.frame(x=1:3, y=c("a","b","c"), stringAsFactors=FALSE)
- सूची
- string
- factor
- character vector
How does a vector differ from a list?
प्रश्न 17.- Vectors are used only for numeric data, while lists are useful for both numeric and string data.
- Vectors and lists are the same thing and can be used interchangeably.
- A vector contains items of a single data type, while a list can contain items of different data types.
- Vectors are like arrays, while lists are like data frames.
What statement shows the objects on your workspace?
प्रश्न 18.- list.objects()
- print.objects()
- getws()
- ls()
What function joins two or more column vectors to form a data frame?
क्यू19.- rbind()
- cbind()
- bind()
- coerce()
Review line 1 नीचे. What does the statement in line 2 वापस करना?
प्र20.1 mylist <- list(1,2,"C",4,5)
2 unlist(mylist)
- [1] 1 2 4 5
- “सी”
- [1] “1” “2” “सी” “4” “5”
- [1] 1 2 सी 4 5
What is the value of y in this code?
प्र21.x <- NA
y <- x/1
- Inf
- Null
- NaN
- वह
Two variable in the mydata data frame are named Var1 and Var2. How do you tell a bivariate function, such as cor.test, which two variables you want to analyze?
प्र22.-
cor.test(Var1 ~ Var2)
-
cor.test(mydata$(Var1,Var2))
-
cor.test(mydata$Var1,mydata$Var2)
-
cor.test(Var1,Var2, mydata)
A data frame named d.pizza is part of the DescTools package. A statement is missing from the following R code and an error is therefore likely to occur. Which statement is missing?
प्र23.library(DescTools)
deliver <- aggregate(count,by=list(area,driver), FUN=mean)
print(deliver)
-
attach(d.pizza)
-
summarize(deliver)
-
mean <- rbind(d.pizza,count)
-
deliver[!complete.cases(deliver),]
How to name rows and columns in DataFrames and Matrices F in R?
प्र24.- data frame: names() and rownames() आव्यूह: colnames() and row.names()
- data frame: names() and row.names() आव्यूह: dimnames() (not sure)
- data frame: colnames() and row.names() आव्यूह: names() and rownames()
- data frame: colnames() and rownames() आव्यूह: names() and row.names()
Which set of two statements-followed by the cbind() function-results in a data frame named vbound?
प्रश्न25.-
v1<-list(1,2,3)
v2<-list(c(4,5,6))
vbound<-cbind(v1,v2)
-
v1<-c(1,2,3)
v2<-list(4,5,6))
vbound<-cbind(v1,v2)
-
v1<-c(1,2,3)
v2<-c(4,5,6))
vbound<-cbind(v1,v2)
- none
ournames is a character vector. What values does the statement below return to Cpeople?
प्र26.Cpeople <- ournames %in% grep("^C", ournames, value=TRUE)
- records where the first character is a C
- any record with a value containing a C
- TRUE or FALSE, depending on whether any character in ournames is C
- TRUE and FALSE values, depending on whether the first character in an ournames record is C
What is the value of names(वी[4])?
प्र27.v <- 1:3
names(v) <- c("a", "b", "c")
v[4] <- 4
- “”
- डी
- NULL
- वह
Which of the following statements doesn’t yield the code output below. Review the following code. What is the result of line 3?
प्रश्न 28.x <- c(1, 2, 3, 4)
Output: [1] 2 3 4
- एक्स[कीबोर्ड संशोधक चाबियों का एक समूह है जिसका उपयोग अन्य कुंजियों के व्यवहार को बदलने के लिए किया जा सकता है(2, 3, 4)]
- एक्स[-1]
- एक्स[कीबोर्ड संशोधक चाबियों का एक समूह है जिसका उपयोग अन्य कुंजियों के व्यवहार को बदलने के लिए किया जा सकता है(-1, 0, 0, 0)]
- एक्स[कीबोर्ड संशोधक चाबियों का एक समूह है जिसका उपयोग अन्य कुंजियों के व्यवहार को बदलने के लिए किया जा सकता है(-1, 2, 3, 4)]
Given DFMerged <- merge(DF1, DF2) and the image below, how many rows are in DFMerged?
प्र29.- 6
- 9
- 3
- 0
What does R return in response to the final statement?
क्यू30.x<-5:8
names(x)<-letters[5:8]
x
- e f g h “5” “6” “7” “8”
- 5 6 7 8
- e f g h
- e f g h 5 6 7 8
How do you return “अक्टूबर” from x in this code?
प्रश्न31.x<-as.Date("2018-10-01")
- attr()
- महीने(एक्स)
- as.month(एक्स)
- महीना(एक्स)
How will R respond to the last line of this code?
प्र32.fact<-factor(c("Rep","Dem","Dem","Rep"))
fact
[1] Rep Dem Dem Rep
Levels: Rep Dem
fact[2]<-"Ind"
- >
- [,2]हम स्टैनफोर्ड विश्वविद्यालय में प्रोफेसर शांहुई फैन के नेतृत्व में एक टीम द्वारा विकसित शीतलन प्रणाली पर नजर रख रहे हैं जो एक इमारत और बीम से थर्मल गर्मी खींचती है
- invalid factor level, NA generated
- हम स्टैनफोर्ड विश्वविद्यालय में प्रोफेसर शांहुई फैन के नेतृत्व में एक टीम द्वारा विकसित शीतलन प्रणाली पर नजर रख रहे हैं जो एक इमारत और बीम से थर्मल गर्मी खींचती है
What does R return?
प्रश्न 33.StartDate<- as.Date("2020/2/28")
StopDate<- as.Date("2020/3/1")
StopDate-StartDate
- “1970-01-02”
- time difference of one day
- time difference of two days
- error in x-y: nonnumeric argument to binary operator
What does the expression mtrx * mtrx
करना ?
प्रश्न34. > mtrx <- matrix( c(3,5,8,4), nrow= 2,ncol=2,byrow=TRUE)
> newmat <- mtrx * mtrx
- it transpose mtrx
- it premultiplies the current netwmat row by the newmat column.
- it returns the results of a matrix multiplication
- It squares each cell in mtrx
> newmat
[,1] [,2]
[1,] 9 25
[2,] 64 16
# The `%*%` operator gives matrix multiplication
> mtrx %*% mtrx
[,1] [,2]
[1,] 49 35
[2,] 56 56
Which function in R combines different values into a single object?
क्यू35.- connect()
- concat()
- संपर्क Ajay करें()
- कीबोर्ड संशोधक चाबियों का एक समूह है जिसका उपयोग अन्य कुंजियों के व्यवहार को बदलने के लिए किया जा सकता है()
Which file contains settings that R uses for all users of a given installation of R?
प्र36.- Rdefaults.site
- Renviron.site
- Rprofile.site
- Rstatus.site
mdf is a data frame, which statement is true ?
प्रश्न37. अगर- ncol(mdf) equals लंबाई(mdf).
- The number of rows must equals the number of columns.
- The legnth of any column in mdf may differ from any other column in mdf
- All columns must have the same data type.
A list can contain a list as an element. MyList has five columns, and the third column’s item is a list of three items. How do you put all seven values in MyList into a single vector?
प्रश्न 38.- vector(MyList, length = 7)
- coerce(MyList, nrows = 1)
- unlist(MyList)
- coerce(MyList, nrows = 7)
Which strings could be returned by the function ls(path = “^V”)?
प्र39.- ANOVAData, anovadata
- VisitPCA, VarX
- VisitPCA, varx
- Xvar, Yvar
StDf is a data frame. Based on this knowledge, what does this statement return?
क्यू40.StDf[, -1]
- all but the first row and first column of StDf
- all but the final column of StDf
- all but the first column of StDf
- only the first column of StDf
Which statement enables you to interactively open a single file?
प्र41.- file.list()
- file.select()
- file.choose()
- file.open()
How are these data types alike: तार्किक, integer, numeric, और चरित्र?
प्र42.- Each is a type of data frame.
- Each is a type of atomic vector.
- Each is a type of complex vector.
- Each is a type of raw vector.
MyMat[ ,3]
subsetting operation return for this code?
प्रश्न 43. क्या करता है MyMat = matrix(c(7, 9, 8, 6, 10, 12),nrow=2,ncol=3, byrow = TRUE)
- :
[ ,3]
[1, ] 8
[2, ] 12
- :
[1] 8 12
- :
[1] 10 12
- :
[ ,3]
[1, ] 10
[2, ] 12
What does the function power.anova.test
वापस करना?
प्रश्न 44. - the probability of making a Type I error
- the probability of not making a Type II error
- the probability of making a Type II error
- the probability of not making a Type I error
Review the statement below. What is the effect of covariate:factor
on the analysis?
क्यू45. result <- lm(outcome ~ covariate + factor + covariate:factor, data = testcoef)
- It forces the intercepts of the individual regressions to zero.
- It calls for the effect of the covariate within each level of the factor.
- It calls for the effect of each variable from covariate to factor in testcoef.
- It forces the covariate to enter the equation before the factor levels.
# Example call to demonstrate. `Species` is a Factor. Petal.Length, Petal.Width are numeric.
# see `help(formula)` for more details on the formula specification. `:` is "effect modification" or "interaction"
> summary(lm(Petal.Length ~ Petal.Width + Species + Petal.Width:Species, data = iris))
...
Petal.Width:Speciesversicolor 1.3228 0.5552 2.382 0.0185 *
Petal.Width:Speciesvirginica 0.1008 0.5248 0.192 0.8480
...
A variable whose type is numeric can contain which items?
प्र46.- integers and real values
- पूर्णांकों, वास्तविक, and raw values
- real values only
- पूर्णांकों, वास्तविक, and logical values
What is the legitimate name of a data class in R?
प्रश्न 47.- property
- integer
- संख्या
- variant
How do you extract the values above the main diagonal from a square matrix named Rmat
?
प्रश्न 48. -
Rmat[upper.tri(Rmat)]
-
upper.triangular(Rmat)
-
upper.tri(Rmat)
-
upper.diag(Rmat)
x
is a vector of type integer, as shown on line 1 नीचे. What is the type of the result returned by the statement > MEDIAN(एक्स)?
प्र49. x <- c(12L, 6L, 10L, 8L, 15L, 14L, 19L, 18L, 23L, 59L)
- numeric
- integer
- एक
- दोहरा
A list named a
is created using the statement below. Which choice returns TRUE?
क्यू50. a <- list("10", TRUE, 5.6)
- is.list(ए[1])
- is.numeric(ए[1])
- is.logical(ए[1])
- is.character(ए[1])
How do you obtain the row numbers in a data frame named pizza
for which the value of pizza$delivery_min
is greater than or equal to 30?
प्रश्न51. - :
late_delivery <- pizza$delivery_min >= 30
index_late <- index(late_delivery)
index_late
- :
late_delivery <- pizza$delivery_min >= 30
rownum_late <- rownum(late_delivery)
rownum_late
- :
late_delivery <- pizza$delivery_min >= 30
which_late <- which(late_delivery)
which_late
- :
late_delivery <- pizza$delivery_min >= 30
late <- piza$late_delivery
pizza$late
Which function returns [1] TRUE FALSE TRUE
?
प्रश्न52. indat <- c("Ash Rd","Ash Cir","Ash St")
- grepl(“[Rd|Ave|डॉ|अनुसूचित जनजाति]”, indat)
- grepl(“Rd|Ave|डॉ|अनुसूचित जनजाति”, indat)
- grepl(“Rd,Ave,डॉ,अनुसूचित जनजाति”, indat)
- grepl(“[Rd],[Ave],[डॉ],[अनुसूचित जनजाति]”, indat)
Which statement returns the fourth row of a data frame named मछली?
प्रश्न53.- मछली[4, ]
- मछली( ,4)
- मछली(4, )
- मछली{4, }
What is the value of csum?
प्रश्न54.a <- c(1.2, 2, 3.5, 4)
b <- c(1.2, 2.2, 3.5, 4)
csum <-sum(a == b)
- 8
- 3
- 0.2
- 21.6
A list named ए is created using the statement below. Which choice returns TRUE?
प्रश्न54.a <- list("10", TRUE, 5.6)
- is.list(ए[1])
- is.numeric(ए[1])
- is.logical(ए[1])
- is.character(ए[1])
What is the result of these three lines of code?
प्रश्न55.vect1 <- c(1:4)
vect2 <- c(1:2)
vect1 * vect2
- [1] 1 4 3 8
- ERROR
- [1] 1 2 3 4 1 2
- [1] 1 2 3 4 2 4 6 8
Which choice returns [1] “2019-09-28”?
प्रश्न56.- प्रारूप(as.POSIXct(“Sep-28-2019 07:54:31 AM”,format=’%b%d%Y’))
- as.POSIXlt(“Sep-28-2019 07:54:31 AM”,format=’%b-%d-%Y’)
- as.POSIXct(“Sep-28-2019 07:54:31 AM UTC”)
- प्रारूप(as.POSIXct(“Sep-28-2019 07:54:31 AM UTC”,format=’%b-%d-%Y’))
The variable potus is a character vector, as shown in line 1 नीचे. Wich statement returns the results shown?
प्रश्न57.1 potus <- c("GHW Bush", "Clinton", "GW Bush", "Obama")
Results: [1] "GHW BUsh" "Clinton" "Obama"
- potus[-“GW Bush”]
- potus[1:2 4]
- potus[-3]
- potus[1,2,4]
A data frame contains two factor -fact1 and fact2- and a numerical outcome variable. Which statement returns results that do NOT include an interaction term?
प्र 58.- anova(lm(outcome ~ fact1 : fact2))
- anova(lm(outcome ~ fact1 * fact2))
- anova(lm(outcome ~ fact1 + fact2))
- anova(lm(outcome ~ fact1 + fact2 + fact1 : fact2))
Review line 1 नीचे. What does the statement on line 2 वापस करना?
प्रश्न59.1 myvect <- c(-2,-1,0)
2 as.logical(myvect)
- [1]-2 -1 0
- [1]TRUE TRUE FALSE
- [1]FALSE FALSE TRUE
- [1]NA NA NA
Which option setting can cause difficulty if you want to add to a variable’s possible values after you have designed an object’s initial data structure?
क्यू 60.- ()OPTIONS(colnames(एक्स)<-NULL)
- ()OPTIONS(max.print=5)
- ()OPTIONS(continue=”… “,
- ()OPTIONS(stringAsFactors=TRUE
In this image below, the data frame on lines 1 के माध्यम से 4 is named StDf. StDf contains no factors. Why does statement on line 6 वापस करना “चरित्र” while the statement on line 7 returns “data.frame”?
प्रश्न 61.- Each value in the first row is a character value, but the values in the third column include both character and numeric values.
- By specifying the final row, 3, and no column specified, StDf[3, ] calls for the complete structure.
- Columns in a data frame are vectors generally containing a single type of data. Rows in a data frame are lists, but they belong to a structure that has multiple rows: the data frame.
- Each value in the first column is a character value, but the values in the third row include both character and numeric values.
Review line 1. What does the statement on line 3 वापस करना?
प्रश्न 62.mtrx <- matrix(1:6, 3, 2)
mtrx[, -1]
-
-
-
-
[1] 4 5 6
Why does sum(!is.na(pizza$week)) return the number of rows with valid, non-NA values in the column named week?
प्रश्न 63.- The exclamation point in !is.na(pizza$week) reverses the meaning of the test it precedes.
- !is.na(pizza$week) counts the number of NA values in the column.
- !is.na(pizza$week) returns a vector of TRUE/FALSE values, in which TRUE is treated as a 0 and FALSE as a 1.
- !is.na(pizza$week) counts the number of non-missing values in the column.
How do you get documentation of an installed and loaded R package named dplyr and packages with dplyr as an alias?
प्रश्न 64.- मदद(dplyr)
- ? dplyr
- ?? dplyr
- Press the F1 key.
the data frame named iris includes a numeric vector named Petal.Length. Do the functions labeled Pair 1 and Pair 2 return the same information?
प्रश्न 65. नीचे दी गई छवि में,- नहीं, both the length and the class of the returned structures are different.
- हां, both pairs of statements return an object with the same length and class.
- नहीं, the length is the same but the class is different.
- नहीं, the class is the same but the length is different.
for R are the main feature that make it different from the original S language.
प्रश्न 66. NS _- closure rules
- scoping rules
- environment rules
- इनमे से कोई भी नहीं
Which of the following is a base package for R programming ?
प्रश्न 67.- औजार
- util
- लैंग
- All of the above
उत्तर छोड़ दें
आपको चाहिए लॉग इन करें या रजिस्टर करें एक नई टिप्पणी जोड़ने के लिए .