extract treatment information from output db names by using regular expression. It currently only works for two treatments.
extract_trts( filename, pattern = "(Ashley|Iversen).+SD\\d{1,2}", pattern_split = "(.+)(SD\\d{1,2})" )
| filename | a string or a full path of the db name |
|---|---|
| pattern | a regex pattern to remove extra strings other than treatment information |
a string with two elements. first is the site and the second is the sowing date