Skip to content

Commit

Permalink
Updated some things
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerssam committed Mar 28, 2024
1 parent 8e59d2a commit 1acb8f6
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 184 deletions.
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# biometryassist 1.1.4

## Minor changes

- Implemented the ability to plot designs with buffer plots

## Bug fixes

-




# biometryassist 1.1.3

## Bug fixes
Expand Down
7 changes: 5 additions & 2 deletions R/autoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ autoplot.design <- function(object, rotation = 0, size = 4, margin = FALSE, pale
object <- object$design
}
rlang::check_dots_used()
ntrt <- nlevels(as.factor(object$treatments))
ntrt <- nlevels(as.factor(as.character(object$treatments)))

# create the colours for the graph
if(palette == "default") {
Expand Down Expand Up @@ -128,8 +128,11 @@ autoplot.design <- function(object, rotation = 0, size = 4, margin = FALSE, pale
else {
stop("Invalid value for palette.")
}

# object$treatments <- as.factor(as.character(object$treatments))

hcl <- farver::decode_colour(colour_palette, "rgb", "hcl")
cols <- data.frame(treatments = levels(as.factor(object$treatments)),
cols <- data.frame(treatments = levels(object$treatments),
text_col = ifelse(hcl[, "l"] > 50, "black", "white"))
object <- merge(object, cols)

Expand Down
4 changes: 2 additions & 2 deletions R/create_buffers.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Title
#' Create buffers for design plots
#'
#' @param design The data frame of the design.
#' @param type The type of buffer. One of edge, row, column, double row, double column, or block (coming soon).
Expand Down Expand Up @@ -30,7 +30,7 @@ create_buffers <- function(design, type, blocks = FALSE) {
min_row <- min(design$row)
min_col <- min(design$col)

row <- rep(seq(min_row, (2*nrow)+1, by = 2), each = ncol)
row <- rep(seq(min_row-1, (2*nrow)+1, by = 2), each = ncol)
col <- rep(seq(1, ncol),times = nrow+1)
n_brow <- length(row) # Number of buffer rows
treatments <- rep("buffer", n_brow)
Expand Down
1 change: 0 additions & 1 deletion man/biometryassist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/create_buffers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions tests/testthat/_snaps/all-w2.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
---

Genotype predicted.value std.error groups ci low up
1 G04 4.15 0.14 a 0.23 3.92 4.37
1 G04 4.14 0.14 a 0.23 3.92 4.37
2 G14 4.63 0.14 ab 0.23 4.41 4.86
3 G20 4.80 0.14 bc 0.23 4.57 5.02
4 G10 4.81 0.14 bcd 0.23 4.59 5.04
5 G28 4.84 0.14 bcde 0.23 4.61 5.07
6 G24 4.86 0.14 bcdef 0.23 4.63 5.08
6 G24 4.85 0.14 bcdef 0.23 4.63 5.08
7 G01 4.91 0.14 bcdefg 0.23 4.68 5.14
8 G05 4.94 0.14 bcdefgh 0.23 4.72 5.17
9 G49 4.95 0.14 bcdefgh 0.23 4.72 5.17
Expand All @@ -141,13 +141,13 @@
20 G06 5.13 0.14 bcdefghi 0.23 4.90 5.35
21 G55 5.14 0.14 bcdefghi 0.23 4.92 5.37
22 G32 5.16 0.14 bcdefghij 0.23 4.93 5.38
23 G11 5.17 0.14 bcdefghij 0.23 4.94 5.39
23 G11 5.16 0.14 bcdefghij 0.23 4.94 5.39
24 G39 5.18 0.14 bcdefghij 0.23 4.95 5.40
25 G61 5.20 0.14 bcdefghij 0.23 4.97 5.42
26 G53 5.21 0.14 bcdefghij 0.23 4.98 5.43
27 G37 5.21 0.14 bcdefghij 0.23 4.99 5.44
28 G26 5.21 0.14 bcdefghij 0.23 4.99 5.44
29 G43 5.22 0.14 bcdefghij 0.23 4.99 5.44
29 G43 5.21 0.14 bcdefghij 0.23 4.99 5.44
30 G35 5.22 0.14 bcdefghij 0.23 4.99 5.44
31 G66 5.22 0.14 bcdefghij 0.23 4.99 5.44
32 G16 5.23 0.14 cdefghij 0.23 5.00 5.45
Expand All @@ -157,24 +157,24 @@
36 G47 5.27 0.14 cdefghij 0.23 5.05 5.50
37 G44 5.29 0.14 cdefghij 0.23 5.06 5.52
38 G23 5.29 0.14 cdefghij 0.23 5.07 5.52
39 G56 5.30 0.14 cdefghij 0.23 5.07 5.52
39 G56 5.29 0.14 cdefghij 0.23 5.07 5.52
40 G58 5.31 0.14 cdefghij 0.23 5.08 5.53
41 G57 5.32 0.14 cdefghij 0.23 5.09 5.54
41 G57 5.31 0.14 cdefghij 0.23 5.09 5.54
42 G63 5.32 0.14 cdefghij 0.23 5.09 5.54
43 G62 5.32 0.14 cdefghij 0.23 5.09 5.55
44 G54 5.33 0.14 cdefghij 0.23 5.11 5.56
45 G51 5.36 0.14 cdefghij 0.23 5.13 5.58
46 G67 5.37 0.14 cdefghij 0.23 5.14 5.59
47 G59 5.37 0.14 cdefghij 0.23 5.14 5.60
47 G22 5.37 0.14 cdefghij 0.23 5.14 5.60
48 G42 5.37 0.14 cdefghij 0.23 5.14 5.60
49 G22 5.37 0.14 cdefghij 0.23 5.14 5.60
49 G59 5.37 0.14 cdefghij 0.23 5.14 5.60
50 G65 5.38 0.14 cdefghij 0.23 5.15 5.60
51 G69 5.38 0.14 cdefghij 0.23 5.16 5.61
52 G38 5.38 0.14 cdefghij 0.23 5.16 5.61
53 G12 5.39 0.14 defghij 0.23 5.17 5.62
54 G31 5.41 0.14 efghij 0.23 5.19 5.64
55 G50 5.42 0.14 efghij 0.23 5.20 5.65
56 G17 5.43 0.14 efghij 0.23 5.20 5.65
56 G17 5.42 0.14 efghij 0.23 5.20 5.65
57 G52 5.43 0.14 efghij 0.23 5.20 5.65
58 G64 5.44 0.14 fghij 0.23 5.21 5.67
59 G13 5.45 0.14 ghij 0.23 5.22 5.67
Expand All @@ -183,12 +183,12 @@
62 G60 5.48 0.14 ghij 0.23 5.25 5.71
63 G27 5.49 0.14 ghijk 0.23 5.26 5.72
64 G18 5.50 0.14 ghijk 0.23 5.27 5.72
65 G36 5.51 0.14 hijk 0.23 5.28 5.73
65 G36 5.50 0.14 hijk 0.23 5.28 5.73
66 G48 5.51 0.14 hijk 0.23 5.29 5.74
67 G40 5.53 0.14 hijk 0.23 5.30 5.75
68 G33 5.61 0.14 ijk 0.23 5.38 5.83
69 G19 5.73 0.14 jk 0.23 5.51 5.96
70 G03 6.08 0.14 k 0.23 5.85 6.30
70 G03 6.07 0.14 k 0.23 5.85 6.30

---

Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/_snaps/all-w2/example5lmmautoplot1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 0 additions & 156 deletions vario for dsum - seeing how it could work.r

This file was deleted.

0 comments on commit 1acb8f6

Please sign in to comment.