Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Needs to be in R! 1. Substrings and replacements Trump - Donald Trump others = c(Barack Obama, George Bush, Bill Clinton) a. Display the first

Needs to be in R! image text in transcribed
1. Substrings and replacements Trump - "Donald Trump" others = c("Barack Obama", "George Bush", "Bill Clinton") a. Display the first 5 letters from the string Trump. b. Display the first 5 letters from each of the strings in the vector others. C. Join Trump and others together into one vector of strings, called presidents. d. Display the last 3 letters from each of the strings in the vector presidents. e. Copy presidents over to a new string presidents.borg. Replace the last 4 letters in each of the strings in presidents.borg with "borg". Display the results. f. Run the following codes and explain the replacement results. college = "Dietrich" substr(college, 5, 9) - "right" college = "Dietrich" substr(college, 1, 3) = "Live" words = c("fat", "hat", "lamp", "glade") substr(words, 1, 1) = c("c", "b") animals = c("cat", "lion", "piggy", "chic ken") substr(animals, 1, 5) = c("kitty", "doggy subjects = c("Statistics", "Computer Scie nce", "Mathematics", "Engineering") ratings = c("Good", "Bad") substr(subjects, nchar(subjects)-nchar (ra tings ) +1, nchar(subjects)) = ratings

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

Discuss the various approaches to disciplinary action.

Answered: 1 week ago

Question

=+ Are they breakable for any reason?

Answered: 1 week ago

Question

=+When and under what circumstances are contracts renegotiated?

Answered: 1 week ago