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
Get step-by-step solutions from verified subject matter experts
