Skip to contents

compute derived phenotypic variables

Usage

run_data_processes(x, sz = 10000, btwn = 0.75, within = 0.3)

Arguments

x

a dataframe

sz

size of farm, here taken to be 10000 sq metres

btwn

spacing between ridges in metres

within

spacing between plants in the same ridge in metres

Value

a dataframe

Examples

f <- system.file("uon-trial-1.csv", package = "pbwrangler")
df <- read_workbooks(dir = NULL, file_to_read = f) 
#> 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)
#> 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", "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", "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", "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", "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", "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", "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", "n_tubers")
purrr::map(df_out, names_df)
#> $`UON-TRIAL-1`
#>  [1] "atmw"                "col"                 "entry"              
#>  [4] "flower_colour"       "flowering"           "flowering_date"     
#>  [7] "geno"                "growth_speed"        "late_blight_60_days"
#> [10] "mtwp"                "mtyna"               "n_tubers"           
#> [13] "nmtp"                "npe"                 "ntp"                
#> [16] "obs"                 "overall_impression"  "pgh"                
#> [19] "photo"               "plant_unif"          "plant_vigor"        
#> [22] "plot"                "ppe"                 "rep"                
#> [25] "row"                 "se"                  "tbfsh1"             
#> [28] "tbskn1"              "tub_size"            "tub_unif"           
#> [31] "tuber_apper"         "unique"             
#>