If you want to know all the values in c (1, 3, 5, 7, 10) that are not in c (1, 5, 10, 12, 14). Which in-built function in R can be used to do this? Also, how this can be achieved without using the in-built function.
Answer:
Using in-built function - setdiff(c (1, 3, 5, 7, 10), c (1, 5, 10, 11, 13))
Without using in-built function - c (1, 3, 5, 7, 10) [! c (1, 3, 5, 7, 10) %in% c (1, 5, 10, 11, 13).
ViewWhat will be the class of the resulting vector if you concatenate a number and a character?
Answer:
character
ViewWhat is meant by K-nearest neighbour?
Answer:
K-Nearest Neighbour is one of the simplest machine learning classification algorithms that is a subset of supervised learning based on lazy learning. In this algorithm the function is approximated locally and any computations are deferred until classification.
ViewWhat will be the class of the resulting vector if you concatenate a number and NA?
Answer:
number
ViewHow do you create log linear models in R language?
Answer:
Using the loglm () function
ViewWhat are the data types in R on which binary operators can be applied?
Answer:
Scalars, Matrices ad Vectors.
ViewWhat is the memory limit in R?
Answer:
8TB is the memory limit for 64-bit system memory and 3GB is the limit for 32-bit system memory.
ViewWhat are factor variable in R language?
Answer:
Factor variables are categorical variables that hold either string or numeric values. Factor variables are used in various types of graphics and particularly for statistical modelling where the correct number of degrees of freedom is assigned to them.
ViewHow can you add datasets in R?
Answer:
rbind () function can be used add datasets in R language provided the columns in the datasets should be same.
ViewWhat is the difference between data frame and a matrix in R?
Answer:
Data frame can contain heterogeneous inputs while a matrix cannot. In matrix only similar data types can be stored whereas in a data frame there can be different data types like characters, integers or other data frames.
ViewWhich package in R supports the exploratory analysis of genomic data?
Answer:
adegenet
ViewWhat will be the output of the below code -
Answer:
printmessage <- function (a) {
if (is.na (a))
print ("a is a missing value!")
else if (a < 0)
print ("a is less than zero")
else
print ("a is greater than or equal to zero")
invisible (a)
}
printmessage (NA)
The output for the above R programming code will be “a is a missing value.” The function is.na () is used to check if the input passed is a missing value.
ViewHow is a Data object represented internally in R language?
Answer:
unclass (as.Date (“2016-10-05″))
ViewWhat will be the output of log (-5.8) when executed on R console?
Answer:
Executing the above on R console will display a warning sign that NaN (Not a Number) will be produced because it is not possible to take the log of negative number.
ViewWhat is the best way to use Hadoop and R together for analysis?
Answer:
HDFS can be used for storing the data for long-term. MapReduce jobs submitted from either Oozie, Pig or Hive can be used to encode, improve and sample the data sets from HDFS into R. This helps to leverage complex analysis tasks on the subset of data prepared in R.
ViewWhat is the command used to store R objects in a file?
Answer:
save (x, file=”x.Rdata”)
ViewWhat are the different type of sorting algorithms available in R language?
Answer:
Bucket Sort
Selection Sort
Quick Sort
Bubble Sort
Merge Sort
ViewIn base graphics system, which function is used to add elements to a plot?
Answer:
boxplot () or text ()
Viewdplyr package is used to speed up data frame management code. Which package can be integrated with dplyr for large fast tables?
Answer:
data.table
ViewWhat are with () and BY () functions used for?
Answer:
With () function is used to apply an expression for a given dataset and BY () function is used for applying a function each level of factors.
View© 2017 QuizBucket.org