""" Input paragraph """ my_para <- "This is first sentence. And this is second." """ splitting the paragraph into sentences using strsplit funtion """ sentencesList <- strsplit(my_para, "\\.") """ Getting the first sentence from the output and printing it """ firstSentence <- unlist(sentencesList)[1] firstSentence # "This is first sentence" # """ Splitting the first sentence into words using strsplit again """ wordsList <- strsplit(firstSentence, " ") wordsList # "This" "is" "first" "sentence" #