diff --git a/articles/defining-structure.html b/articles/defining-structure.html index 9487ad16..4a71c5a9 100644 --- a/articles/defining-structure.html +++ b/articles/defining-structure.html @@ -124,13 +124,13 @@

Units serve_table(demo) #> # Demo for defining units #> # An edibble: 4 x 1 -#> site -#> <U(4)> -#> <chr> -#> 1 site1 -#> 2 site2 -#> 3 site3 -#> 4 site4 +#> site +#> +#> <fct> +#> 1 site1 +#> 2 site2 +#> 3 site3 +#> 4 site4

If particular names are desired for the levels, then the RHS value can be replaced with a vector like below where the levels are named “Narrabri”, “Horsham”, “Parkes” and “Roseworthy”.

 design("Character vector input demo") %>% 
@@ -138,9 +138,9 @@ 

Units serve_table() #> # Character vector input demo #> # An edibble: 4 x 1 -#> site -#> <U(4)> -#> <chr> +#> site +#> +#> <fct> #> 1 Narrabri #> 2 Horsham #> 3 Parkes @@ -152,13 +152,13 @@

Units serve_table() #> # Numeric vector input demo #> # An edibble: 4 x 1 -#> site -#> <U(4)> -#> <dbl> -#> 1 1 -#> 2 2 -#> 3 3 -#> 4 4

+#> site +#> +#> <dbl> +#> 1 1 +#> 2 2 +#> 3 3 +#> 4 4

In the instance that you do want to enter a single level with a numeric value, this can be specified using lvls on the RHS.

 design("Single numeric level demo") %>% 
@@ -166,10 +166,10 @@ 

Units serve_table() #> # Single numeric level demo #> # An edibble: 1 x 1 -#> site -#> <U(1)> -#> <dbl> -#> 1 4

+#> site +#> +#> <dbl> +#> 1 4

Multiple units

@@ -194,19 +194,19 @@

Nested unitsserve_table() #> # Demo for defining units #> # An edibble: 72 x 2 -#> site plot -#> <U(4)> <U(72)> -#> <chr> <chr> -#> 1 site1 plot01 -#> 2 site1 plot02 -#> 3 site1 plot03 -#> 4 site1 plot04 -#> 5 site1 plot05 -#> 6 site1 plot06 -#> 7 site1 plot07 -#> 8 site1 plot08 -#> 9 site1 plot09 -#> 10 site1 plot10 +#> site plot +#> +#> <fct> <fct> +#> 1 site1 plot01 +#> 2 site1 plot02 +#> 3 site1 plot03 +#> 4 site1 plot04 +#> 5 site1 plot05 +#> 6 site1 plot06 +#> 7 site1 plot07 +#> 8 site1 plot08 +#> 9 site1 plot09 +#> 10 site1 plot10 #> # ℹ 62 more rows

In the above situation, the relationship between unit factors have to be apriori known, but there are situations in which the relationship may become cognizant only after defining the unit factors. In these situations, users can define the relationships using the functions allot_units and assign_units to add the edges between the relevant unit nodes in the factor and level graphs, respectively.

@@ -216,19 +216,19 @@ 

Nested unitsserve_table() #> # Demo for defining units #> # An edibble: 72 x 2 -#> site plot -#> <U(4)> <U(72)> -#> <chr> <chr> -#> 1 site1 plot01 -#> 2 site2 plot02 -#> 3 site3 plot03 -#> 4 site4 plot04 -#> 5 site1 plot05 -#> 6 site2 plot06 -#> 7 site3 plot07 -#> 8 site4 plot08 -#> 9 site1 plot09 -#> 10 site2 plot10 +#> site plot +#> +#> <fct> <fct> +#> 1 site1 plot01 +#> 2 site2 plot02 +#> 3 site3 plot03 +#> 4 site4 plot04 +#> 5 site1 plot05 +#> 6 site2 plot06 +#> 7 site3 plot07 +#> 8 site4 plot08 +#> 9 site1 plot09 +#> 10 site2 plot10 #> # ℹ 62 more rows

The code above specifies the nested relationship of plot to site, with the assignment of levels performed systematically. The systematic allocation of site levels to plot is done so that the site levels vary the fastest, which is not the same systematic ordering as before. If the same result as before is desirable, users can define order = "systematic-slowest", which offers a systematic assignment where the same levels are close together.

@@ -244,27 +244,27 @@

Crossed unitsserve_table() #> # Crossed experiment #> # An edibble: 18 x 3 -#> row col plot -#> <U(6)> <U(3)> <U(18)> -#> <chr> <chr> <chr> -#> 1 row1 col1 plot01 -#> 2 row2 col1 plot02 -#> 3 row3 col1 plot03 -#> 4 row4 col1 plot04 -#> 5 row5 col1 plot05 -#> 6 row6 col1 plot06 -#> 7 row1 col2 plot07 -#> 8 row2 col2 plot08 -#> 9 row3 col2 plot09 -#> 10 row4 col2 plot10 -#> 11 row5 col2 plot11 -#> 12 row6 col2 plot12 -#> 13 row1 col3 plot13 -#> 14 row2 col3 plot14 -#> 15 row3 col3 plot15 -#> 16 row4 col3 plot16 -#> 17 row5 col3 plot17 -#> 18 row6 col3 plot18 +#> row col plot +#> +#> <fct> <fct> <fct> +#> 1 row1 col1 plot01 +#> 2 row2 col1 plot02 +#> 3 row3 col1 plot03 +#> 4 row4 col1 plot04 +#> 5 row5 col1 plot05 +#> 6 row6 col1 plot06 +#> 7 row1 col2 plot07 +#> 8 row2 col2 plot08 +#> 9 row3 col2 plot09 +#> 10 row4 col2 plot10 +#> 11 row5 col2 plot11 +#> 12 row6 col2 plot12 +#> 13 row1 col3 plot13 +#> 14 row2 col3 plot14 +#> 15 row3 col3 plot15 +#> 16 row4 col3 plot16 +#> 17 row5 col3 plot17 +#> 18 row6 col3 plot18

The above table does not contain information on the site. For this, we need to combine the nesting and crossing structures, as shown next.

@@ -281,58 +281,58 @@

Complex unit structuresserve_table(complex) #> # Complex structure #> # An edibble: 72 x 4 -#> site col row plot -#> <U(4)> <U(24)> <U(12)> <U(72)> -#> <chr> <chr> <chr> <chr> -#> 1 Narrabri col01 row01 plot01 -#> 2 Narrabri col01 row02 plot02 -#> 3 Narrabri col01 row03 plot03 -#> 4 Narrabri col02 row01 plot04 -#> 5 Narrabri col02 row02 plot05 -#> 6 Narrabri col02 row03 plot06 -#> 7 Narrabri col03 row01 plot07 -#> 8 Narrabri col03 row02 plot08 -#> 9 Narrabri col03 row03 plot09 -#> 10 Narrabri col04 row01 plot10 -#> 11 Narrabri col04 row02 plot11 -#> 12 Narrabri col04 row03 plot12 -#> 13 Narrabri col05 row01 plot13 -#> 14 Narrabri col05 row02 plot14 -#> 15 Narrabri col05 row03 plot15 -#> 16 Narrabri col06 row01 plot16 -#> 17 Narrabri col06 row02 plot17 -#> 18 Narrabri col06 row03 plot18 -#> 19 Horsham col07 row04 plot19 -#> 20 Horsham col07 row05 plot20 +#> site col row plot +#> +#> <fct> <fct> <fct> <fct> +#> 1 Narrabri col01 row01 plot01 +#> 2 Narrabri col01 row02 plot02 +#> 3 Narrabri col01 row03 plot03 +#> 4 Narrabri col02 row01 plot04 +#> 5 Narrabri col02 row02 plot05 +#> 6 Narrabri col02 row03 plot06 +#> 7 Narrabri col03 row01 plot07 +#> 8 Narrabri col03 row02 plot08 +#> 9 Narrabri col03 row03 plot09 +#> 10 Narrabri col04 row01 plot10 +#> 11 Narrabri col04 row02 plot11 +#> 12 Narrabri col04 row03 plot12 +#> 13 Narrabri col05 row01 plot13 +#> 14 Narrabri col05 row02 plot14 +#> 15 Narrabri col05 row03 plot15 +#> 16 Narrabri col06 row01 plot16 +#> 17 Narrabri col06 row02 plot17 +#> 18 Narrabri col06 row03 plot18 +#> 19 Horsham col07 row04 plot19 +#> 20 Horsham col07 row05 plot20 #> # ℹ 52 more rows

