Skip to contents

get invalid names (labels not in ontology) & add geno

Usage

subset_invalid_cols(x)

Arguments

x

a dataframe

Value

a dataframe

Examples

f <- system.file("uon-trial-1.csv", package = "pbwrangler")
df <- read_workbooks(dir = NULL, file_to_read = f) %>%
  purrr::map(
    ., ~dplyr::mutate(
      ., year = "2024", loc = "UON", trial = "lbht"
    )
  )
#> Rows: 108 Columns: 32
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (8): unique, geno, flowering_date, flower_colour, flesh_colour, skin_co...
#> dbl (24): plot, entry, row, col, rep, ntp, npe, growth_speed, pgh, plant_uni...
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
df_out <- pre_process_trials(df) |> process_trials() %>%
  purrr::map(., run_data_processes) %>% `[[`(1) 
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Joining with `by = join_by(old_family_code)`
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "flesh_colour", "skin_colour", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "flesh_colour", "skin_colour", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "flesh_colour", "skin_colour", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")
#> Warning: Rows with out of scale values replaced with NA for variable nmtp: 54 
#> Warning: Rows with extreme values replaced with NA for variable atmw: 54 
#> Warning: Rows with extreme values replaced with NA for variable mtwp: 54 
#> Warning: Rows with extreme values replaced with NA for variable mtyna: 54 
#> Warning: pt crop detected
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")
#> Warning: Some variables have been overwritten: c("atmw", "ppe", "mtyna")
#> Warning: pt crop detected
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")
#> Warning: Rows with out of scale values replaced with NA for variable tbfsh1: 1 2 3 4 5 6 19 20 21 22 23 24 37 38 39 40 41 42 55 56 57 58 59 60 73 74 75 76 77 78 91 92 93 94 95 96 
#> Warning: Rows with out of scale values replaced with NA for variable tbskn1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 
#> Warning: pt crop detected
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")
#> Warning: Some variables have been overwritten: c("atmw", "ppe", "mtyna")
#> Warning: pt crop detected
#> Warning: Some columns with invalid names: c("unique", "entry", "growth_speed", "flowering_date", "flower_colour", "overall_impression", "late_blight_60_days", "obs", "photo", "trial", "n_tubers")

subset_invalid_cols(df_out) %>% colnames(.)
#> Warning: pt crop detected
#>  [1] "geno"                "unique"              "entry"              
#>  [4] "growth_speed"        "flowering_date"      "flower_colour"      
#>  [7] "overall_impression"  "late_blight_60_days" "obs"                
#> [10] "photo"               "trial"               "n_tubers"