Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Collapse all of the lines in jane.vector into one big string, separating each line by a space in doing so, using the paste() command.

image text in transcribed
image text in transcribed
image text in transcribed
2. Collapse all of the lines in jane.vector into one big string, separating each line by a space in doing so, using the paste() command. Call the resulting string jane.string. In the following problems, be sure you are using string commands such as substr, gsub/sub, strsplit, etc. a. How many characters does jane.string have? b. Display the 120 th 170 th characters in jane.string. c. Display the last 50 characters of jane.string.3.Split up jane.string into words, using the strsplit() command, and save the result as jane.all. Be absolutely sure you understand the structure of the object that strsplit returns! Note: pay attention to how you should split the strings in questions-look at the syntax for strsplit for this! d. What type of object is jane.all? Is it easy to work with? e. How many components does jane.all have? Save the first component of jane.all as a vector of strings called jane.words, and answer the following questions. (Note: this is a simple subsetting command! The rest of these questions deal again with vector subsetting. a. How long is this vector, i.e., how many words are there? b. Display words 900 through 1050 . a. Give the 5 number summary of characters in the words. What is the word with the largest number of characters? b. How many words have 8 characters? List a few of these words. 4.To really study this set of words, we first need to see just how flawed the data is. There are probably digits, empty characters, punctuation marks that are saved as words. Use a grep command to see if there is any punctuation in jane.words. Then, show exactly what one of those lines contains. 6The easiest way to deal with the punctuation problem is to use strsplit to split on punctuation as well as blanks. (So we are redoing the exercise above in part 3). Execute the following line to do so: jane.allv

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions