Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write R functions named my.all and my.any, each with a single argument x, which is a vector of logical values. Print an error message if

Write R functions named my.all and my.any, each with a single argument x, which is a vector of logical values. Print an error message if anything other than a vector of logical values is passed to either function. The function my.all should return TRUE if all of the elements of the vector are TRUE and FALSE otherwise. The function my.any should return TRUE if any of the elements of the vector are TURE and FALSE otherwise. Your R functions should be written without calling the built-in R functions named all or any. Tes your my.all and my.any functions on the following four vectors.

x=c(TRUE,TRUE,TRUE)

y=c(TRUE,TRUE,FALSE)

z=c(FALSE,FALSE,FALSE)

v=c("Cat","Dog","Rhino")

Please write your answer as it would be inserted in R

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_2

Step: 3

blur-text-image_3

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago

Question

1. How might volunteering help the employer and the employee?

Answered: 1 week ago