create new family code per new naming convention
Source:R/create_family_vars.R
create_family_vars.Rd
create new family code per new naming convention
Examples
f <- system.file("uon-trial-1.xlsx", package = "pbwrangler")
df <- read_workbooks(dir = NULL, file_to_read = f, sheet_name = "Sheet 1") %>%
capture_location(.) %>% `[[`(1)
create_family_vars(df)[1:5, ]
#> Warning: There were 9 warnings in `dplyr::mutate()`.
#> The first warning was:
#> ℹ In argument: `old_year_of_cross = ifelse(...)`.
#> Caused by warning in `ifelse()`:
#> ! NAs introduced by coercion
#> ℹ Run `dplyr::last_dplyr_warnings()` to see the 8 remaining warnings.
#> geno loc old_family_code old_year_of_cross year_of_cross
#> 1 CIP317004.001 UON-TRIAL-1 CIP317004 2017 2021
#> 2 CIP317005.036 UON-TRIAL-1 CIP317005 2017 2021
#> 3 CIP317007.103 UON-TRIAL-1 CIP317007 2017 2021
#> 4 CIP317013.120 UON-TRIAL-1 CIP317013 2017 2021
#> 5 CIP317026.004 UON-TRIAL-1 CIP317026 2017 2021
#> new_family_code new_clone_id
#> 1 CIP321004 CIP321004.001
#> 2 CIP321005 CIP321005.036
#> 3 CIP321007 CIP321007.103
#> 4 CIP321013 CIP321013.120
#> 5 CIP321026 CIP321026.004