Question: Use the ifelse function to write one line of code that assigns to the object new _ names the state abbreviation when the state name
Use the ifelse function to write one line of code that assigns to the object newnames the state abbreviation when the state name is longer than characters and assigns the state name when the name is not longer than characters.
For example, where the original vector has Massachusetts characters the new vector should have MA But where the original vector has New York characters the new vector should have New York as well.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
