Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions 1 0 0 XP We will combine a number of functions for this exercise. Use the ifelse function to write one line of code
Instructions
XP
We will combine a number of functions for this exercise.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started