(Use R) Suppose x and y are two vectors of names of same length which are separated with a space. Write a code that finds the name(s) that are common to both vectors. For example, if x and y are the following vectors, X y dog cat rat bat cat dad dog monster it should return "dog" and "cat."

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter8: Applications Of Trigonometry
Section8.3: Vectors
Problem 11E
Question
(Use R) Suppose x and y are two vectors of names of same length which are separated
with a space. Write a code that finds the name(s) that are common to both vectors. For
example, if x and y are the following vectors,
X
y
dog
cat
rat
bat
cat
dad
dog
monster
it should return "dog" and "cat."
Transcribed Image Text:(Use R) Suppose x and y are two vectors of names of same length which are separated with a space. Write a code that finds the name(s) that are common to both vectors. For example, if x and y are the following vectors, X y dog cat rat bat cat dad dog monster it should return "dog" and "cat."
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
College Algebra (MindTap Course List)
College Algebra (MindTap Course List)
Algebra
ISBN:
9781305652231
Author:
R. David Gustafson, Jeff Hughes
Publisher:
Cengage Learning
Elementary Linear Algebra (MindTap Course List)
Elementary Linear Algebra (MindTap Course List)
Algebra
ISBN:
9781305658004
Author:
Ron Larson
Publisher:
Cengage Learning
Intermediate Algebra
Intermediate Algebra
Algebra
ISBN:
9780998625720
Author:
Lynn Marecek
Publisher:
OpenStax College
Linear Algebra: A Modern Introduction
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
College Algebra
College Algebra
Algebra
ISBN:
9781337282291
Author:
Ron Larson
Publisher:
Cengage Learning