DRAG DROP
You have an Execute R Script module that has one input from either a Partition and Sample module or a Web
service input module.
You need to preprocess tweets by using R. The solution must meet the following requirements:
Remove digits.
Remove punctuation.
Convert to lowercase.
How should you complete the R code? To answer, drag the appropriate values to the correct targets. Each
value may be used once, more than once, or not at all. You may need to drag the split bar panes or scroll to
view content.
NOTE: Each correct selection is worth one point.
Select and Place:

default input:
dataset <- maml.mapInputPort(1)
pick column/vector:
tweet_text <- dataset[[1]]
R Functions: sapply, gsub
gsub() function replaces all matches of a string, if the parameter is a string vector, returns a string vector of the same length and with the same attributes (after possible coercion to character). Elements of string vectors which are not substituted will be returned unchanged (including any declared encoding).
gsub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE,
fixed = FALSE, useBytes = FALSE)
0
0
Order of operations is also correct since the gsub( … , ignore.case = FALSE). If the order is flipped only the small letters are kept and capitals are replaced.
0
0