You may realise that the labels for the rows do not start with “row1” for Horsham. The default output displays distinct labels for the unit levels that are actually distinct. This safeguards for instances where the relationship between factors is lost, and the analyst will have to guess what units may be nested or crossed. However, nested labels may still be desirable. You can select the factors to show the nested labels by naming these factors as arguments for the label_nested in serve_table (below shows the nesting labels for row and col – notice plot still shows the distinct labels).

 serve_table(complex, label_nested = c(row, col))
 #> # Complex structure 
 #> # An edibble: 72 x 4
-#>        site     col     row    plot
-#>      <U(4)> <U(24)> <U(12)> <U(72)>
-#>       <chr>   <chr>   <chr>   <chr>
-#>  1 Narrabri    col1    row1  plot01
-#>  2 Narrabri    col1    row2  plot02
-#>  3 Narrabri    col1    row3  plot03
-#>  4 Narrabri    col2    row1  plot04
-#>  5 Narrabri    col2    row2  plot05
-#>  6 Narrabri    col2    row3  plot06
-#>  7 Narrabri    col3    row1  plot07
-#>  8 Narrabri    col3    row2  plot08
-#>  9 Narrabri    col3    row3  plot09
-#> 10 Narrabri    col4    row1  plot10
-#> 11 Narrabri    col4    row2  plot11
-#> 12 Narrabri    col4    row3  plot12
-#> 13 Narrabri    col5    row1  plot13
-#> 14 Narrabri    col5    row2  plot14
-#> 15 Narrabri    col5    row3  plot15
-#> 16 Narrabri    col6    row1  plot16
-#> 17 Narrabri    col6    row2  plot17
-#> 18 Narrabri    col6    row3  plot18
-#> 19 Horsham     col1    row1  plot19
-#> 20 Horsham     col1    row2  plot20
+#>    site     col   row   plot  
+#>                               
+#>    <fct>    <fct> <fct> <fct> 
+#>  1 Narrabri NA    NA    plot01
+#>  2 Narrabri NA    NA    plot02
+#>  3 Narrabri NA    NA    plot03
+#>  4 Narrabri NA    NA    plot04
+#>  5 Narrabri NA    NA    plot05
+#>  6 Narrabri NA    NA    plot06
+#>  7 Narrabri NA    NA    plot07
+#>  8 Narrabri NA    NA    plot08
+#>  9 Narrabri NA    NA    plot09
+#> 10 Narrabri NA    NA    plot10
+#> 11 Narrabri NA    NA    plot11
+#> 12 Narrabri NA    NA    plot12
+#> 13 Narrabri NA    NA    plot13
+#> 14 Narrabri NA    NA    plot14
+#> 15 Narrabri NA    NA    plot15
+#> 16 Narrabri NA    NA    plot16
+#> 17 Narrabri NA    NA    plot17
+#> 18 Narrabri NA    NA    plot18
+#> 19 Horsham  NA    NA    plot19
+#> 20 Horsham  NA    NA    plot20
 #> # ℹ 52 more rows

You later find that the dimensions of Narrabri and Roseworthy are larger. The experimenter tells you that there are in fact 9 columns available, and therefore 27 plots at Narrabri and Roseworthy. The number of columns can be modified according to each site, as below, where col is defined to have 9 levels at Narrabri and Roseworthy but 6 levels elsewhere.

diff --git a/pkgdown.yml b/pkgdown.yml
index 6c961ae7..f2a49b13 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -3,7 +3,7 @@ pkgdown: 2.0.7
 pkgdown_sha: ~
 articles:
   defining-structure: defining-structure.html
-last_built: 2023-11-25T03:24Z
+last_built: 2023-12-08T04:49Z
 urls:
   reference: https://edibble.emitanaka.org/reference
   article: https://edibble.emitanaka.org/articles
