Skip to content

Commit

Permalink
Update grid summary => new headers and round numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Chiapello committed May 31, 2017
1 parent 620b7d1 commit f1f82eb
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 59 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: Ramf
Type: Package
Title: Arbuscular Mycorrhizal colonization calculation
Version: 0.4
Authors@R: person("Marco", "Chiapello", email = "mc983.cam@gmail.com", role = c("aut", "cre"))
Version: 0.5
Author: Marco Chiapello
Maintainer: Marco Chiapello <mc983@cam.ac.uk>
Description: The package reads data from trouvelot quantification files or grid
system quantification files, compute the colonization rate according to the
Expand Down
10 changes: 5 additions & 5 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ grid_summary <- function(x){
# Create summary table
y <- x %>%
group_by(samples, replicates) %>%
summarise(Total = mean(Total, na.rm = TRUE),
Hyphopodia = mean(Hyphopodia, na.rm = TRUE),
IntrHyphae = mean(IntrHyphae, na.rm = TRUE),
Arbuscule = mean(Arbuscule, na.rm = TRUE),
Vesicles = mean(Vesicles, na.rm = TRUE)) %>%
summarise(Total = round(mean(Total, na.rm = TRUE), 2),
Hyphopodia = round(mean(Hyphopodia, na.rm = TRUE), 2),
IntrHyphae = round(mean(IntrHyphae, na.rm = TRUE), 2),
Arbuscule = round(mean(Arbuscule, na.rm = TRUE), 2),
Vesicles = round(mean(Vesicles, na.rm = TRUE),2)) %>%
ungroup
y <- y %>% arrange(factor(samples, levels = unique(x$samples)), replicates)
return(y)
Expand Down
20 changes: 10 additions & 10 deletions R/methods-grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ am_summary.grid <- function(x){
final <- tmp %>%
mutate(num = n()) %>%
group_by(samples) %>%
summarise(mean_Total = mean(Total, na.rm = TRUE),
se_Total = sd(Total, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)),
mean_Hyphopodia = mean(Hyphopodia, na.rm = TRUE),
se_Hyphopodia = sd(Hyphopodia, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)),
mean_IntrHyphae = mean(IntrHyphae, na.rm = TRUE),
se_IntrHyphae = sd(IntrHyphae, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)),
mean_Arbuscule = mean(Arbuscule, na.rm = TRUE),
se_Arbuscule = sd(Arbuscule, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)),
mean_Vesicles = mean(Vesicles, na.rm = TRUE),
se_Vesicles = sd(Vesicles, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE))
summarise(`Mean Total` = round(mean(Total, na.rm = TRUE), 2),
`Standard error Total` = round(sd(Total, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)), 2),
`Mean Hyphopodia` = round(mean(Hyphopodia, na.rm = TRUE), 2),
`Standard error Hyphopodia` = round(sd(Hyphopodia, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)), 2),
`Mean IntrHyphae` = round(mean(IntrHyphae, na.rm = TRUE), 2),
`Standard error IntrHyphae` = round(sd(IntrHyphae, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)), 2),
`Mean Arbuscule` = round(mean(Arbuscule, na.rm = TRUE), 2),
`Standard error Arbuscule` = round(sd(Arbuscule, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)), 2),
`Mean Vesicles` = round(mean(Vesicles, na.rm = TRUE), 2),
`Standard error Vesicles` = round(sd(Vesicles, na.rm = TRUE) / sqrt(mean(num, na.rm = TRUE)), 2)
)
final <- final[match(unique(x$samples), final$samples), ]
l <- list(tmp, final)
Expand Down
87 changes: 45 additions & 42 deletions inst/doc/Ramf.html

Large diffs are not rendered by default.

0 comments on commit f1f82eb

Please sign in to comment.