Skip to contents

Create data of input rate information for a single input with some checks on the validity of the information provided by the user. This can be used to assign rates to experiment plots using assign_rates().

Usage

prep_rate(
  plot_info,
  gc_rate,
  unit,
  rates = NULL,
  min_rate = NA,
  max_rate = NA,
  num_rates = 5,
  design_type = NA,
  rank_seq_ws = NULL,
  rank_seq_as = NULL,
  rate_jump_threshold = NA
)

Arguments

plot_info

(data.frame) plot information created by make_input_plot_data

gc_rate

(numeric) Input rate the grower would have chosen if not running an experiment. This rate is assigned to the non-experiment part of the field. This rate also becomes one of the trial input rates unless you specify the trial rates directly using rates argument

unit

(string) unit of input

rates

(numeric vector) Default is NULL. Sequence of trial rates in the ascending order.

min_rate

(numeric) minimum input rate. Ignored if rates are specified.

max_rate

(numeric) maximum input rate. Ignored if rates are specified

num_rates

(numeric) Default is 5. It has to be an even number if design_type is "ejca". Ignored if rates are specified.

design_type

(string) type of trial design. available options are Latin Square ("ls"), Strip ("str"), Randomized Strip ("rstr"), Randomized Block ("rb"), Sparse ("sparse"), and Extra Jump-conscious Alternate "ejca". See the article on trial design for more details.

rank_seq_ws

(integer) vector of integers indicating the order of the ranking of the rates, which will be repeated "within" a strip.

rank_seq_as

(integer) vector of integers indicating the order of the ranking of the rates, which will be repeated "across" strip for their first plots.

rate_jump_threshold

(integer) highest jump in rate rank acceptable

Value

data.frame of input rate information

Examples

plot_info <-
  prep_plot(
    input_name = "seed",
    unit_system = "imperial",
    machine_width = 60,
    section_num = 24,
    harvester_width = 30,
    plot_width = 30
  )
#> 

prep_rate(
  plot_info,
  gc_rate = 30000,
  unit = "seeds",
  rates = c(20000, 25000, 30000, 35000, 40000)
)
#> You did not specify design_type. It is assumed to be of type ls.
#> # A tibble: 1 × 12
#>   input_name design_type gc_rate unit  tgt_rate_original tgt_rate_equiv min_rate
#>   <chr>      <lgl>         <dbl> <chr> <list>            <list>         <lgl>   
#> 1 seed       NA            30000 seeds <dbl [5]>         <dbl [5]>      NA      
#> # ℹ 5 more variables: max_rate <lgl>, num_rates <int>, rank_seq_ws <list>,
#> #   rank_seq_as <list>, rate_jump_threshold <lgl>