diff --git a/reference/activate_provenance.html b/reference/activate_provenance.html
index 115d8a1b..33dc4ce4 100644
--- a/reference/activate_provenance.html
+++ b/reference/activate_provenance.html
@@ -94,7 +94,7 @@ 

Value

Examples

activate_provenance(takeout())
 #> → No name was supplied so selecting a random named experimental design...
-#> → Selected Latin Square Design
+#> → Selected Strip-Plot DesignSelected Strip-Unit Design
 #> <Provenance>
 #>   Public:
 #>     append_fct_edges: function (from, to, type = NULL, group = FALSE, attrs = NULL) 
@@ -175,27 +175,27 @@ 

Examples#> unit_values: function (id = NULL, fid = NULL) #> Private: #> add_trail_internal: function (code) -#> allot_id_last: 1 +#> allot_id_last: 2 #> anatomy: formula #> build_condtable: function (subgraph, return) #> build_subtable: function (subgraph, return) #> edbl_version: package_version, numeric_version -#> fct_id_last: 4 +#> fct_id_last: 6 #> fct_new_id: function (n = 1) #> graph: edbl_graph #> graph_topological_order: function (graph, reverse = TRUE) -#> lvl_id_last: 70 +#> lvl_id_last: 81 #> lvl_new_id: function (n = 1) #> name: edibble #> node_id_parent_child: function (id = NULL, role = NULL, type = NULL, node = c("factor", -#> recipe: design(.title = "Latin Square Design") set_units(.edibbl ... +#> recipe: design(.title = "Strip-Plot Design | Strip-Unit Design") ... #> record_track_internal: function () #> seed: list #> session_info: sessionInfo #> simulate: list #> simulate_result_env: environment #> table: list -#> title: Latin Square Design +#> title: Strip-Plot Design | Strip-Unit Design #> trail: list #> validate_id: function (id, n = NULL, role = NULL) #> validate_name: function (name) diff --git a/reference/allot_table.html b/reference/allot_table.html index 306dd6cf..9cde9300 100644 --- a/reference/allot_table.html +++ b/reference/allot_table.html @@ -67,7 +67,7 @@

Usage

allot_table(
-  .edibble,
+  .edibble = NULL,
   ...,
   order = "random",
   seed = NULL,
diff --git a/reference/assign_fcts.html b/reference/assign_fcts.html
index 819dfe51..32d3be29 100644
--- a/reference/assign_fcts.html
+++ b/reference/assign_fcts.html
@@ -134,10 +134,10 @@ 

Examples assign_trts() %>% serve_table() #> # An edibble: 10 x 2 -#> subject vaccine -#> <U(10)> <T(2)> -#> <chr> <chr> -#> 1 subject01 vaccine2 +#> subject vaccine +#> +#> <fct> <fct> +#> 1 subject01 vaccine1 #> 2 subject02 vaccine1 #> 3 subject03 vaccine2 #> 4 subject04 vaccine2 @@ -146,7 +146,7 @@

Examples#> 7 subject07 vaccine2 #> 8 subject08 vaccine1 #> 9 subject09 vaccine1 -#> 10 subject10 vaccine1 +#> 10 subject10 vaccine2 # 20 subjects, 2 blocks, assign subjects to blocks design() %>% @@ -156,27 +156,27 @@

Examples assign_units() %>% serve_table() #> # An edibble: 20 x 2 -#> subject block -#> <U(20)> <U(2)> -#> <chr> <chr> -#> 1 subject01 block2 -#> 2 subject02 block1 +#> subject block +#> +#> <fct> <fct> +#> 1 subject01 block1 +#> 2 subject02 block2 #> 3 subject03 block2 #> 4 subject04 block1 -#> 5 subject05 block2 -#> 6 subject06 block1 +#> 5 subject05 block1 +#> 6 subject06 block2 #> 7 subject07 block1 #> 8 subject08 block2 #> 9 subject09 block1 #> 10 subject10 block2 -#> 11 subject11 block1 -#> 12 subject12 block2 +#> 11 subject11 block2 +#> 12 subject12 block1 #> 13 subject13 block2 #> 14 subject14 block1 #> 15 subject15 block1 #> 16 subject16 block2 -#> 17 subject17 block1 -#> 18 subject18 block2 +#> 17 subject17 block2 +#> 18 subject18 block1 #> 19 subject19 block1 #> 20 subject20 block2

diff --git a/reference/autofill_rcrds.html b/reference/autofill_rcrds.html index 6e7040a3..d17bfbd2 100644 --- a/reference/autofill_rcrds.html +++ b/reference/autofill_rcrds.html @@ -69,7 +69,7 @@

Usage

-
autofill_rcrds(.data, ..., .seed = NULL)
+
autofill_rcrds(.data, ..., .seed = NULL, .nsim = 1L)
@@ -86,6 +86,10 @@

Arguments

is_edibble_design(takeout())
 #> → No name was supplied so selecting a random named experimental design...
-#> → Selected Split-Plot DesignSelected Split-Unit Design
+#> → Selected Completely Randomised Design
 #> [1] FALSE
 
diff --git a/reference/examine_process.html b/reference/examine_process.html index 73ac1431..f30a09e1 100644 --- a/reference/examine_process.html +++ b/reference/examine_process.html @@ -65,7 +65,7 @@

Usage

examine_process(data, process = NULL)
 
-examine_process_values(data, process = NULL)
+examine_process_values(data, process = NULL, sim = 1L)

@@ -78,6 +78,10 @@

Arguments

examine_recipe(takeout())
 #> → No name was supplied so selecting a random named experimental design...
-#> → Selected Hyper-Graeco-Latin Square Design
-#> design("Hyper-Graeco-Latin Square Design") %>%
-#>   set_units(block1 = 6,
-#>             block2 = 6,
-#>             block3 = 6,
-#>             block4 = 6,
-#>             unit = crossed_by(block1, block2, block3, block4)) %>%
-#>   set_trts(trt = 6) %>%
-#>   allot_trts(trt ~ unit) %>%
-#>   assign_trts("random", seed = 74) %>%
+#> → Selected Strip-Plot DesignSelected Strip-Unit Design
+#> design("Strip-Plot Design | Strip-Unit Design") %>%
+#>   set_units(block = 6,
+#>             row = nested_in(block, 6),
+#>             col = nested_in(block, 4),
+#>             unit = nested_in(block, crossed_by(row, col))) %>%
+#>   set_trts(trt1 = 6,
+#>            trt2 = 4) %>%
+#>   allot_trts(trt1 ~ row,
+#>              trt2 ~ col) %>%
+#>   assign_trts("random", seed = 193) %>%
 #>   serve_table()
 
diff --git a/reference/expect_rcrds.html b/reference/expect_rcrds.html index 2970c35f..baa0f002 100644 --- a/reference/expect_rcrds.html +++ b/reference/expect_rcrds.html @@ -63,7 +63,7 @@

Usage

-
expect_rcrds(.edibble, ..., .record = TRUE)
+
expect_rcrds(.edibble = NULL, ..., .record = TRUE)
@@ -114,24 +114,24 @@

Examples#> set_units(unit = 10) %>% #> set_trts(trt = 4) %>% #> allot_trts(trt ~ unit) %>% -#> assign_trts("random", seed = 489) %>% +#> assign_trts("random", seed = 425) %>% #> serve_table() #> #> # Completely Randomised Design #> # An edibble: 10 x 3 -#> unit trt y -#> <U(10)> <T(4)> <R(10)> -#> <chr> <chr> <dbl> -#> 1 unit01 trt3 o -#> 2 unit02 trt1 o -#> 3 unit03 trt2 o -#> 4 unit04 trt1 o -#> 5 unit05 trt2 o -#> 6 unit06 trt4 o -#> 7 unit07 trt3 o -#> 8 unit08 trt4 o -#> 9 unit09 trt4 o -#> 10 unit10 trt1 o +#> unit trt y +#> <R(10)> +#> <fct> <fct> <dbl> +#> 1 unit01 trt1 o +#> 2 unit02 trt3 o +#> 3 unit03 trt2 o +#> 4 unit04 trt3 o +#> 5 unit05 trt1 o +#> 6 unit06 trt4 o +#> 7 unit07 trt4 o +#> 8 unit08 trt3 o +#> 9 unit09 trt2 o +#> 10 unit10 trt1 o