Question: Using R Programming !!! a

Using R Programming !!!

a<-tibble(id = sample(1:100, 20))

Please use R programming to pick a random 20 from 100 IDs and use the "mutate" function in another column as treatment as YES and NO.

10 IDs are under Yes and the remaining 10 IDs are under No

You can use the if-else statement. The example should be like this:-

ID Treatment
34 Yes
56 Yes
21 No
10 Yes
67 No

and so on till 20 rows.

Please show the R code!

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!