Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem A. These problems will test your knowledge of basic and intermediate R commands. Do not use the dplyr library to answer these questions. Consider

Problem A. These problems will test your knowledge of basic and intermediate R commands. Do not use the dplyr library to answer these questions.

Consider the following small data set about 5 students

STUDENT

STATUS

SAT

John

In State

650

Joe

In State

710

Jade

Out of State

720

Jim

Out of State

690

Jenny

In State

775

  1. Create the STUDENT vector in R containing the names of the five students in the order shown on the able table. Similarly, create the vectors STATUS and SAT containing the respective data for each student. For the STATUS vector, just enter In for In State and Out for Out of State.

  1. Create a data frame called STUDENT_INFO containing the exact data above (including the student order and order that the variables appear).

  1. Write an R command for displaying the last two rows of STUDENT_INFO.

  1. Students with SAT of at least 750 or an In-State student are eligible for a scholarship. Write a single R statement (one line of R code) using logical and relational operators that will identify which student(s) is/are eligible for a scholarship by displaying a logical vector with 5 elements each of which is either TRUE or FALSE with TRUE representing being eligible. Which student(s) is/are eligible?

  1. Write a function named SIZE that will return the sum of the number of rows and column of a generic data frame called x. Test this function by calling using STUDENT_INFO as the argument. (Hint: you can use the dim command within the function)

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago

Question

What is loss of bone density and strength as ?

Answered: 1 week ago

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago