Skip to content

Instantly share code, notes, and snippets.

@dlebauer
Created March 4, 2023 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlebauer/948e94d3d25a47f2641cc30fa2917bf8 to your computer and use it in GitHub Desktop.
Save dlebauer/948e94d3d25a47f2641cc30fa2917bf8 to your computer and use it in GitHub Desktop.
library(tidyverse)
# x <- read_csv('C:/Users/David/Downloads/Untitled spreadsheet - Sheet1.csv')
#
# colnames(x)
# dim(x)
#
# xx <- x %>%
# rename(organ = `Plant tissue`,
# soil = `Soil \n Concentration`,
# bcf = BCF) %>%
# select(bcf, organ, soil)
xx <- structure(list(bcf = c(1.298, 0.722, 0.692, 2.48, 3.02, 3.62,
0.646, 2.46, 0.586, 1.018, 0.332, 3.24, 1.12, 0.655, 0.656, 0.879,
3.08, 2.59, 4.1, 3.36, 0.554, 0.0621, 0.157, 0.0803, 0.805, 0.925,
0.64, 0.635, 2.125, 1.825, 2.04, 1.43, 0.59, 0.1465, 2.67, 0.645,
0.584, 0.432, 0.488, 0.592, 1.83, 1.166, 1.078, 0.618, 2.974,
0.906, 2.888, 2.284),
organ = c("Root", "Root", "Root", "Root",
"Stem", "Stem", "Stem", "Stem", "Leaf", "Leaf", "Leaf", "Leaf",
"Root", "Root", "Root", "Root", "Stem", "Stem", "Stem", "Stem",
"Leaf", "Leaf", "Leaf", "Leaf", "Root", "Root", "Root", "Root",
"Stem", "Stem", "Stem", "Stem", "Leaf", "Leaf", "Leaf", "Leaf",
"Root", "Root", "Root", "Root", "Stem", "Stem", "Stem", "Stem",
"Leaf", "Leaf", "Leaf", "Leaf"),
soil = c(50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 500, 500, 500, 500, 500, 500, 500, 500, 500,
500, 500, 500)), row.names = c(NA, -48L), class = c("tbl_df",
"tbl", "data.frame"))
a <- aov(bcf ~ organ + soil, data = xx)
summary(a)
TukeyHSD(a)
plot(TukeyHSD(a))
xx %>%
group_by(organ) %>%
summarise(n = n(), mean = round(mean(bcf),3), sd = round(sd(bcf), 3)) %>%
knitr::kable()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment