I have started learning R and the tidyverse. I want to tidy the Days
column in the below table. I want to make it so that there is a new column Control
which would be a logical column which would say if the sample was a control sample or a real sample.
I thought about creating a column that takes the value 1 if the Days
column had the word control in it and 0 if there was no "control" in it. How can I go about achieving that? Thank you all help is appreciated.
Name of the sample | Days | Compressive strength (N/mm2) |
---|---|---|
Bacillus sphaericus | 7 | 28 |
Bacillus sphaericus | 14 | 30 |
Bacillus sphaericus | 28 | 37.3 |
Bacillus sphaericus | Control 7 | 22 |
Bacillus sphaericus | Control 14 | 27.65 |
Bacillus sphaericus | Control 28 | 29.3 |