Question: We have the following dataframe in R: age

We have the following dataframe in R:

age<-c(67,54,49,50)

year_of_operation<-c(2011,2012,2010,2013)

No_Pos_aux<-c(3,0,1,2)

survival_status<-c(1,2,2,1)

df <- data.frame ( age,year_of_operation,No_Pos_aux,survival_status )

Do the following in R:

a. Create a dataframe consisting of only the last two columns.

b. Create a dataframe consisting of only the first and last row.

c. Create a dataframe called df2 where every entry in the No-Pos_aux and survival_status columns is 0

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!