Skip to content

Commit

Permalink
add gorski.oats.uniformity, kotowski.potato.uniformity
Browse files Browse the repository at this point in the history
  • Loading branch information
kwstat committed Dec 11, 2024
1 parent d5b1e34 commit 75d2c5c
Show file tree
Hide file tree
Showing 10 changed files with 910 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## New datasets

* beckett.maize.uniformity
* gorski.oats.uniformity
* kotowski.potato.uniformity
* lehmann.rice.uniformity

# agridat 1.24 (2024-10-25)
Expand Down
38 changes: 38 additions & 0 deletions data-raw/gorski.oats.uniformity.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

libs(desplot,dplyr,kw,lattice,magrittr,readxl,readr,reshape2,tibble)

# ----------------------------------------------------------------------------

# multiple matrices

dat1 <- read_excel("data-raw/gorski.oats.uniformity.xlsx","one", col_names=FALSE) / 100
dat2 <- read_excel("data-raw/gorski.oats.uniformity.xlsx","two", col_names=FALSE) / 100
colnames(dat1) <- colnames(dat2) <- NULL

# typed as columns, so we need to transpose
dat1 <- t(dat1) %>% as.matrix()
dat2 <- t(dat2) %>% as.matrix()

dat1 %<>% melt %>% rename(row=Var1,col=Var2,yield=value) %>% mutate(field="F1")
dat2 %<>% melt %>% rename(row=Var1,col=Var2,yield=value) %>% mutate(field="F2")


dat <- dplyr::bind_rows(dat1, dat2)
head(dat)

gorski.oats.uniformity <- dat
kw::agex(gorski.oats.uniformity)

## ---------------------------------------------------------------------------

desplot(dat, yield~col*row, subset=field=="F1",
flip=TRUE, tick=TRUE, aspect=(20)/(10),
main="gorski.oats.uniformity - field F1")
desplot(dat, yield~col*row, subset=field=="F2",
flip=TRUE, tick=TRUE, aspect=(20)/(15),
main="gorski.oats.uniformity - field F2")


## ---------------------------------------------------------------------------


Binary file added data-raw/gorski.oats.uniformity.xlsx
Binary file not shown.
47 changes: 47 additions & 0 deletions data-raw/kotowski.potato.uniformity.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# kotowski.potato.uniformity.R

libs(desplot,dplyr,kw,lattice,magrittr,readxl,readr,reshape2,tibble)

dat1 <- read_excel("data-raw/kotowski.potato.uniformity.xlsx","field1yield", col_names=FALSE) / 10
dat2 <- read_excel("data-raw/kotowski.potato.uniformity.xlsx","field1starch", col_names=FALSE) / 10
dat3 <- read_excel("data-raw/kotowski.potato.uniformity.xlsx","field2yield", col_names=FALSE) / 10
dat4 <- read_excel("data-raw/kotowski.potato.uniformity.xlsx","field2starch", col_names=FALSE) / 10

# multiple matrices

dat1 %<>% as.matrix %>% `colnames<-`(1:ncol(dat1)) %>% melt %>% rename(row=Var1,col=Var2,yield=value) %>% mutate(field="F1")
dat3 %<>% as.matrix %>% `colnames<-`(1:ncol(dat3)) %>% melt %>% rename(row=Var1,col=Var2,yield=value) %>% mutate(field="F2")

dat2 %<>% as.matrix %>% `colnames<-`(1:ncol(dat2)) %>% melt %>% rename(row=Var1,col=Var2,starch=value) %>% mutate(field="F1")
dat4 %<>% as.matrix %>% `colnames<-`(1:ncol(dat4)) %>% melt %>% rename(row=Var1,col=Var2,starch=value) %>% mutate(field="F2")


dat13 <- dplyr::bind_rows(dat1, dat3)
dat24 <- dplyr::bind_rows(dat2, dat4)

dat <- select(dat13, field, row, col, yield)
dat <- cbind(dat, select(dat24, starch))

## ---------------------------------------------------------------------------

kotowski.potato.uniformity <- dat
kw::agex(kotowski.potato.uniformity)

libs(desplot)
desplot(dat, yield~col*row|field, subset=field=="F1",
tick=TRUE, flip=TRUE,
aspect=(4*10)/(12*2.5),
main="kotowski.potato.uniformity - yield, field F1")
desplot(dat, yield~col*row|field, subset=field=="F2",
tick=TRUE, flip=TRUE,
aspect=(4*10)/(26*2.5),
main="kotowski.potato.uniformity - yield, field F2")
desplot(dat, starch~col*row|field, subset=field=="F1",
tick=TRUE, flip=TRUE,
aspect=(4*10)/(12*2.5),
main="kotowski.potato.uniformity - starch, field F1")
desplot(dat, starch~col*row|field, subset=field=="F2",
tick=TRUE, flip=TRUE,
aspect=(4*10)/(26*2.5),
main="kotowski.potato.uniformity - starch, field F2")

Binary file added data-raw/kotowski.potato.uniformity.xlsx
Binary file not shown.
Loading

0 comments on commit 75d2c5c

Please sign in to comment.