Question: Task 1 Please create two data frames according to the following two tables Table 1->classroom_capacity Classroom_id Capacity 1 23 2 25 4 20 Table 2->

Task 1

Please create two data frames according to the following two tables

Table 1->classroom_capacity

Classroom_id

Capacity

1

23

2

25

4

20

Table 2-> classroom_size

Classroom_id

size

1

900

2

800

3

850

Task 2

Please do an inner join for these two tables. Call the result data frame df1.

Task 3

Please do an outter join for these two tables, while keeping all the classroom_id in the classroom_capacity table. Call the result data frame df2.

Task 4

Extract the capacity column from the classroom_capacity data frame and call it mydata, then calculate the mean capacity using R programming

Task 5

Please define a data frame as the following. df=data.frame(

name=letters[1:5],

age=c(9,130,-2,3,15)

)

Now for invalid age input (either greater than 100 or smaller than 0), please replace them with a text string invalid.

Hint: you will need logical subscripting for the data frame.

Please use Rstudio only.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!