Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let mylist=list(sex = c(1,1,1,1,2,2,2,2,2,2), smoking = c(1,0,1,0,1,0,1,0,1,1), age=c(21:30)). Give the results of these R commands: 1) x = lapply(mylist, max); print(x); y = sapply(mylist, min);

Let mylist=list(sex = c(1,1,1,1,2,2,2,2,2,2), smoking = c(1,0,1,0,1,0,1,0,1,1), age=c(21:30)). Give the results of these R commands:

1) x = lapply(mylist, max); print(x); y = sapply(mylist, min); print(y)

2) z = mapply(function(p1,p2,p3){c(p1,p2,p3)}, mylist$sex, mylist[[2]], mylist[['age']]); print(z)

3) class(x); class(y); class(z)

Please explain the difference among x, y and z in terms of the above results briefly.

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

Is your management system defined?

Answered: 1 week ago

Question

Do you have a comprehensive communication plan for your strategy?

Answered: 1 week ago

Question

Do you have sufficiently ambitious milestones?

Answered: 1 week ago