library(tidyverse) ##Loading packages
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.3     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
library(rstatix) 
## 
## Attaching package: 'rstatix'
## 
## The following object is masked from 'package:stats':
## 
##     filter
##Upload data
NonMyc <- read.csv("C:/Users/prana/OneDrive/Desktop/15N paper/Blue.csv")
NonMyc
##      Sampling Bacteria Atom.Excess.Air
## 1  Sampling 1     nifD            70.3
## 2  Sampling 1     nifD            66.4
## 3  Sampling 1     nifD            52.5
## 4  Sampling 1     nifD            50.5
## 5  Sampling 1     nifD            47.5
## 6  Sampling 1     nifD            69.1
## 7  Sampling 1     nifD            60.9
## 8  Sampling 1     nifD            68.4
## 9  Sampling 1     nifD            56.8
## 10 Sampling 1     nifD            56.5
## 11 Sampling 1  nifL:km            59.7
## 12 Sampling 1  nifL:km            54.9
## 13 Sampling 1  nifL:km            48.6
## 14 Sampling 1  nifL:km            67.4
## 15 Sampling 1  nifL:km            48.4
## 16 Sampling 1  nifL:km            55.5
## 17 Sampling 1  nifL:km            52.1
## 18 Sampling 1  nifL:km            78.1
## 19 Sampling 1  nifL:km            48.3
## 20 Sampling 1  nifL:km            65.8
## 21 Sampling 2     nifD            42.9
## 22 Sampling 2     nifD            51.6
## 23 Sampling 2     nifD            44.1
## 24 Sampling 2     nifD            49.8
## 25 Sampling 2     nifD            63.1
## 26 Sampling 2     nifD            58.6
## 27 Sampling 2     nifD            61.9
## 28 Sampling 2     nifD            47.8
## 29 Sampling 2     nifD            45.8
## 30 Sampling 2     nifD            59.1
## 31 Sampling 2  nifL:km            46.6
## 32 Sampling 2  nifL:km            60.7
## 33 Sampling 2  nifL:km            65.0
## 34 Sampling 2  nifL:km            51.5
## 35 Sampling 2  nifL:km            40.8
## 36 Sampling 2  nifL:km            60.2
## 37 Sampling 2  nifL:km            50.2
## 38 Sampling 2  nifL:km            45.9
## 39 Sampling 2  nifL:km            61.6
## 40 Sampling 2  nifL:km            51.0
## 41 Sampling 3     nifD            44.3
## 42 Sampling 3     nifD            42.2
## 43 Sampling 3     nifD            51.7
## 44 Sampling 3     nifD            54.5
## 45 Sampling 3     nifD            63.8
## 46 Sampling 3     nifD            56.6
## 47 Sampling 3     nifD            41.3
## 48 Sampling 3     nifD            47.8
## 49 Sampling 3     nifD            46.2
## 50 Sampling 3     nifD            58.7
## 51 Sampling 3  nifL:km            46.1
## 52 Sampling 3  nifL:km            47.3
## 53 Sampling 3  nifL:km            59.8
## 54 Sampling 3  nifL:km            50.9
## 55 Sampling 3  nifL:km            58.9
## 56 Sampling 3  nifL:km            64.5
## 57 Sampling 3  nifL:km            37.9
## 58 Sampling 3  nifL:km            59.0
## 59 Sampling 3  nifL:km            53.3
## 60 Sampling 3  nifL:km            50.8
##plotting
plot <- ggplot(NonMyc, aes(x = Sampling, y = Atom.Excess.Air, fill = as.factor(Bacteria))) +
  geom_boxplot(outlier.shape = NA) +
  geom_point(position = position_dodge(width = 0.8)) +
  theme_minimal() ###Plotting
plot + theme(panel.grid.major = element_line(linetype = "blank"),
    panel.grid.minor = element_line(linetype = "blank"),
    axis.text = element_text(family = "Times",
        size = 12, face = "bold", colour = "gray0"),
    axis.text.x = element_text(family = "Times",
        colour = "gray0"), axis.text.y = element_text(family = "Times",
        colour = "gray0"), plot.title = element_text(family = "Times",
        size = 12, face = "bold")) +labs(title = "Non-mycorrhized", x = NULL,
    y = "Atom%ExcessAir", fill = NULL) + 
  scale_fill_discrete(labels = c("ΔnifD", "ΔnifL:km")) + theme(legend.text = element_text(face = "italic"))+
  annotate("text", x = 1, y = 75, label = "ns") +
  annotate("text", x = 2, y = 75, label = "ns") +
  annotate("text", x = 3, y = 75, label = "ns")##adding p-values manually
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.