Regular Expressions and Text Variables

Question 1
Marks : +2 | -2
Pass Ratio : 100%
Which of the following signs are used to indicate repetition?
#
*
All of the mentioned
Explanation:
* and + are metacharacters for repetition of data.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
Point out the wrong statement.
Variables with character values should be made less descriptive
Variables with character values should usually be made into factor variable
Common variables are used to apply transforms
All of the mentioned
Explanation:
Variables with character values should be made more descriptive.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
Which of the following function is used for fixing character vectors?
tolower
toUPPER
toLOWER
all of the mentioned
Explanation:
It translates character to lowercase.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
Point out the correct statement.
gsub is used for fixing character vectors
sub is used for finding values like grep
grep is used for fixing character vectors
none of the mentioned
Explanation:
sub and gsub is used for fixing character vectors.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Which of the following metacharacter is used to refer to any character?
%
@
.
All of the mentioned
Explanation:
A dot in function name can mean any of the following: nothing at all; a separator between method and class in S3 method.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
Regular expressions can be thought of as a combination of literals and metacharacters.
True
False
Explanation:
Regular expressions have rich set of metacharacters.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
Which of the following function is used for searching text strings by means of regular expression?
grepd
grepl
gepexpr
all of the mentioned
Explanation:
grep, grepl, regexpr, gregexpr and regexec search for matches to argument pattern within each element of a character vector.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
Which of the following is used for specifying character class with metacharacter?
[]
{}
/+
All of the mentioned
Explanation:
You can list set of characters to accept a given point in the match.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
Which of the following function is good for the automatic splitting of names?
split
strsplit
autsplit
none of the mentioned
Explanation:
strsplit split a character string or vector of character strings using a regular expression or a literal string.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
merge function is used for merging data frames.
True
False
Explanation:
To merge two data frames horizontally, use the merge function.