How to represent in my PCOA analysis, only microorganisms greater than 0.01 of my total sample?

Hello, I hope you are great. I am having a problem knowing how to represent in my PCOA my microorganisms greater than 0.01 of the total sample (all microorganisms), but on a monthly basis.
The only thing that I achieved and that will be observed in my script, are all the microorganisms that were greater than 0.01 during the whole study. I would first like to obtain those that were greater than 0.01 in the month of July, then in the month of August and finally September, to later gather that information, in my PCOA. Because in a barplot analysis I conducted earlier there are differences in the microorganism communities in the three months, and in the PCOA it only tells me that there is a difference in July and September, because in this analysis I did not establish that I only want to represent the communities greater than 0.01 (in the one of barplots if I established it).


library(tidyverse)
Family <- data.frame (tibble::tribble(
  ~Index, ~Cyanobacteriaceae, ~Microcystaceae, ~Nostocaceae, ~Phormidiaceae, ~Un.Nostocales, ~Nodosilineaceae, ~Cyanobacteriaceae,
    "1A",                  1,               0,            0,              0,              0,                1,                  1,
    "1C",                  1,               0,            0,              2,              0,                1,                  1,
    "1D",                  0,               0,            1,              0,              0,                1,                  0,
    "1E",                  1,               0,            1,              0,              0,                0,                  0,
    "1F",                  1,               0,            0,              0,              0,                0,                 17,
    "1G",                  1,               0,            0,              0,              0,                0,                  2,
    "1H",                  1,             112,            1,            583,              0,                1,                  0,
    "2A",                  0,               0,            1,              0,              0,                1,                  2,
    "2B",                  1,               0,            0,             35,              0,                1,                 29,
    "2C",                  0,               1,            0,              0,              0,                1,                  0,
    "2D",                  3,               0,            0,              0,              0,                0,                  0,
    "2E",                  0,               0,            1,              0,              0,                0,                  0,
    "2F",                  0,               3,            0,              1,              0,                0,                  1,
    "2H",                  0,               0,            9,             18,              0,                0,                 17,
    "3A",                  0,               0,           44,             88,              0,                0,                  0,
    "3B",                  0,               0,          572,             60,              0,               38,                  0,
    "4A",                  0,               0,            0,              0,              0,                0,                 27,
    "4B",                  0,               0,            0,              0,              0,                0,                 12,
    "4E",                  0,               0,            0,              0,              0,                0,                  8,
    "4G",                  0,               0,            0,              0,              0,                0,                  8,
    "4H",                  0,               3,           16,             28,              0,                0,                 14,
    "5E",                  0,               0,            0,             17,              0,                0,                  0,
    "5F",                  0,               2,            0,              2,              0,                0,                 10,
    "5G",                  0,               2,            0,             28,              0,                0,                  0,
    "6A",                  0,               0,           37,              0,              0,                0,                  0,
    "6F",                  0,               0,            0,              0,              0,                0,                  4,
    "6H",                  0,              55,            0,            123,              0,                0,                 33,
    "7D",                  0,               0,            0,            128,              0,                0,                  2,
    "7F",                  0,               2,            0,            269,              0,                0,                  3,
    "7G",                  0,               0,            0,              0,              0,                0,                  5,
    "8A",                  0,               0,            0,              0,              0,                0,                 16,
    "8B",                  0,               0,            0,              0,              0,                0,                  3,
    "8C",                  0,               0,            0,             29,              0,                0,                  0,
    "8D",                  0,               3,            0,              0,              0,                0,                  0,
    "8E",                  0,               0,            0,            102,              0,               16,                  2,
    "8G",                  0,              93,           45,            439,              0,                0,                 34,
    "8H",                  0,              35,            0,             24,              0,                0,                 17,
    "9A",                  0,               0,            1,              0,              0,                1,                  0,
    "9B",                  0,               0,            1,              0,              0,                1,                  0,
    "9D",                  0,               0,            1,              0,              0,                0,                  0,
    "9E",                  0,               0,            0,            125,              0,                0,                  0,
    "9F",                  0,               2,            8,              0,              0,                0,                 31,
    "9G",                  0,               0,            0,              0,              0,                0,                 20,
    "9H",                  0,             340,         3670,           2668,             33,               38,                  0,
   "10A",                  0,               0,            1,              0,              0,                0,                 32,
   "10B",                  0,               0,            0,              1,              0,                0,                 14,
   "10D",                  0,               0,            0,             47,              0,                0,                  0,
   "10E",                  0,               1,            0,              0,              0,                0,                  0,
   "10F",                  0,               0,            0,              0,              0,                0,                  4,
   "10G",                  0,               1,            0,             40,              0,                0,                  0,
   "10H",                  0,               1,            0,              0,              1,                0,                  0,
   "11A",                  0,               0,            1,              0,              0,                1,                  0,
   "11B",                  0,               0,            1,              0,              1,                0,                  0,
   "11C",                  0,               0,            1,              0,              0,                0,                  0,
   "11D",                  0,               0,            1,              0,              0,                0,                  0,
   "11E",                  0,               0,            1,              0,              0,                0,                  0,
   "11F",                  0,               0,            0,              1,              0,                0,                  0,
   "11G",                  0,               0,            0,              1,              0,                0,                  0,
   "11H",                  0,               0,            0,              1,              0,                0,                  0,
   "12D",                  0,              20,           77,            145,              0,                0,                 22,
   "12F",                  0,               0,            0,              0,              0,                0,                  2,
   "12G",                  0,              68,            2,            296,              0,                0,                  0,
   "12H",                  0,             148,          280,            216,              0,                0,                 28
  )
)


t(Family)
#>                     [,1]   [,2]   [,3]   [,4]   [,5]   [,6]   [,7]  
#> Index               "1A"   "1C"   "1D"   "1E"   "1F"   "1G"   "1H"  
#> Cyanobacteriaceae   "1"    "1"    "0"    "1"    "1"    "1"    "1"   
#> Microcystaceae      "  0"  "  0"  "  0"  "  0"  "  0"  "  0"  "112" 
#> Nostocaceae         "   0" "   0" "   1" "   1" "   0" "   0" "   1"
#> Phormidiaceae       "   0" "   2" "   0" "   0" "   0" "   0" " 583"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 1"   " 1"   " 1"   " 0"   " 0"   " 0"   " 1"  
#> Cyanobacteriaceae.1 " 1"   " 1"   " 0"   " 0"   "17"   " 2"   " 0"  
#>                     [,8]   [,9]   [,10]  [,11]  [,12]  [,13]  [,14] 
#> Index               "2A"   "2B"   "2C"   "2D"   "2E"   "2F"   "2H"  
#> Cyanobacteriaceae   "0"    "1"    "0"    "3"    "0"    "0"    "0"   
#> Microcystaceae      "  0"  "  0"  "  1"  "  0"  "  0"  "  3"  "  0" 
#> Nostocaceae         "   1" "   0" "   0" "   0" "   1" "   0" "   9"
#> Phormidiaceae       "   0" "  35" "   0" "   0" "   0" "   1" "  18"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 1"   " 1"   " 1"   " 0"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 " 2"   "29"   " 0"   " 0"   " 0"   " 1"   "17"  
#>                     [,15]  [,16]  [,17]  [,18]  [,19]  [,20]  [,21] 
#> Index               "3A"   "3B"   "4A"   "4B"   "4E"   "4G"   "4H"  
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      "  0"  "  0"  "  0"  "  0"  "  0"  "  0"  "  3" 
#> Nostocaceae         "  44" " 572" "   0" "   0" "   0" "   0" "  16"
#> Phormidiaceae       "  88" "  60" "   0" "   0" "   0" "   0" "  28"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   "38"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 " 0"   " 0"   "27"   "12"   " 8"   " 8"   "14"  
#>                     [,22]  [,23]  [,24]  [,25]  [,26]  [,27]  [,28] 
#> Index               "5E"   "5F"   "5G"   "6A"   "6F"   "6H"   "7D"  
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      "  0"  "  2"  "  2"  "  0"  "  0"  " 55"  "  0" 
#> Nostocaceae         "   0" "   0" "   0" "  37" "   0" "   0" "   0"
#> Phormidiaceae       "  17" "   2" "  28" "   0" "   0" " 123" " 128"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 " 0"   "10"   " 0"   " 0"   " 4"   "33"   " 2"  
#>                     [,29]  [,30]  [,31]  [,32]  [,33]  [,34]  [,35] 
#> Index               "7F"   "7G"   "8A"   "8B"   "8C"   "8D"   "8E"  
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      "  2"  "  0"  "  0"  "  0"  "  0"  "  3"  "  0" 
#> Nostocaceae         "   0" "   0" "   0" "   0" "   0" "   0" "   0"
#> Phormidiaceae       " 269" "   0" "   0" "   0" "  29" "   0" " 102"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   "16"  
#> Cyanobacteriaceae.1 " 3"   " 5"   "16"   " 3"   " 0"   " 0"   " 2"  
#>                     [,36]  [,37]  [,38]  [,39]  [,40]  [,41]  [,42] 
#> Index               "8G"   "8H"   "9A"   "9B"   "9D"   "9E"   "9F"  
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      " 93"  " 35"  "  0"  "  0"  "  0"  "  0"  "  2" 
#> Nostocaceae         "  45" "   0" "   1" "   1" "   1" "   0" "   8"
#> Phormidiaceae       " 439" "  24" "   0" "   0" "   0" " 125" "   0"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   " 0"   " 1"   " 1"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 "34"   "17"   " 0"   " 0"   " 0"   " 0"   "31"  
#>                     [,43]  [,44]  [,45]  [,46]  [,47]  [,48]  [,49] 
#> Index               "9G"   "9H"   "10A"  "10B"  "10D"  "10E"  "10F" 
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      "  0"  "340"  "  0"  "  0"  "  0"  "  1"  "  0" 
#> Nostocaceae         "   0" "3670" "   1" "   0" "   0" "   0" "   0"
#> Phormidiaceae       "   0" "2668" "   0" "   1" "  47" "   0" "   0"
#> Un.Nostocales       " 0"   "33"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   "38"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 "20"   " 0"   "32"   "14"   " 0"   " 0"   " 4"  
#>                     [,50]  [,51]  [,52]  [,53]  [,54]  [,55]  [,56] 
#> Index               "10G"  "10H"  "11A"  "11B"  "11C"  "11D"  "11E" 
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      "  1"  "  1"  "  0"  "  0"  "  0"  "  0"  "  0" 
#> Nostocaceae         "   0" "   0" "   1" "   1" "   1" "   1" "   1"
#> Phormidiaceae       "  40" "   0" "   0" "   0" "   0" "   0" "   0"
#> Un.Nostocales       " 0"   " 1"   " 0"   " 1"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   " 0"   " 1"   " 0"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#>                     [,57]  [,58]  [,59]  [,60]  [,61]  [,62]  [,63] 
#> Index               "11F"  "11G"  "11H"  "12D"  "12F"  "12G"  "12H" 
#> Cyanobacteriaceae   "0"    "0"    "0"    "0"    "0"    "0"    "0"   
#> Microcystaceae      "  0"  "  0"  "  0"  " 20"  "  0"  " 68"  "148" 
#> Nostocaceae         "   0" "   0" "   0" "  77" "   0" "   2" " 280"
#> Phormidiaceae       "   1" "   1" "   1" " 145" "   0" " 296" " 216"
#> Un.Nostocales       " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Nodosilineaceae     " 0"   " 0"   " 0"   " 0"   " 0"   " 0"   " 0"  
#> Cyanobacteriaceae.1 " 0"   " 0"   " 0"   "22"   " 2"   " 0"   "28"
#NORMALIZATION OF RAW READ TABLE LOG2
#OTUS en filas, columnas son las muestras, es al reves que para el resto de pasos
data<- Family

replicates <- as.data.frame(colnames(data)[-1])
colnames(replicates) <- "replicates"
attach(Family)
rwnames <- Index
data <- as.matrix(data[,-1])
rownames(data) <- rwnames
data[is.na(data)] <- 0
library(DESeq2)
#> Loading required package: S4Vectors
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> Loading required package: parallel
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:parallel':
#> 
#>     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
#>     clusterExport, clusterMap, parApply, parCapply, parLapply,
#>     parLapplyLB, parRapply, parSapply, parSapplyLB
#> The following objects are masked from 'package:dplyr':
#> 
#>     combine, intersect, setdiff, union
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     anyDuplicated, append, as.data.frame, basename, cbind,
#>     colMeans, colnames, colSums, dirname, do.call, duplicated,
#>     eval, evalq, Filter, Find, get, grep, grepl, intersect,
#>     is.unsorted, lapply, lengths, Map, mapply, match, mget, order,
#>     paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
#>     Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort,
#>     table, tapply, union, unique, unsplit, which, which.max,
#>     which.min
#> 
#> Attaching package: 'S4Vectors'
#> The following objects are masked from 'package:dplyr':
#> 
#>     first, rename
#> The following object is masked from 'package:tidyr':
#> 
#>     expand
#> The following object is masked from 'package:base':
#> 
#>     expand.grid
#> Loading required package: IRanges
#> 
#> Attaching package: 'IRanges'
#> The following objects are masked from 'package:dplyr':
#> 
#>     collapse, desc, slice
#> The following object is masked from 'package:purrr':
#> 
#>     reduce
#> The following object is masked from 'package:grDevices':
#> 
#>     windows
#> Loading required package: GenomicRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: SummarizedExperiment
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> Loading required package: DelayedArray
#> Loading required package: matrixStats
#> 
#> Attaching package: 'matrixStats'
#> The following objects are masked from 'package:Biobase':
#> 
#>     anyMissing, rowMedians
#> The following object is masked from 'package:dplyr':
#> 
#>     count
#> Loading required package: BiocParallel
#> 
#> Attaching package: 'DelayedArray'
#> The following objects are masked from 'package:matrixStats':
#> 
#>     colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges
#> The following object is masked from 'package:purrr':
#> 
#>     simplify
#> The following objects are masked from 'package:base':
#> 
#>     aperm, apply
dds <- DESeqDataSetFromMatrix(data, replicates, ~ replicates)
#> converting counts to integer mode
cts <- counts(dds)
geoMeans <- apply(cts, 1, function(row) if (all(row == 0)) 0 else exp(mean(log(row[row != 0]))))
dds <- estimateSizeFactors(dds, geoMeans=geoMeans)
norm <- counts(dds, normalized=TRUE)
logcounts <- log2( counts(dds, normalized=TRUE) + 1 )# in case you want a log transformed normalized count
write.csv(logcounts, file = "~/RSTUDIO/Datos_cianobacterias/ciano_rdp_normalizados_pruebaa.csv")
#log counts are like variance stabilized counts (https://support.bioconductor.org/p/76712/)
library(readxl) 
Family <- read_excel("~/RSTUDIO/Datos_cianobacterias/ciano_rdp_normalizados_pruebaa.xlsx")
attach(Family)
#> The following objects are masked from Family (pos = 17):
#> 
#>     Cyanobacteriaceae, Cyanobacteriaceae.1, Microcystaceae,
#>     Nodosilineaceae, Nostocaceae, Phormidiaceae, Un.Nostocales
Family <- Family[,-1]
rownames(Family) <- SampleID
#> Warning: Setting row names on a tibble is deprecated.

#remove the rare microbes. It keeps only the microbes that are present in at least 10% of the samples
dim(Family)
#> [1] 64  7

Family <- Family[,colMeans(Family) >=.1]

dim(Family)
#> [1] 64  7

#Family
Family <- data.frame(Family)
Family_counts <- colSums(Family)
Counts <- unname(Family_counts)
Family_counts <- data.frame(Family_counts)
Family_counts <- t(Family_counts)
total <- sum(Counts)
rel_ab <- Family_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.01]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.01]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Datos_cianobacterias/ciano_rdp_family.csv")
Famiy <- read.csv("~/RSTUDIO/Datos_cianobacterias/ciano_rdp_family.csv")

#(Transposing)
library(readxl) 
Family <- read_excel("~/RSTUDIO/Datos_cianobacterias/ciano_rdp_normalizados_transpuesto.xlsx")


Metadata <-data.frame (tibble::tribble(
                          ~SampleID, ~SamplingPoint,         ~Depth,      ~Month,    ~Filter, ~SampleorReplica,
                               "1A",         "CEA1",        "80 cm",      "July", "20-25 µm",         "Sample",
                               "1C",         "CEA4", "Interstitial",      "July", "20-25 µm",         "Sample",
                               "1D",         "CEA1",        "80 cm",    "August", "20-25 µm",         "Sample",
                               "1E",         "CEA3",        "80 cm",    "August", "20-25 µm",         "Sample",
                               "1F",         "CEA5",        "80 cm",    "August", "20-25 µm",         "Sample",
                               "1G",         "CEA2",        "80 cm", "September", "20-25 µm",         "Sample",
                               "1H",         "CEA4",        "80 cm", "September", "20-25 µm",         "Sample",
                               "2A",         "CEA1",        "80 cm",      "July",  "0.45 µm",         "Sample",
                               "2B",         "CEA2", "Interstitial",      "July", "20-25 µm",         "Sample",
                               "2C",         "CEA4", "Interstitial",      "July",  "0.45 µm",         "Sample",
                               "2D",         "CEA1",        "80 cm",    "August",  "0.45 µm",         "Sample",
                               "2E",         "CEA3",        "80 cm",    "August",  "0.45 µm",         "Sample",
                               "2F",         "CEA5",        "80 cm",    "August",  "0.45 µm",         "Sample",
                               "2H",         "CEA4",        "80 cm", "September",  "0.45 µm",         "Sample",
                               "3A",         "CEA1", "Interstitial",      "July", "20-25 µm",         "Sample",
                               "3B",         "CEA2", "Interstitial",      "July",  "0.45 µm",         "Sample",
                               "4A",         "CEA1", "Interstitial",      "July",  "0.45 µm",         "Sample",
                               "4B",         "CEA3",        "80 cm",      "July", "20-25 µm",         "Sample",
                               "4E",         "CEA3", "Interstitial",    "August",  "0.45 µm",         "Sample",
                               "4G",         "CEA2", "Interstitial", "September",  "0.45 µm",         "Sample",
                               "4H",         "CEA4", "Interstitial", "September",  "0.45 µm",         "Sample",
                               "5E",         "CEA3",        "80 cm",    "August",  "0.45 µm",        "Replica",
                               "5F",         "CEA5",        "80 cm",    "August",  "0.45 µm",        "Replica",
                               "5G",         "CEA2",        "80 cm", "September",  "0.45 µm",        "Replica",
                               "6A",         "CEA1",        "80 cm",      "July",  "0.45 µm",        "Replica",
                               "6F",         "CEA5", "Interstitial",    "August",  "0.45 µm",        "Replica",
                               "6H",         "CEA4", "Interstitial", "September",  "0.45 µm",        "Replica",
                               "7D",         "CEA2",        "80 cm",    "August", "20-25 µm",         "Sample",
                               "7F",         "CEA1",        "80 cm", "September", "20-25 µm",         "Sample",
                               "7G",         "CEA3",        "80 cm", "September", "20-25 µm",         "Sample",
                               "8A",         "CEA1", "Interstitial",      "July",  "0.45 µm",        "Replica",
                               "8B",         "CEA3",        "80 cm",      "July",  "0.45 µm",        "Replica",
                               "8C",         "CEA5", "Interstitial",      "July", "20-25 µm",         "Sample",
                               "8D",         "CEA2",        "80 cm",    "August",  "0.45 µm",         "Sample",
                               "8E",         "CEA4",        "80 cm",    "August",  "0.45 µm",         "Sample",
                               "8G",         "CEA3",        "80 cm", "September",  "0.45 µm",         "Sample",
                               "8H",         "CEA5",        "80 cm", "September",  "0.45 µm",         "Sample",
                               "9A",         "CEA2",        "80 cm",      "July", "20-25 µm",         "Sample",
                               "9B",         "CEA3", "Interstitial",      "July", "20-25 µm",        "Replica",
                               "9D",         "CEA2", "Interstitial",    "August", "20-25 µm",         "Sample",
                               "9E",         "CEA4", "Interstitial",    "August", "20-25 µm",         "Sample",
                               "9F",         "CEA1", "Interstitial", "September", "20-25 µm",         "Sample",
                               "9G",         "CEA3", "Interstitial", "September", "20-25 µm",         "Sample",
                               "9H",         "CEA5", "Interstitial", "September", "20-25 µm",         "Sample",
                              "10A",         "CEA2",        "80 cm",      "July",  "0.45 µm",        "Replica",
                              "10B",         "CEA3", "Interstitial",      "July",  "0.45 µm",        "Replica",
                              "10D",         "CEA2", "Interstitial",    "August",  "0.45 µm",         "Sample",
                              "10E",         "CEA4", "Interstitial",    "August",  "0.45 µm",         "Sample",
                              "10F",         "CEA1", "Interstitial", "September",  "0.45 µm",         "Sample",
                              "10G",         "CEA3", "Interstitial", "September",  "0.45 µm",         "Sample",
                              "10H",         "CEA5", "Interstitial", "September",  "0.45 µm",         "Sample",
                              "11A",         "CEA2", "Interstitial",      "July", "20-25 µm",        "Replica",
                              "11B",         "CEA4",        "80 cm",      "July", "20-25 µm",         "Sample",
                              "11C",         "CEA5", "Interstitial",      "July", "20-25 µm",        "Replica",
                              "11D",         "CEA2",        "80 cm",    "August",  "0.45 µm",        "Replica",
                              "11E",         "CEA4",        "80 cm",    "August",  "0.45 µm",        "Replica",
                              "11F",         "CEA1",        "80 cm", "September",  "0.45 µm",        "Replica",
                              "11G",         "CEA3",        "80 cm", "September",  "0.45 µm",        "Replica",
                              "11H",         "CEA5",        "80 cm", "September",  "0.45 µm",        "Replica",
                              "12D",         "CEA2", "Interstitial",    "August",  "0.45 µm",        "Replica",
                              "12F",         "CEA1", "Interstitial", "September",  "0.45 µm",        "Replica",
                              "12G",         "CEA3", "Interstitial", "September",  "0.45 µm",        "Replica",
                              "12H",         "CEA5", "Interstitial", "September",  "0.45 µm",        "Replica"
                          )
)

rownames(Metadata) <- SampleID
#> Error in `.rowNamesDF<-`(x, value = value): invalid 'row.names' length

  Metadata$Month <- factor(Metadata$Month,
                         levels = c("July", "August", "September"))

library(vegan)
#PCoA
#create a distance matrix
dis.bray<-vegdist(Family, method="bray")
#> Error in vegdist(Family, method = "bray"): input data must be numeric
Family.cmd <- cmdscale(dis.bray, k=(NROW(Family)-1), eig=TRUE, add= TRUE)
#> Error in cmdscale(dis.bray, k = (NROW(Family) - 1), eig = TRUE, add = TRUE): objeto 'dis.bray' no encontrado

Family.cmd$eig
#> Error in eval(expr, envir, enclos): objeto 'Family.cmd' no encontrado
eig2<-eigenvals(Family.cmd)
#> Error in eigenvals(Family.cmd): objeto 'Family.cmd' no encontrado
eig2
#> Error in eval(expr, envir, enclos): objeto 'eig2' no encontrado
eig2/sum(eig2) #the first two are the axes values of axes 1 and 2 (https://stat.ethz.ch/pipermail/r-sig-ecology/2011-June/002183.html)
#> Error in eval(expr, envir, enclos): objeto 'eig2' no encontrado
#0.16225839 0.11075892
x<-Family.cmd$points[,1]
#> Error in eval(expr, envir, enclos): objeto 'Family.cmd' no encontrado
y<-Family.cmd$points[,2]
#> Error in eval(expr, envir, enclos): objeto 'Family.cmd' no encontrado
plot(x,y, type="n", xlab = "PCoA1 (%)", ylab = "PCoA2 (%)", asp = 1, axes = TRUE)
#> Error in plot(x, y, type = "n", xlab = "PCoA1 (%)", ylab = "PCoA2 (%)", : objeto 'x' no encontrado
text(x,y, rownames(Family.cmd$points), cex =0.7)
#> Error in text(x, y, rownames(Family.cmd$points), cex = 0.7): objeto 'x' no encontrado
Family.pco <- data.frame(x,y)
#> Error in data.frame(x, y): objeto 'x' no encontrado
ordiplot(Family.pco, choices = c(1, 2), display = "sites", type = "none", xlab = "PCoA 1",ylim = c(-0.4,0.4), ylab = "PCoA 2")
#> Error in ordiplot(Family.pco, choices = c(1, 2), display = "sites", type = "none", : objeto 'Family.pco' no encontrado
pl <-ordiellipse(Family.pco, Metadata$Month, kind="se", conf=0.95, lwd=2, col="gray30", label=T) 
#> Error in scores(ord, display = display, ...): objeto 'Family.pco' no encontrado
#with(Metadata, points(Clase.pco$x, Clase.pco$y, display="sites", col=colvec[Crop], pch=21, bg=colvec[Crop]))
#with(Metadata, legend("topright", legend=levels(Crop), bty="n", col=colvec, pch=21, pt.bg=colvec))
#plot with ggplot
data.scores <- as.data.frame(scores(Family.cmd))
#> Error in scores(Family.cmd): objeto 'Family.cmd' no encontrado
data.scores$site <- rownames(data.scores)
#> Error in rownames(data.scores): objeto 'data.scores' no encontrado
data.scores$grp <- Metadata$Month
#> Error in data.scores$grp <- Metadata$Month: objeto 'data.scores' no encontrado
head(data.scores)
#> Error in head(data.scores): objeto 'data.scores' no encontrado
library(ggplot2)
NMDS <-  data.frame(Dim1 = Family.mds$points[,1], Dim2 = Family.mds$points[,2],group=Metadata$Month)
#> Error in data.frame(Dim1 = Family.mds$points[, 1], Dim2 = Family.mds$points[, : objeto 'Family.mds' no encontrado
#NMDS.mean <- aggregate(NMDS[,1:2],list(group=group),mean)
veganCovEllipse<-function (cov, center = c(0, 0), scale = 1, npoints = 100) 
{
  theta <- (0:npoints) * 2 * pi/npoints
  Circle <- cbind(cos(theta), sin(theta))
  t(center + scale * t(Circle %*% chol(cov)))
}
#attach(NMDS.mean)
df_ell <- data.frame()
for(g in levels(NMDS$group)){
  df_ell <- rbind(df_ell, cbind(as.data.frame(with(NMDS[NMDS$group==g,],
                                                   veganCovEllipse(pl[[g]]$cov,pl[[g]]$center,pl[[g]]$scale)))
                                ,group=g))
}
#> Error in levels(NMDS$group): objeto 'NMDS' no encontrado

ggplot() + 
  geom_path(data=df_ell, aes(x=x, y=y,colour=group), size=1, linetype=1)+
  geom_point(data=data.scores,aes(x=Dim1,y=Dim2,colour=grp),size=1.5) + 
  # add the point markers
  theme_light()+
  #geom_text(data=data.scores,aes(x=NMDS1,y=NMDS2,label=site),size=6,vjust=0) + 
  scale_colour_manual(values=c("July" = "deeppink", "August" = "turquoise4", "September"="darkorchid"))+ 
  ylab("Family PCoA2 (22.00%)")+
  xlab("Family PCoA1 (24.10%)")
#> Error in fortify(data): objeto 'data.scores' no encontrado

<sup>Created on 2020-02-22 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>

Could you create a couple of small toy before-and-after tables that show what you're trying to achieve? That might help me understand what you're looking for.

With pleasure, in my analysis of barplot I am obtaining these monthly differences, in the communities of microorganisms.

This is the script

library(readxl)
Family <- read_excel("~/RSTUDIO/Cyano/Genero.xlsx")

data<- Family

attach(Family)
rwnames <- index
data <- as.data.frame(data[,-1])
rownames(data) <- rwnames

Metadata<- read.csv("~/RSTUDIO/Metadata-final.csv", row.names=1)


#SUBSET DE MONTH
Jul <- subset(data, Metadata$Month == "July", select = c(`Un Gastranaerophilales`:`Un Sericytochromatia`))
Aug <- subset(data, Metadata$Month == "August", select = c(`Un Gastranaerophilales`:`Un Sericytochromatia`))
Sep <- subset(data, Metadata$Month == "September", select = c(`Un Gastranaerophilales`:`Un Sericytochromatia`))

Metadata$Month <- factor(Metadata$Month,
                         levels = c("Jul", "Aug", "Sep"))

#July
Jul <- data.frame(Jul)
Jul_counts <- colSums(Jul)
Counts <- unname(Jul_counts)
Jul_counts <- data.frame(Jul_counts)
Jul_counts <- t(Jul_counts)
total <- sum(Counts)
rel_ab <- Jul_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.1]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.1]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Datos_cianobacterias/ciano_rdp_month-jul.csv")
Jul <- read.csv("~/RSTUDIO/Datos_cianobacterias/ciano_rdp_month-jul.csv")

#August
Aug <- data.frame(Aug)
Aug_counts <- colSums(Aug)
Counts <- unname(Aug_counts)
Aug_counts <- data.frame(Aug_counts)
Aug_counts <- t(Aug_counts)
total <- sum(Counts)
rel_ab <- Aug_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.1]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.1]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Datos_cianobacterias/ciano_rdp_month-ago.csv")
Aug <- read.csv("~/RSTUDIO/Datos_cianobacterias/ciano_rdp_month-ago.csv")

#September
Sep <- data.frame(Sep)
Sep_counts <- colSums(Sep)
Counts <- unname(Sep_counts)
Sep_counts <- data.frame(Sep_counts)
Sep_counts <- t(Sep_counts)
total <- sum(Counts)
rel_ab <- Sep_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.1]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.1]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Datos_cianobacterias/ciano_rdp_month-sep.csv")
Sep <- read.csv("~/RSTUDIO/Datos_cianobacterias/ciano_rdp_month-sep.csv")

Family_colors <- c(
  "#b988d5","#cbd588", "#88a5d5",
  "#673770","#D14285", "#652926", "#C84248", 
  "#8569D5", "#5E738F","#D1A33D", "#8A7C64", "#599861"
)


library(ggplot2)
library(scales)
ggplot() +geom_bar(aes(y = rel_ab_P*100, x= "Jul", fill = X), data = Jul,
                   stat="identity", width = .5)+ geom_bar(aes(y = rel_ab_P*100, x= "Aug", fill = X), data = Aug,
                                                          stat="identity",width=.5)+
scale_x_discrete(
    labels = c("Jul", "Aug", "Sep"), 
    drop = FALSE
  ) +
  geom_bar(aes(y = rel_ab_P*100, x= "Sep", fill = X), data = Sep,
           stat="identity", width = .5)+
  theme_classic()+
  theme(legend.title = element_blank())+
  ylab("Relative Abundance >.01% \n")+
  xlab("Month")+
  scale_fill_manual(values = Family_colors)

Created on 2020-02-22 by the reprex package (v0.3.0)

If you look in the script, I first analyze the communities on a monthly basis. I only represent in the graph those microorganisms greater than 0.01. Example:
Total cyanobacterium 600
Total of my microorganisms in the month of July: 987667888

Then it is only multiply and divide: 600 * 100/987 .....
If it is less than 0.01 it does not appear in the graph.

Now in my PCOA analysis, in that I am analyzing all my samples, I do not do a screening (less than 0.01) previously on a monthly basis.
This the result

Only differences are observed in the month of July and September, because I am analyzing everything.

library(readxl)
Family <- read_excel("~/RSTUDIO/Datos_cianobacterias/ciano_otu_family_rdp.xlsx")


#NORMALIZATION OF RAW READ TABLE LOG2
#OTUS en filas, columnas son las muestras, es al reves que para el resto de pasos
data<- Family

replicates <- as.data.frame(colnames(data)[-1])
colnames(replicates) <- "replicates"
attach(Family)
rwnames <- OTU
data <- as.matrix(data[,-1])
rownames(data) <- rwnames
data[is.na(data)] <- 0
library(DESeq2)
#> Loading required package: S4Vectors
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> Loading required package: parallel
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:parallel':
#> 
#>     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
#>     clusterExport, clusterMap, parApply, parCapply, parLapply,
#>     parLapplyLB, parRapply, parSapply, parSapplyLB
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     anyDuplicated, append, as.data.frame, basename, cbind,
#>     colMeans, colnames, colSums, dirname, do.call, duplicated,
#>     eval, evalq, Filter, Find, get, grep, grepl, intersect,
#>     is.unsorted, lapply, lengths, Map, mapply, match, mget, order,
#>     paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
#>     Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort,
#>     table, tapply, union, unique, unsplit, which, which.max,
#>     which.min
#> 
#> Attaching package: 'S4Vectors'
#> The following object is masked from 'package:base':
#> 
#>     expand.grid
#> Loading required package: IRanges
#> 
#> Attaching package: 'IRanges'
#> The following object is masked from 'package:grDevices':
#> 
#>     windows
#> Loading required package: GenomicRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: SummarizedExperiment
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> Loading required package: DelayedArray
#> Loading required package: matrixStats
#> 
#> Attaching package: 'matrixStats'
#> The following objects are masked from 'package:Biobase':
#> 
#>     anyMissing, rowMedians
#> Loading required package: BiocParallel
#> 
#> Attaching package: 'DelayedArray'
#> The following objects are masked from 'package:matrixStats':
#> 
#>     colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges
#> The following objects are masked from 'package:base':
#> 
#>     aperm, apply
dds <- DESeqDataSetFromMatrix(data, replicates, ~ replicates)
#> converting counts to integer mode
cts <- counts(dds)
geoMeans <- apply(cts, 1, function(row) if (all(row == 0)) 0 else exp(mean(log(row[row != 0]))))
dds <- estimateSizeFactors(dds, geoMeans=geoMeans)
norm <- counts(dds, normalized=TRUE)
logcounts <- log2( counts(dds, normalized=TRUE) + 1 )# in case you want a log transformed normalized count
write.csv(logcounts, file = "~/RSTUDIO/Datos_cianobacterias/ciano_rdp_normalizados.csv")
#> Warning in file(file, ifelse(append, "a", "w")): no fue posible
#> abrir el archivo 'C:/Users/Osiris Díaz Torres/Documents/RSTUDIO/
#> Datos_cianobacterias/ciano_rdp_normalizados.csv': Permission denied
#> Error in file(file, ifelse(append, "a", "w")): no se puede abrir la conexión
#log counts are like variance stabilized counts (https://support.bioconductor.org/p/76712/)

#DATA ANALYSIS
#Introduce two tables, one has to have the samples in the first column and the
#species in the first line with the reads per sample.
#The second table is with environmental parameters, it has to have the samples
#in the first column and the environmental parameters in the first line.
#You can have the environmental parameters as presence/absence with 1 and 0 or 
#with numbers.
library(readxl)
Family <- read_excel("~/RSTUDIO/Datos_cianobacterias/ciano_normalizados_transpu_rdp.xlsx")

#Family <- t(Family)
Metadata<- read.csv("~/RSTUDIO/Metadata-final-RDP.csv", row.names=1)
attach(Family)
Family <- Family[,-1]
rownames(Family) <- SampleID
#> Warning: Setting row names on a tibble is deprecated.

#remove the rare microbes. It keeps only the microbes that are present in at least 10% of the samples
dim(Family)
#> [1] 63  7

Family <- Family[,colMeans(Family) >=.1]

dim(Family)
#> [1] 63  6

Metadata$Month <- factor(Metadata$Month,
                         levels = c("July", "August", "September"))

library(vegan)
#> Loading required package: permute
#> Loading required package: lattice
#> This is vegan 2.5-5
#NMDS
#autotransform=F evita la transformaci?n de datos
#sratmax=0.999999 para que el an?lisis no se detenga antes de tiempo cuando se tienen muchos datos  
Family.mds <- metaMDS(Family, k=2, distance="bray", trymax=100, zerodist="add", autotransform=F)
#> Zero dissimilarities changed into  0.02467962 
#> Run 0 stress 0.1065687 
#> Run 1 stress 0.1091021 
#> Run 2 stress 0.1091069 
#> Run 3 stress 0.1119198 
#> Run 4 stress 0.1276575 
#> Run 5 stress 0.1329398 
#> Run 6 stress 0.1192065 
#> Run 7 stress 0.1091005 
#> Run 8 stress 0.1151205 
#> Run 9 stress 0.1275335 
#> Run 10 stress 0.1091012 
#> Run 11 stress 0.1179065 
#> Run 12 stress 0.1102193 
#> Run 13 stress 0.123742 
#> Run 14 stress 0.1091086 
#> Run 15 stress 0.1122333 
#> Run 16 stress 0.1103893 
#> Run 17 stress 0.1258201 
#> Run 18 stress 0.1258204 
#> Run 19 stress 0.133656 
#> Run 20 stress 0.1102089 
#> Run 21 stress 0.1269521 
#> Run 22 stress 0.114581 
#> Run 23 stress 0.1065642 
#> ... New best solution
#> ... Procrustes: rmse 0.0007737741  max resid 0.005725616 
#> ... Similar to previous best
#> *** Solution reached
stressplot(Family.mds)

#add the metadata information
##THIS HAS TO BE IN THE SAME ORDER IN THE METADATA FILE AND IN THE COUNTS FILE
colvec<- c("yellowgreen","turquoise4", "tomato2")
plot(Family.mds, type="n", xlim=c(-.5,.5), ylim=c(-0.6,0.6))
pl <-ordiellipse(Family.mds, Metadata$Month, kind="se", conf=0.95, lwd=2, col="gray30", label=T)



#plot with ggplot
data.scores <- as.data.frame(scores(Family.mds))
data.scores$site <- rownames(data.scores)
data.scores$grp <- Metadata$Month
head(data.scores)
#>        NMDS1      NMDS2 site       grp
#> 1 -0.9668070  0.4060286    1      July
#> 2 -0.2080512 -0.1192694    2      July
#> 3 -0.1998523  1.0543187    3    August
#> 4 -0.7339551  1.0967836    4    August
#> 5 -0.9225605 -0.4110575    5    August
#> 6 -1.1120828 -0.1111259    6 September
library(ggplot2)
NMDS <-  data.frame(MDS1 = Family.mds$points[,1], MDS2 = Family.mds$points[,2],group=Metadata$Month)
#NMDS.mean <- aggregate(NMDS[,1:2],list(group=group),mean)
veganCovEllipse<-function (cov, center = c(0, 0), scale = 1, npoints = 100) 
{
  theta <- (0:npoints) * 2 * pi/npoints
  Circle <- cbind(cos(theta), sin(theta))
  t(center + scale * t(Circle %*% chol(cov)))
}
#attach(NMDS.mean)
df_ell <- data.frame()
for(g in levels(NMDS$group)){
  df_ell <- rbind(df_ell, cbind(as.data.frame(with(NMDS[NMDS$group==g,],
                                                   veganCovEllipse(pl[[g]]$cov,pl[[g]]$center,pl[[g]]$scale)))
                                ,group=g))
}



ggplot() + 
  geom_path(data=df_ell, aes(x=NMDS1, y=NMDS2,colour=group), size=1, linetype=2)+
  geom_point(data=data.scores,aes(x=NMDS1,y=NMDS2,colour=grp),size=1.5) + # add the point markers
  theme(legend.title = element_blank()) +
  ylab("NMDS2")+
  xlab("NMDS1")+
  #geom_text(data=data.scores,aes(x=NMDS1,y=NMDS2,label=site),size=6,vjust=0) + 
  scale_colour_manual(values=c("July" = "yellowgreen", "August" = "turquoise4", "September" = "deeppink3"))


#PCoA
#create a distance matrix
dis.bray<-vegdist(Family, method="bray")
Family.cmd <- cmdscale(dis.bray, k=(NROW(Family)-1), eig=TRUE, add= TRUE)
#> Warning in cmdscale(dis.bray, k = (NROW(Family) - 1), eig = TRUE, add =
#> TRUE): only 61 of the first 62 eigenvalues are > 0

Family.cmd$eig
#>  [1]  1.714387e+01  1.565417e+01  6.811700e+00  4.762218e+00  3.397055e+00
#>  [6]  2.235396e+00  1.657122e+00  1.321033e+00  1.030454e+00  8.453289e-01
#> [11]  7.488473e-01  7.054772e-01  5.618437e-01  5.090589e-01  4.544567e-01
#> [16]  4.476390e-01  3.966686e-01  3.869256e-01  3.727550e-01  3.447330e-01
#> [21]  3.355670e-01  3.209168e-01  3.161521e-01  3.075951e-01  3.028185e-01
#> [26]  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01
#> [31]  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01
#> [36]  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01
#> [41]  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01
#> [46]  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01  2.963289e-01
#> [51]  2.940858e-01  2.782014e-01  2.720737e-01  2.536445e-01  2.478525e-01
#> [56]  2.373598e-01  2.097698e-01  1.939329e-01  1.696719e-01  1.577970e-01
#> [61]  4.309607e-02 -1.415619e-15 -4.866828e-15
eig2<-eigenvals(Family.cmd)
eig2
#>  [1] 17.143868 15.654169  6.811700  4.762218  3.397055  2.235396  1.657122
#>  [8]  1.321033  1.030454  0.845329  0.748847  0.705477  0.561844  0.509059
#> [15]  0.454457  0.447639  0.396669  0.386926  0.372755  0.344733  0.335567
#> [22]  0.320917  0.316152  0.307595  0.302819  0.296329  0.296329  0.296329
#> [29]  0.296329  0.296329  0.296329  0.296329  0.296329  0.296329  0.296329
#> [36]  0.296329  0.296329  0.296329  0.296329  0.296329  0.296329  0.296329
#> [43]  0.296329  0.296329  0.296329  0.296329  0.296329  0.296329  0.296329
#> [50]  0.296329  0.294086  0.278201  0.272074  0.253645  0.247852  0.237360
#> [57]  0.209770  0.193933  0.169672  0.157797  0.043096  0.000000  0.000000
eig2/sum(eig2) #the first two are the axes values of axes 1 and 2 (https://stat.ethz.ch/pipermail/r-sig-ecology/2011-June/002183.html)
#>  [1] 0.24100297 0.22006126 0.09575668 0.06694573 0.04775470 0.03142448
#>  [7] 0.02329528 0.01857066 0.01448579 0.01188336 0.01052705 0.00991737
#> [13] 0.00789822 0.00715619 0.00638861 0.00629276 0.00557624 0.00543928
#> [19] 0.00524007 0.00484615 0.00471729 0.00451134 0.00444436 0.00432407
#> [25] 0.00425693 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570
#> [31] 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570
#> [37] 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570
#> [43] 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570 0.00416570
#> [49] 0.00416570 0.00416570 0.00413416 0.00391087 0.00382472 0.00356565
#> [55] 0.00348423 0.00333673 0.00294888 0.00272625 0.00238519 0.00221826
#> [61] 0.00060583 0.00000000 0.00000000
#0.16225839 0.11075892
x<-Family.cmd$points[,1]
y<-Family.cmd$points[,2]
plot(x,y, type="n", xlab = "PCoA1 (%)", ylab = "PCoA2 (%)", asp = 1, axes = TRUE)
text(x,y, rownames(Family.cmd$points), cex =0.7)

Family.pco <- data.frame(x,y)
ordiplot(Family.pco, choices = c(1, 2), display = "sites", type = "none", xlab = "PCoA 1",ylim = c(-0.4,0.4), ylab = "PCoA 2")
pl <-ordiellipse(Family.pco, Metadata$Month, kind="se", conf=0.95, lwd=2, col="gray30", label=T) 

#with(Metadata, points(Clase.pco$x, Clase.pco$y, display="sites", col=colvec[Crop], pch=21, bg=colvec[Crop]))
#with(Metadata, legend("topright", legend=levels(Crop), bty="n", col=colvec, pch=21, pt.bg=colvec))
#plot with ggplot
data.scores <- as.data.frame(scores(Family.cmd))
data.scores$site <- rownames(data.scores)
data.scores$grp <- Metadata$Month
head(data.scores)
#>             Dim1        Dim2         Dim3        Dim4        Dim5
#> site1 -0.4149270  0.14535489 -0.046607243 -0.85191136  0.09692017
#> site2 -0.0516169 -0.22695354  0.185551567 -0.59009000 -0.13925022
#> site3  0.2322666  0.86366367  0.008254121 -0.42395725 -0.33609092
#> site4  0.1271806  0.72286609  0.048424488 -0.25681095  0.65218461
#> site5 -0.8106741 -0.11210252  0.061944023 -0.08202866  0.21958708
#> site6 -0.6935260 -0.05316991  0.032671869 -0.34003342  0.50656482
#>              Dim6        Dim7        Dim8         Dim9        Dim10
#> site1 -0.23250502  0.14479390  0.07202494 -0.004663146 -0.125562487
#> site2 -0.28465428 -0.02341148  0.18946800  0.272108287 -0.143973361
#> site3  0.08666607 -0.03739834 -0.06817964  0.040673711  0.023601243
#> site4 -0.33031732  0.02022920 -0.01972667  0.235248089 -0.185549675
#> site5 -0.19216550 -0.14383942 -0.06711332 -0.080727683 -0.004344357
#> site6 -0.26372603  0.18059884  0.11325004  0.133126260 -0.248171613
#>             Dim11       Dim12        Dim13       Dim14        Dim15
#> site1 -0.21353536  0.14487211  0.144996004  0.19898668  0.136669238
#> site2 -0.13470940 -0.26676587 -0.028505984 -0.07685931 -0.179055625
#> site3  0.04500053  0.02953693 -0.007970808 -0.02971281  0.024997353
#> site4 -0.08164198  0.08558797 -0.291087992 -0.04064984  0.001562537
#> site5  0.23168667 -0.04891283  0.005063631  0.07155562  0.117816846
#> site6 -0.14643494  0.05637621 -0.016660438  0.01891467 -0.099445867
#>              Dim16        Dim17        Dim18        Dim19        Dim20
#> site1 -0.038882559  0.006572750 -0.119912249 -0.006191755 -0.075253392
#> site2 -0.047704333 -0.067100441  0.076328115 -0.055839389  0.083826100
#> site3 -0.007787734 -0.004470414  0.013005436 -0.004573798  0.001364508
#> site4 -0.092005349 -0.068717450  0.005998597  0.007072703 -0.024211322
#> site5 -0.244877116 -0.062771374 -0.303688347 -0.045990438  0.075221579
#> site6  0.128663812  0.007409749  0.099158997  0.050253769 -0.032324818
#>               Dim21         Dim22        Dim23        Dim24        Dim25
#> site1 -0.0740721607 -0.0983438617  0.076200235  0.027638023 -0.075065176
#> site2  0.0615095121  0.0215040570 -0.105700492  0.013991334  0.190957628
#> site3 -0.0087138352  0.0001798287  0.009331464  0.002966778  0.006047507
#> site4  0.0003669779 -0.0136841236 -0.009226008 -0.069743288 -0.157391881
#> site5  0.1635879702  0.0619801458 -0.115819110 -0.073853591  0.057256763
#> site6  0.0277050695  0.0372309005  0.004079962  0.021557526  0.015653424
#>               Dim26         Dim27         Dim28         Dim29
#> site1  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
#> site2  3.027941e-15  1.144227e-14  6.722399e-16  5.371058e-15
#> site3 -1.180908e-01 -6.854702e-02  1.889700e-03  2.183149e-01
#> site4 -6.354012e-15 -1.300291e-14 -3.504086e-16 -1.014821e-14
#> site5  3.519871e-15  4.089324e-15 -2.810419e-16 -3.844963e-15
#> site6  4.656751e-15  2.234263e-15 -6.163850e-16  4.985196e-15
#>               Dim30         Dim31         Dim32         Dim33
#> site1  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
#> site2  2.012819e-15 -1.680736e-16  5.076078e-15  6.143677e-15
#> site3  1.169936e-02 -9.654535e-04 -1.468305e-01  2.925074e-03
#> site4 -2.719808e-15 -6.239832e-15 -1.485971e-14 -4.555282e-15
#> site5 -4.682233e-16  1.450428e-15  9.698251e-15  1.842720e-15
#> site6  3.263627e-15  6.528295e-15  1.573914e-14 -9.652824e-16
#>               Dim34         Dim35         Dim36         Dim37
#> site1  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
#> site2  3.530750e-15  3.356938e-15  5.730814e-16 -3.112598e-15
#> site3 -1.597066e-02  4.081567e-03  1.340167e-02 -7.805942e-02
#> site4 -3.389553e-15 -2.758830e-15  2.476766e-15  6.623134e-15
#> site5  2.541366e-15 -4.559780e-16 -2.144005e-15 -1.710221e-16
#> site6  4.704567e-16 -5.733335e-16 -2.456861e-15 -4.791728e-15
#>               Dim38         Dim39         Dim40         Dim41
#> site1  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
#> site2  5.883537e-15  5.971011e-15 -4.467544e-15  1.472595e-15
#> site3 -3.616648e-03 -1.620638e-01  1.044428e-01 -4.578012e-02
#> site4 -8.990534e-15 -5.260246e-15  1.174112e-14  1.668884e-15
#> site5  2.441636e-15 -9.706149e-16  1.965114e-15  1.704669e-16
#> site6  3.582444e-15  2.735728e-16 -7.730524e-15 -3.316942e-15
#>               Dim42         Dim43         Dim44         Dim45
#> site1  0.000000e+00  5.006318e-14  0.000000e+00  0.000000e+00
#> site2 -3.933252e-15 -7.128444e-14 -6.167663e-16 -3.858211e-15
#> site3 -9.096227e-02  4.183294e-02 -3.648633e-02  1.168049e-02
#> site4  4.430328e-15  2.300355e-14 -1.342608e-15  2.770251e-15
#> site5  3.398594e-15 -2.526630e-14 -2.143465e-15  9.287238e-16
#> site6 -9.033533e-16  1.193996e-14  1.981082e-15 -2.927770e-16
#>               Dim46         Dim47         Dim48         Dim49
#> site1  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
#> site2  8.988472e-15  6.112978e-16 -3.152004e-15  6.741571e-15
#> site3  1.903017e-02  2.191784e-02  2.685729e-02  1.192709e-01
#> site4 -1.433871e-14 -2.370291e-15  5.563087e-15 -9.896447e-15
#> site5  1.010428e-15  6.388683e-16 -3.041176e-15 -5.711656e-15
#> site6  6.539826e-15  1.766217e-15 -3.925720e-15  4.278194e-15
#>               Dim50       Dim51        Dim52       Dim53        Dim54
#> site1  0.000000e+00 -0.08465135 -0.002311948 -0.12358855 -0.065230671
#> site2  7.214404e-15  0.11233126  0.081207886  0.03933285 -0.070549923
#> site3  2.472334e-01 -0.01075919  0.004330018 -0.01721169  0.030170323
#> site4 -4.082615e-15 -0.02623877  0.038717582 -0.02746230  0.088209374
#> site5  2.383780e-15  0.04211083  0.005214609  0.09737797  0.134324095
#> site6 -1.374383e-15 -0.02453167 -0.121389903  0.11428886  0.003500853
#>               Dim55        Dim56        Dim57        Dim58       Dim59
#> site1  0.0396225631  0.186329175 -0.006463092  0.037688593 -0.06549207
#> site2 -0.1077043841  0.055956154  0.026311126  0.026311911 -0.06497825
#> site3 -0.0576444964  0.004774223  0.004955005  0.037272154  0.02047032
#> site4 -0.0005525574 -0.067385862 -0.181323228 -0.079901115  0.06131317
#> site5  0.0093925063  0.037875731  0.031849177 -0.048336980 -0.05854809
#> site6  0.0534118181 -0.118727876  0.191551406  0.005309776  0.03532123
#>              Dim60        Dim61  site       grp
#> site1  0.003946364 -0.058781520 site1      July
#> site2 -0.117299926 -0.026489428 site2      July
#> site3  0.009568333  0.023801778 site3    August
#> site4 -0.066507882  0.043008697 site4    August
#> site5  0.077629777 -0.007339537 site5    August
#> site6  0.158831560  0.004223108 site6 September
library(ggplot2)
NMDS <-  data.frame(Dim1 = Family.mds$points[,1], Dim2 = Family.mds$points[,2],group=Metadata$Month)
#NMDS.mean <- aggregate(NMDS[,1:2],list(group=group),mean)
veganCovEllipse<-function (cov, center = c(0, 0), scale = 1, npoints = 100) 
{
  theta <- (0:npoints) * 2 * pi/npoints
  Circle <- cbind(cos(theta), sin(theta))
  t(center + scale * t(Circle %*% chol(cov)))
}
#attach(NMDS.mean)
df_ell <- data.frame()
for(g in levels(NMDS$group)){
  df_ell <- rbind(df_ell, cbind(as.data.frame(with(NMDS[NMDS$group==g,],
                                                   veganCovEllipse(pl[[g]]$cov,pl[[g]]$center,pl[[g]]$scale)))
                                ,group=g))
}

ggplot() + 
  geom_path(data=df_ell, aes(x=x, y=y,colour=group), size=1, linetype=1)+
  geom_point(data=data.scores,aes(x=Dim1,y=Dim2,colour=grp),size=1.5) + 
  # add the point markers
  theme_light()+
  #geom_text(data=data.scores,aes(x=NMDS1,y=NMDS2,label=site),size=6,vjust=0) + 
  scale_colour_manual(values=c("July" = "deeppink", "August" = "turquoise4", "September"="darkorchid"))+ 
  ylab("Family PCoA2 (22.00%)")+
  xlab("Family PCoA1 (24.10%)")

Created on 2020-02-22 by the reprex package (v0.3.0)

So what I want to get are the same differences in both analyzes

Please do not post your entire script, try to narrow down your code to just the relevant part for your issue (minimal reproducible example), which I think is to filter your data by month. I have tried to find the relevant parts but the code is so messy that I have failed to do so.

As @andresrcs says, it's difficult to follow what you intend since there's so much code, but let me see if I understand a little about what your difficulty is:

It seems that to apply your analysis, you need two tables, one a table you call 'Family', which contains bacteria counts from several samples, and a second table you call 'Metadata' which contains non-count information about the samples, like when they were taken.

Is what you want a table like your 'Family' table, but, say, only with count data from the month of July?

Unrelated to your question, I noticed a couple of things I wasn't sure about. One is that 'Family' contains two columns with the same name (at the least the one you gave with tribble()), and the other is that the calculations intended to remove rare bacteria don't match the verbal instructions for removing them.

I'm so sorry.
I will try to explain again what I want to get in the NMDS or PCOA analysis.
Before obtaining such analyzes, I would like to eliminate those samples or groups of microorganisms whose relative abundance is less than 0.01%. But this elimination has to be done every month ()Considering the total microorganisms of each month). I already performed this analysis in obtaining the Barplots. But now I don't know how to gather all that information to be able to do an NMDS or PCOA and be able to see the same differences or similarities.

library(tidyverse)
Family <- tibble::tribble(
            ~SampleID, ~Acidobacteria_Gp3, ~Acidobacteria_Gp4, ~Acidobacteria_Gp6, ~Holophagae, ~Acidobacteria, ~Actinobacteria,
                 "1A",                  0,                  0,                  0,           0,              0,     9.856892382,
                 "1B",                  0,                  0,                  0,           0,              0,     8.000898265,
                 "1C",                  0,                  0,                  0,           0,              0,     6.430904743,
                 "1D",                  0,                  0,                  0,           0,              0,     10.44598893,
                 "1E",                  0,                  0,                  0,           0,              0,     11.68970477,
                 "1F",                  0,                  0,        2.389976051,           0,              0,     12.13926806,
                 "1G",                  0,                  0,                  0,           0,              0,     10.55539547,
                 "1H",        1.578812637,                  0,                  0,           0,              0,     7.400210777,
                 "2A",                  0,                  0,                  0,           0,              0,     10.18747789,
                 "2B",                  0,                  0,                  0,           0,              0,     9.547619534,
                 "2C",                  0,                  0,                  0,           0,              0,     10.81155838,
                 "2D",                  0,                  0,                  0,           0,              0,     9.856892382,
                 "2E",                  0,                  0,                  0,           0,              0,     10.31738199,
                 "2F",                  0,        2.621352961,                  0,           0,              0,     9.856892382,
                 "2G",                  0,                  0,                  0,           0,              0,     11.39298548,
                 "2H",                  0,                  0,        3.223912769,           0,              0,     11.07013841,
                 "3A",                  0,                  0,                  0,           0,              0,     8.918767725,
                 "3B",                  0,        7.709597352,                  0,           0,              0,     8.554527826,
                 "3C",                  0,                  0,                  0,           0,              0,     6.349773084,
                 "3D",                  0,                  0,                  0,           0,              0,     9.856892382,
                 "3E",                  0,                  0,                  0,           0,              0,     12.00707455,
                 "3F",                  0,                  0,                  0,           0,              0,     10.57569921,
                 "3G",                  0,                  0,                  0,           0,              0,      10.8645108,
                 "3H",                  0,                  0,                  0,           0,              0,     6.644683278,
                 "4A",        1.260705504,                  0,                  0,           0,              0,      10.8468975,
                 "4B",                  0,                  0,                  0,           0,              0,     10.74683494,
                 "4C",                  0,                  0,                  0,           0,              0,     10.33730627,
                 "4D",                  0,                  0,                  0,           0,              0,     11.58951754,
                 "4E",                  0,                  0,                  0,           0,              0,     11.56315536,
                 "4F",                  0,                  0,                  0,           0,              0,     9.159782477,
                 "4G",                  0,                  0,                  0,           0,              0,     9.972280125,
                 "4H",                  0,         2.47162009,         2.88074983,           0,              0,     10.78156913,
                 "5A",                  0,                  0,                  0,           0,              0,     11.01967707,
                 "5B",                  0,                  0,                  0,           0,              0,     5.868034148,
                 "5C",                  0,                  0,                  0,           0,              0,               0,
                 "5D",                  0,                  0,         4.19412945,           0,              0,     11.87767008,
                 "5E",                  0,                  0,                  0,           0,              0,     6.164437395,
                 "5F",                  0,                  0,          3.3921984,           0,              0,     10.85321352,
                 "5G",                  0,        3.411780566,        3.909352577,           0,              0,     11.62102234,
                 "5H",                  0,                  0,                  0,           0,              0,     9.690286816,
                 "6A",                  0,                  0,                  0,  2.31461136,              0,     11.61254696,
                 "6B",                  0,                  0,                  0,           0,              0,     11.40746303,
                 "6C",                  0,                  0,                  0,           0,              0,     9.547330454,
                 "6D",                  0,                  0,                  0,           0,              0,     8.218473414,
                 "6E",                  0,                  0,                  0,           0,              0,     11.92700352,
                 "6F",                  0,                  0,                  0,           0,              0,      11.7752258,
                 "6G",                  0,                  0,                  0,           0,              0,      10.5203966,
                 "6H",                  0,        2.646072162,        3.909352577,           0,              0,     10.33074952,
                 "7A",                  0,                  0,                  0,           0,              0,     10.76426233,
                 "7B",                  0,                  0,                  0,           0,              0,     9.108801515,
                 "7C",                  0,                  0,                  0,           0,              0,      5.78363635,
                 "7D",                  0,                  0,                  0,           0,              0,     7.293356816,
                 "7E",                  0,                  0,                  0,           0,    1.240730233,     10.93454965,
                 "7F",                  0,                  0,                  0,           0,              0,     6.817961873,
                 "7G",                  0,                  0,                  0,           0,              0,     14.56410088,
                 "7H",                  0,                  0,                  0,           0,              0,      10.7903401,
                 "8A",                  0,                  0,                  0,           0,              0,     11.05054116,
                 "8B",                  0,                  0,                  0,           0,              0,     11.97947779,
                 "8C",                  0,                  0,                  0,           0,              0,     8.637794769,
                 "8D",                  0,                  0,                  0,           0,              0,     11.76598538,
                 "8E",                  0,                  0,        2.461810803,           0,              0,     11.41325826,
                 "8F",                  0,                  0,                  0,           0,              0,     11.28987395,
                 "8G",                  0,        3.159682475,        4.286740975,           0,              0,     12.09051597,
                 "8H",                  0,                  0,                  0,           0,              0,      11.2225116,
                 "9A",                  0,                  0,                  0,           0,              0,     6.932802918,
                 "9B",                  0,                  0,                  0,           0,              0,     5.927107416,
                 "9C",                  0,                  0,                  0,           0,              0,     10.45025088,
                 "9D",                  0,        1.462437263,                  0,           0,              0,     12.20029148,
                 "9E",                  0,                  0,                  0, 0.888175836,              0,     8.157872951,
                 "9F",                  0,        1.773241148,        3.909352577,           0,              0,     10.31289579,
                 "9G",        2.312465184,                  0,        3.262409299,           0,              0,     9.877424602,
                 "9H",        1.014402512,        6.105057757,        3.981026855,           0,              0,     10.39058487,
                "10A",                  0,                  0,        1.455192359,           0,              0,     10.18491176,
                "10B",                  0,                  0,                  0,           0,              0,     10.94273636,
                "10C",                  0,                  0,                  0,           0,              0,     9.759960464,
                "10D",                  0,                  0,                  0,           0,              0,     6.618940421,
                "10E",                  0,                  0,                  0,           0,              0,     13.09890076,
                "10F",                  0,                  0,                  0,           0,              0,     12.13458127,
                "10G",                  0,                  0,                  0,           0,              0,     10.49732557,
                "10H",                  0,                  0,                  0,           0,              0,      9.82549404,
                "11A",                  0,                  0,                  0,           0,              0,     7.862918967,
                "11B",                  0,                  0,                  0,           0,              0,     9.856892382,
                "11C",                  0,                  0,                  0,           0,              0,     8.017284182,
                "11D",                  0,        1.059301986,                  0,           0,              0,     11.87174353,
                "11E",                  0,                  0,                  0,           0,              0,     11.27265841,
                "11F",                  0,                  0,                  0,           0,              0,     9.122390157,
                "11G",                  0,                  0,         4.07283503,           0,              0,     10.17223086,
                "11H",                  0,                  0,                  0,           0,              0,     7.936657365,
                "12A",                  0,                  0,                  0,           0,              0,     9.742755997,
                "12B",                  0,                  0,                  0,           0,              0,     9.520702225,
                "12C",                  0,                  0,                  0,           0,              0,     9.393448136,
                "12D",        2.673249184,                  0,        3.681787823,           0,              0,     12.01518041,
                "12E",                  0,                  0,                  0,           0,              0,     7.815994714,
                "12F",                  0,                  0,                  0,           0,              0,     12.57633226,
                "12G",                  0,        3.294240236,         3.80111298,           0,    0.868630887,     11.36050819,
                "12H",        0.705219092,        3.799402444,        2.868671443,           0,              0,      10.5377225
            )



Metadata<- data.frame (tibble::tribble(
                          ~SampleID, ~SamplingPoint,      ~Month,
                               "1A",         "CEA1",      "July",
                               "1B",         "CEA2",      "July",
                               "1C",         "CEA4",      "July",
                               "1D",         "CEA1",    "August",
                               "1E",         "CEA3",    "August",
                               "1F",         "CEA5",    "August",
                               "1G",         "CEA2", "September",
                               "1H",         "CEA4", "September",
                               "2A",         "CEA1",      "July",
                               "2B",         "CEA2",      "July",
                               "2C",         "CEA4",      "July",
                               "2D",         "CEA1",    "August",
                               "2E",         "CEA3",    "August",
                               "2F",         "CEA5",    "August",
                               "2G",         "CEA2", "September",
                               "2H",         "CEA4", "September",
                               "3A",         "CEA1",      "July",
                               "3B",         "CEA2",      "July",
                               "3C",         "CEA4",      "July",
                               "3D",         "CEA1",    "August",
                               "3E",         "CEA3",    "August",
                               "3F",         "CEA5",    "August",
                               "3G",         "CEA2", "September",
                               "3H",         "CEA4", "September",
                               "4A",         "CEA1",      "July",
                               "4B",         "CEA3",      "July",
                               "4C",         "CEA4",      "July",
                               "4D",         "CEA1",    "August",
                               "4E",         "CEA3",    "August",
                               "4F",         "CEA5",    "August",
                               "4G",         "CEA2", "September",
                               "4H",         "CEA4", "September",
                               "5A",         "CEA1",      "July",
                               "5B",         "CEA3",      "July",
                               "5C",         "CEA4",      "July",
                               "5D",         "CEA1",    "August",
                               "5E",         "CEA3",    "August",
                               "5F",         "CEA5",    "August",
                               "5G",         "CEA2", "September",
                               "5H",         "CEA4", "September",
                               "6A",         "CEA1",      "July",
                               "6B",         "CEA3",      "July",
                               "6C",         "CEA5",      "July",
                               "6D",         "CEA1",    "August",
                               "6E",         "CEA3",    "August",
                               "6F",         "CEA5",    "August",
                               "6G",         "CEA2", "September",
                               "6H",         "CEA4", "September",
                               "7A",         "CEA1",      "July",
                               "7B",         "CEA3",      "July",
                               "7C",         "CEA5",      "July",
                               "7D",         "CEA2",    "August",
                               "7E",         "CEA4",    "August",
                               "7F",         "CEA1", "September",
                               "7G",         "CEA3", "September",
                               "7H",         "CEA5", "September",
                               "8A",         "CEA1",      "July",
                               "8B",         "CEA3",      "July",
                               "8C",         "CEA5",      "July",
                               "8D",         "CEA2",    "August",
                               "8E",         "CEA4",    "August",
                               "8F",         "CEA1", "September",
                               "8G",         "CEA3", "September",
                               "8H",         "CEA5", "September",
                               "9A",         "CEA2",      "July",
                               "9B",         "CEA3",      "July",
                               "9C",         "CEA5",      "July",
                               "9D",         "CEA2",    "August",
                               "9E",         "CEA4",    "August",
                               "9F",         "CEA1", "September",
                               "9G",         "CEA3", "September",
                               "9H",         "CEA5", "September",
                              "10A",         "CEA2",      "July",
                              "10B",         "CEA3",      "July",
                              "10C",         "CEA5",      "July",
                              "10D",         "CEA2",    "August",
                              "10E",         "CEA4",    "August",
                              "10F",         "CEA1", "September",
                              "10G",         "CEA3", "September",
                              "10H",         "CEA5", "September",
                              "11A",         "CEA2",      "July",
                              "11B",         "CEA4",      "July",
                              "11C",         "CEA5",      "July",
                              "11D",         "CEA2",    "August",
                              "11E",         "CEA4",    "August",
                              "11F",         "CEA1", "September",
                              "11G",         "CEA3", "September",
                              "11H",         "CEA5", "September",
                              "12A",         "CEA2",      "July",
                              "12B",         "CEA4",      "July",
                              "12C",         "CEA1",    "August",
                              "12D",         "CEA2",    "August",
                              "12E",         "CEA4",    "August",
                              "12F",         "CEA1", "September",
                              "12G",         "CEA3", "September",
                              "12H",         "CEA5", "September"
                          )
)
attach(Metadata)
Metadata <- Metadata[,-1]
rownames(Metadata) <- SampleID
attach(Family)
#> The following object is masked from Metadata:
#> 
#>     SampleID
Family <- Family[,-1]
rownames(Family) <- SampleID
#> Warning: Setting row names on a tibble is deprecated.

dim(Family)
#> [1] 96  6
Family <- Family[,colMeans(Family) >=.1]

Metadata$Month <- factor(Metadata$Month,
                         levels = c("July", "August", "September"))

library(vegan)
#> Loading required package: permute
#> Loading required package: lattice
#> This is vegan 2.5-5
#NMDS
Family.mds <- metaMDS(Family, k=2, distance="bray", trymax=100, zerodist="add", autotransform=F)
#> Warning in distfun(comm, method = distance, ...): you have empty rows:
#> their dissimilarities may be meaningless in method "bray"
#> Zero dissimilarities changed into  7.569541e-06 
#> Run 0 stress 0.008458848 
#> Run 1 stress 9.61923e-05 
#> ... New best solution
#> ... Procrustes: rmse 0.01558558  max resid 0.03756517 
#> Run 2 stress 7.113894e-05 
#> ... New best solution
#> ... Procrustes: rmse 3.140137e-05  max resid 5.412319e-05 
#> ... Similar to previous best
#> Run 3 stress 9.770961e-05 
#> ... Procrustes: rmse 3.740565e-05  max resid 6.92103e-05 
#> ... Similar to previous best
#> Run 4 stress 8.093015e-05 
#> ... Procrustes: rmse 2.591105e-05  max resid 6.544779e-05 
#> ... Similar to previous best
#> Run 5 stress 9.786884e-05 
#> ... Procrustes: rmse 0.0001094855  max resid 0.0002340016 
#> ... Similar to previous best
#> Run 6 stress 3.128709e-05 
#> ... New best solution
#> ... Procrustes: rmse 1.728624e-05  max resid 4.023164e-05 
#> ... Similar to previous best
#> Run 7 stress 9.992657e-05 
#> ... Procrustes: rmse 0.0001159753  max resid 0.0002715928 
#> ... Similar to previous best
#> Run 8 stress 8.677492e-05 
#> ... Procrustes: rmse 2.331527e-05  max resid 4.647501e-05 
#> ... Similar to previous best
#> Run 9 stress 7.770861e-05 
#> ... Procrustes: rmse 1.983674e-05  max resid 4.41113e-05 
#> ... Similar to previous best
#> Run 10 stress 9.949823e-05 
#> ... Procrustes: rmse 0.0001164392  max resid 0.0002808272 
#> ... Similar to previous best
#> Run 11 stress 8.789324e-05 
#> ... Procrustes: rmse 1.65577e-05  max resid 8.166806e-05 
#> ... Similar to previous best
#> Run 12 stress 9.761892e-05 
#> ... Procrustes: rmse 2.388312e-05  max resid 4.4172e-05 
#> ... Similar to previous best
#> Run 13 stress 0.0001295994 
#> ... Procrustes: rmse 0.0002327799  max resid 0.0005496831 
#> ... Similar to previous best
#> Run 14 stress 3.613531e-05 
#> ... Procrustes: rmse 9.092786e-06  max resid 2.079588e-05 
#> ... Similar to previous best
#> Run 15 stress 8.523126e-05 
#> ... Procrustes: rmse 2.059391e-05  max resid 4.213559e-05 
#> ... Similar to previous best
#> Run 16 stress 8.491455e-05 
#> ... Procrustes: rmse 0.0001012987  max resid 0.0002290998 
#> ... Similar to previous best
#> Run 17 stress 6.924853e-05 
#> ... Procrustes: rmse 1.57584e-05  max resid 5.09801e-05 
#> ... Similar to previous best
#> Run 18 stress 0.0001168643 
#> ... Procrustes: rmse 0.0001529754  max resid 0.0003666565 
#> ... Similar to previous best
#> Run 19 stress 7.525547e-05 
#> ... Procrustes: rmse 2.138545e-05  max resid 5.426568e-05 
#> ... Similar to previous best
#> Run 20 stress 9.809859e-05 
#> ... Procrustes: rmse 8.450104e-05  max resid 0.000169845 
#> ... Similar to previous best
#> *** Solution reached
#> Warning in metaMDS(Family, k = 2, distance = "bray", trymax = 100, zerodist
#> = "add", : stress is (nearly) zero: you may have insufficient data
stressplot(Family.mds)

colvec<- c("yellowgreen","turquoise4", "tomato2")
plot(Family.mds, type="n", xlim=c(-.5,.5), ylim=c(-0.6,0.6))
pl <-ordiellipse(Family.mds, Metadata$Month, kind="se", conf=0.95, lwd=2, col="gray30", label=T)


#plot with ggplot
data.scores <- as.data.frame(scores(Family.mds))
data.scores$site <- rownames(data.scores)
data.scores$grp <- Metadata$Month
head(data.scores)
#>       NMDS1        NMDS2 site    grp
#> 1 -69.93894  0.018162032    1   July
#> 2 -69.91426 -0.014852247    2   July
#> 3 -69.87028  0.092280063    3   July
#> 4 -69.95249 -0.038325418    4 August
#> 5 -69.92206  0.021808127    5 August
#> 6 -69.89409  0.003661365    6 August
library(ggplot2)
NMDS <-  data.frame(MDS1 = Family.mds$points[,1], MDS2 = Family.mds$points[,2],group=Metadata$Month)
#NMDS.mean <- aggregate(NMDS[,1:2],list(group=group),mean)
veganCovEllipse<-function (cov, center = c(0, 0), scale = 1, npoints = 100) 
{
  theta <- (0:npoints) * 2 * pi/npoints
  Circle <- cbind(cos(theta), sin(theta))
  t(center + scale * t(Circle %*% chol(cov)))
}
#attach(NMDS.mean)
df_ell <- data.frame()
for(g in levels(NMDS$group)){
  df_ell <- rbind(df_ell, cbind(as.data.frame(with(NMDS[NMDS$group==g,],
                                                   veganCovEllipse(pl[[g]]$cov,pl[[g]]$center,pl[[g]]$scale)))
                                ,group=g))
}

ggplot() + 
  geom_path(data=df_ell, aes(x=NMDS1, y=NMDS2,colour=group), size=1, linetype=2)+
  geom_point(data=data.scores,aes(x=NMDS1,y=NMDS2,colour=grp),size=1.5) + # add the point markers
  theme(legend.title = element_blank()) +
  ylab("NMDS2")+
  xlab("NMDS1")+
  scale_colour_manual(values=c("July" = "yellowgreen", "August" = "turquoise4", "September" = "deeppink3"))

Created on 2020-02-24 by the reprex package (v0.3.0)

This is the image of the original result. In the attached script I resume the data

I would like the difference in the NMDS to be observed in my Barplots. In the NMDS I did not eliminate for months the microorganisms below 0.01%. I only represented them in a general way.

I'm not sure what an NMDS is, but I might be able to help if you could answer my question -- was I on the right track?

NMDS: Non-metric multidimensional scaling ( NMDS ) is an indirect gradient analysis approach which produces an ordination based on a distance or dissimilarity matrix. ... Any dissimilarity coefficient or distance measure may be used to build the distance matrix used as input. NMDS is a rank-based approach.

I would like to obtain this analysis


But with this differences

Two ellipses that cross each other means that there is similarity between them, when they do not cross each other, there are differences. As you can see in my barplot there are differences in the three months with respect to the microorganism communities.

And there are even more differences with respect to the month of August, and this is not being presented in the NMDS analysis.

I don't understand what your question is, I'm sorry.

Below is the correct barplot script, this is very summarized in information. I can't paste everything. So you can see that these differences were obtained because I first filtered per month.

library (tidyverse)
Family <-data.frame (tibble::tribble(
                        ~index, ~Bacteroidia, ~Cytophagia, ~Flavobacteriia, ~Sphingobacteriia, ~Un.Bacteroidetes,
                          "1A",            7,          78,            5539,               255,                57,
                          "1B",           36,           4,            4820,                34,                33,
                          "1C",           32,         157,             453,               329,                64,
                          "1D",            0,          35,            1542,               113,                 0,
                          "1E",          718,          90,            1975,              2401,               206,
                          "1F",          443,         204,            6944,              1704,              1671,
                          "1G",           49,           0,            2986,                34,               260,
                          "1H",         1040,         201,           10193,               351,               971,
                          "2A",          521,         231,           13510,               687,               504,
                          "2B",          845,          34,            8609,               299,               468,
                          "2C",          314,          38,           14687,               155,                68,
                          "2D",           24,         138,            2195,               759,               369,
                          "2E",            0,          70,            5734,               309,                10,
                          "2F",          668,          45,            7914,               464,               149,
                          "2G",           20,         141,           10438,               257,               154,
                          "2H",          168,           2,           12092,               954,              1459,
                          "3A",         1134,         639,            2613,               950,              1064,
                          "3B",            4,           0,             198,                33,                63,
                          "3C",          173,          18,            2493,               311,                48,
                          "3D",            0,          43,            2015,                41,                 0,
                          "3E",           62,          14,            2434,               478,                72,
                          "3F",          346,          49,            3093,               339,               518,
                          "3G",          431,          80,            2655,               456,               618,
                          "3H",           25,           0,             481,                 0,                19,
                          "4A",         1915,         345,            4426,              3228,              5273,
                          "4B",            0,          22,           13326,               280,               220,
                          "4C",           45,           0,            5156,                84,                50,
                          "4D",           46,          57,            4905,               824,               209,
                          "4E",          192,         126,            3572,              1135,               465,
                          "4F",            0,           0,             508,                 0,                 0,
                          "4G",            4,         187,            8384,               845,                13,
                          "4H",         1730,          52,           20979,               880,              5162,
                          "5A",            0,          15,            5376,              1091,                 6,
                          "5B",           26,         842,            2095,               542,               337,
                          "5C",            0,           0,             124,               136,                42,
                          "5D",          260,           9,            7567,                88,               173,
                          "5E",          367,          74,            8499,               501,               341,
                          "5F",          556,          25,           11238,               522,              1159,
                          "5G",            0,           0,              45,               936,                77,
                          "5H",            0,           0,            6477,              1662,                22,
                          "6A",          478,          85,           14459,               833,               635,
                          "6B",            9,         115,           18826,               254,                60,
                          "6C",          152,          57,            3766,               412,               243,
                          "6D",            0,          95,            7290,               295,                19,
                          "6E",          135,          49,            2360,              1114,               299,
                          "6F",          300,          81,            8547,               828,              1113,
                          "6G",            0,           8,            2259,              4441,                 0,
                          "6H",         2462,         371,           34631,              1635,              1046,
                          "7A",            0,         297,            4451,               482,                16,
                          "7B",            9,         371,            1463,               102,                 9,
                          "7C",          127,         118,            3369,                82,                 0,
                          "7D",          688,         218,           22223,               253,               223,
                          "7E",         1214,          37,           13024,               773,               731,
                          "7F",          806,           3,           12968,                39,               569,
                          "7G",           13,           0,              54,                50,                25,
                          "7H",            0,           0,            1271,               635,                 0,
                          "8A",          577,          56,           13347,               765,               772,
                          "8B",          257,         149,           20001,               803,              1048,
                          "8C",          171,          37,            9434,               191,               195,
                          "8D",          355,         297,            3656,              2276,               794,
                          "8E",          856,          63,            2137,               467,               903,
                          "8F",          375,         117,           15910,               715,               778,
                          "8G",           65,           0,             371,               476,               292,
                          "8H",          149,          12,           12858,               519,               599,
                          "9A",            0,         609,            2101,               319,               116,
                          "9B",          289,         907,            4950,              1355,               590,
                          "9C",            0,          22,            1610,                 0,                 0,
                          "9D",          362,         710,            5405,              2516,               584,
                          "9E",         1281,         251,           17001,               978,              1097,
                          "9F",          456,           8,           42392,              1355,              1030,
                          "9G",            0,          13,             810,              1534,               194,
                          "9H",          371,          10,            2063,               440,               776,
                         "10A",            6,          98,           11000,                98,                58,
                         "10B",           23,           2,           13856,               100,               109,
                         "10C",            0,          36,            1650,               359,               105,
                         "10D",          213,          62,           10338,                73,                 5,
                         "10E",           63,          10,            5733,               173,                50,
                         "10F",          106,           6,           10509,               278,               603,
                         "10G",          238,           4,            1506,               259,               304,
                         "10H",           32,           2,            2512,               170,                41,
                         "11A",            0,          12,              74,                 0,                 0,
                         "11B",            0,           0,             778,                 0,                 3,
                         "11C",            0,          62,            2852,               331,                32,
                         "11D",          261,         376,            2849,              1618,               554,
                         "11E",          310,          29,            7664,               458,               271,
                         "11F",            2,         141,            3557,               474,                 0,
                         "11G",            0,          52,            1139,               424,                35,
                         "11H",           22,         203,           10735,              2474,                53,
                         "12A",           70,          11,           27508,               520,               406,
                         "12B",          636,          13,            9453,               448,               501,
                         "12C",           59,           8,           16805,               346,               430,
                         "12D",           63,          30,             223,               580,               956,
                         "12E",            6,         346,            6035,               304,               200,
                         "12F",           86,          63,            9172,              1041,               668,
                         "12G",          379,          42,           15882,              1723,              1842,
                         "12H",          385,          45,           25224,              2824,              1233
                        )
)

data<- Family
attach(Family)
rwnames <- index
data <- as.data.frame(data[,-1])
rownames(data) <- rwnames

Metadata<- data.frame (tibble::tribble(
  ~SampleID, ~SamplingPoint,         ~Depth,      ~Month,
       "1A",         "CEA1",        "80 cm",      "July",
       "1B",         "CEA2",        "80 cm",      "July",
       "1C",         "CEA4", "Interstitial",      "July",
       "1D",         "CEA1",        "80 cm",    "August",
       "1E",         "CEA3",        "80 cm",    "August",
       "1F",         "CEA5",        "80 cm",    "August",
       "1G",         "CEA2",        "80 cm", "September",
       "1H",         "CEA4",        "80 cm", "September",
       "2A",         "CEA1",        "80 cm",      "July",
       "2B",         "CEA2", "Interstitial",      "July",
       "2C",         "CEA4", "Interstitial",      "July",
       "2D",         "CEA1",        "80 cm",    "August",
       "2E",         "CEA3",        "80 cm",    "August",
       "2F",         "CEA5",        "80 cm",    "August",
       "2G",         "CEA2",        "80 cm", "September",
       "2H",         "CEA4",        "80 cm", "September",
       "3A",         "CEA1", "Interstitial",      "July",
       "3B",         "CEA2", "Interstitial",      "July",
       "3C",         "CEA4",        "80 cm",      "July",
       "3D",         "CEA1", "Interstitial",    "August",
       "3E",         "CEA3", "Interstitial",    "August",
       "3F",         "CEA5", "Interstitial",    "August",
       "3G",         "CEA2", "Interstitial", "September",
       "3H",         "CEA4", "Interstitial", "September",
       "4A",         "CEA1", "Interstitial",      "July",
       "4B",         "CEA3",        "80 cm",      "July",
       "4C",         "CEA4", "Interstitial",      "July",
       "4D",         "CEA1", "Interstitial",    "August",
       "4E",         "CEA3", "Interstitial",    "August",
       "4F",         "CEA5", "Interstitial",    "August",
       "4G",         "CEA2", "Interstitial", "September",
       "4H",         "CEA4", "Interstitial", "September",
       "5A",         "CEA1",        "80 cm",      "July",
       "5B",         "CEA3",        "80 cm",      "July",
       "5C",         "CEA4", "Interstitial",      "July",
       "5D",         "CEA1",        "80 cm",    "August",
       "5E",         "CEA3",        "80 cm",    "August",
       "5F",         "CEA5",        "80 cm",    "August",
       "5G",         "CEA2",        "80 cm", "September",
       "5H",         "CEA4",        "80 cm", "September",
       "6A",         "CEA1",        "80 cm",      "July",
       "6B",         "CEA3", "Interstitial",      "July",
       "6C",         "CEA5",        "80 cm",      "July",
       "6D",         "CEA1",        "80 cm",    "August",
       "6E",         "CEA3", "Interstitial",    "August",
       "6F",         "CEA5", "Interstitial",    "August",
       "6G",         "CEA2", "Interstitial", "September",
       "6H",         "CEA4", "Interstitial", "September",
       "7A",         "CEA1", "Interstitial",      "July",
       "7B",         "CEA3", "Interstitial",      "July",
       "7C",         "CEA5",        "80 cm",      "July",
       "7D",         "CEA2",        "80 cm",    "August",
       "7E",         "CEA4",        "80 cm",    "August",
       "7F",         "CEA1",        "80 cm", "September",
       "7G",         "CEA3",        "80 cm", "September",
       "7H",         "CEA5",        "80 cm", "September",
       "8A",         "CEA1", "Interstitial",      "July",
       "8B",         "CEA3",        "80 cm",      "July",
       "8C",         "CEA5", "Interstitial",      "July",
       "8D",         "CEA2",        "80 cm",    "August",
       "8E",         "CEA4",        "80 cm",    "August",
       "8F",         "CEA1",        "80 cm", "September",
       "8G",         "CEA3",        "80 cm", "September",
       "8H",         "CEA5",        "80 cm", "September",
       "9A",         "CEA2",        "80 cm",      "July",
       "9B",         "CEA3", "Interstitial",      "July",
       "9C",         "CEA5", "Interstitial",      "July",
       "9D",         "CEA2", "Interstitial",    "August",
       "9E",         "CEA4", "Interstitial",    "August",
       "9F",         "CEA1", "Interstitial", "September",
       "9G",         "CEA3", "Interstitial", "September",
       "9H",         "CEA5", "Interstitial", "September",
      "10A",         "CEA2",        "80 cm",      "July",
      "10B",         "CEA3", "Interstitial",      "July",
      "10C",         "CEA5",        "80 cm",      "July",
      "10D",         "CEA2", "Interstitial",    "August",
      "10E",         "CEA4", "Interstitial",    "August",
      "10F",         "CEA1", "Interstitial", "September",
      "10G",         "CEA3", "Interstitial", "September",
      "10H",         "CEA5", "Interstitial", "September",
      "11A",         "CEA2", "Interstitial",      "July",
      "11B",         "CEA4",        "80 cm",      "July",
      "11C",         "CEA5", "Interstitial",      "July",
      "11D",         "CEA2",        "80 cm",    "August",
      "11E",         "CEA4",        "80 cm",    "August",
      "11F",         "CEA1",        "80 cm", "September",
      "11G",         "CEA3",        "80 cm", "September",
      "11H",         "CEA5",        "80 cm", "September",
      "12A",         "CEA2", "Interstitial",      "July",
      "12B",         "CEA4",        "80 cm",      "July",
      "12C",         "CEA1", "Interstitial",    "August",
      "12D",         "CEA2", "Interstitial",    "August",
      "12E",         "CEA4", "Interstitial",    "August",
      "12F",         "CEA1", "Interstitial", "September",
      "12G",         "CEA3", "Interstitial", "September",
      "12H",         "CEA5", "Interstitial", "September"
  )
)

attach(Metadata)
rwnames <- SampleID
Metadata <- as.data.frame(Metadata[,-1])
rownames(Metadata) <- rwnames

#SUBSET DE MONTH
Jul <- subset(data, Metadata$Month == "July", select = c(`Bacteroidia`:`Un.Bacteroidetes`))
Aug <- subset(data, Metadata$Month == "August", select = c(`Bacteroidia`:`Un.Bacteroidetes`))
Sep <- subset(data, Metadata$Month == "September", select = c(`Bacteroidia`:`Un.Bacteroidetes`))

Metadata$Month <- factor(Metadata$Month,
                         levels = c("Jul", "Aug", "Sep"))

#July
Jul <- data.frame(Jul)
Jul_counts <- colSums(Jul)
Counts <- unname(Jul_counts)
Jul_counts <- data.frame(Jul_counts)
Jul_counts <- t(Jul_counts)
total <- sum(Counts)
rel_ab <- Jul_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.01]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.01]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Bacteria-total/Bacteria-total-clase_JUL_R.csv")
Jul <- read.csv("~/RSTUDIO/Bacteria-total/Bacteria-total-clase_JUL_R.csv")

#August
Aug <- data.frame(Aug)
Aug_counts <- colSums(Aug)
Counts <- unname(Aug_counts)
Aug_counts <- data.frame(Aug_counts)
Aug_counts <- t(Aug_counts)
total <- sum(Counts)
rel_ab <- Aug_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.01]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.01]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Bacteria-total/Bacteria-total-clase_AGU_R.csv")
Aug <- read.csv("~/RSTUDIO/Bacteria-total/Bacteria-total-clase_AGU_R.csv")

#September
Sep <- data.frame(Sep)
Sep_counts <- colSums(Sep)
Counts <- unname(Sep_counts)
Sep_counts <- data.frame(Sep_counts)
Sep_counts <- t(Sep_counts)
total <- sum(Counts)
rel_ab <- Sep_counts/total
Others <- rel_ab[,colMeans(rel_ab)<.01]
Others <- sum(Others)
rel_ab <- rel_ab[,colMeans(rel_ab)>=.01]
rel_ab <- data.frame(t(rel_ab), Others)
rel_ab_P <- t(rel_ab)
abundance <- c("abundance")
rel_ab_P <- data.frame(rel_ab_P)
write.csv(rel_ab_P, file = "~/RSTUDIO/Bacteria-total/Bacteria-total-clase_SEP_R.csv")
Sep <- read.csv("~/RSTUDIO/Bacteria-total/Bacteria-total-clase_SEP_R.csv")

Family_colors <- c(
  "#b988d5","#cbd588", "#88a5d5",
  "#673770","#D14285", "#652926", "#C84248", 
  "#8569D5", "#5E738F","#D1A33D", "#8A7C64", "#599861"
)


library(ggplot2)
library(scales)
#> 
#> Attaching package: 'scales'
#> The following object is masked from 'package:purrr':
#> 
#>     discard
#> The following object is masked from 'package:readr':
#> 
#>     col_factor
ggplot() +geom_bar(aes(y = rel_ab_P*100, x= "Jul", fill = X), data = Jul,
                   stat="identity", width = .5)+ geom_bar(aes(y = rel_ab_P*100, x= "Aug", fill = X), data = Aug,
                                                          stat="identity",width=.5)+
  scale_x_discrete(
    labels = c("Jul", "Aug", "Sep"), 
    drop = FALSE
  ) +
  geom_bar(aes(y = rel_ab_P*100, x= "Sep", fill = X), data = Sep,
           stat="identity", width = .5)+
  theme_classic()+
  theme(legend.title = element_blank())+
  ylab("Relative Abundance >.01% \n")+
  xlab("Month")+
  scale_fill_manual(values = Family_colors)

Created on 2020-03-04 by the reprex package (v0.3.0)

Hi @OSDIAZ,

It's better if you post a little information as necessary, so we can figure out what the essence of your question is -- the plots and extra code make it hard to understand what you're trying to do.

Here is my question again, but if it's still not clear, let's try to figure out how to answer it:

It seems that to apply your analysis, you need two tables, one a table you call 'Family', which contains bacteria counts from several samples, and a second table you call 'Metadata' which contains non-count information about the samples, like when they were taken.

Is what you want a table like your 'Family' table, but just with count data from a single month? Or rather, one table like this for each month?

A graph containing the 3 months, but only that the samples that were greater than 0.01 percent are represented. That 0.01 percent should be evaluated per month.
I want to present what I got in the bar charts, in an NMDS or PCOA.

OK, this is helpful. What do you mean by this sentence?

That 0.01 percent should be evaluated per month.

Do you mean you would like, for example, the 'July' bar to be built using only those bacteria families that represent at least 0.01 percent of the total bacteria count for July?

Yes and the 0.01 of the month of August and the 0.01 of September. Each calculation separately. Because if I get the abundance of 0.01 percent in all my samples in total (july, august, september all together), it won't match the results of BARPLOT.

So you're saying you've already taken care of doing the desired counts in the previous bar plot you shared?

Yes, if you review the script of how I did the bar chart, you will realize how I did it, but the problem is that I cannot apply it in a PCOA or NMDS.

Why not? What's the problem you encounter?

I think this will filter the data the way you want for all months at once, from here you can apply your NMDS analysis to the already filtered data.

Family %>% 
    left_join(Metadata %>% select(SampleID, Month), by = c("Index" = "SampleID")) %>% 
    gather(Microbe, count, -c(Month, Index)) %>% 
    group_by(Month, Microbe) %>% 
    summarise(count = sum(count)) %>% 
    mutate(prop = count/sum(count)) %>% 
    filter(prop > 0.0001) %>% 
    select(Month, Microbe) %>%
    ungroup() %>% 
    inner_join(Family %>% 
                   left_join(Metadata %>% select(SampleID, Month), by = c("Index" = "SampleID")) %>% 
                   gather(Microbe, count, -c(Month, Index)), by = c("Month", "Microbe")) %>% 
    spread(Microbe, count)
#> # A tibble: 63 x 7
#>    Month Index Cyanobacteriace… Microcystaceae Nodosilineaceae Nostocaceae
#>    <chr> <chr>            <dbl>          <dbl>           <dbl>       <dbl>
#>  1 Augu… 10D                  0              0               0           0
#>  2 Augu… 10E                  0              1               0           0
#>  3 Augu… 11D                  0              0               0           1
#>  4 Augu… 11E                  0              0               0           1
#>  5 Augu… 12D                 22             20               0          77
#>  6 Augu… 1D                   0              0               1           1
#>  7 Augu… 1E                   0              0               0           1
#>  8 Augu… 1F                  17              0               0           0
#>  9 Augu… 2D                   0              0               0           0
#> 10 Augu… 2E                   0              0               0           1
#> # … with 53 more rows, and 1 more variable: Phormidiaceae <dbl>

Thank you very much as always Andres, and I think this script you did could work, but I have an error that I can't figure out which one it is.

library(tidyverse)
Family <- data.frame (tibble::tribble(
                         ~index, ~Cyanobacteriaceae, ~Microcystaceae, ~Nostocaceae, ~Phormidiaceae, ~Un.Nostocales, ~Nodosilineaceae, ~Cyanobiaceae,
                           "1A",        1.342953283,               0,            0,              0,              0,      1.342953283,   1.342953283,
                           "1C",        1.966304234,               0,            0,    2.768780582,              0,      1.966304234,   1.966304234,
                           "1D",                  0,               0,   1.80374141,              0,              0,       1.80374141,             0,
                           "1E",        1.492119211,               0,  1.492119211,              0,              0,                0,             0,
                           "1F",        0.597623166,               0,            0,              0,              0,                0,   3.281663426,
                           "1G",        1.319782597,               0,            0,              0,              0,                0,   1.997317628,
                           "1H",        0.859080227,      6.52598632,  0.859080227,    8.893280073,              0,      0.859080227,             0,
                           "2A",                  0,               0,  1.907218755,              0,              0,      1.907218755,   2.700818357,
                           "2B",        0.793958833,               0,            0,    4.737897517,              0,      0.793958833,   4.477738447,
                           "2C",                  0,     2.023336602,            0,              0,              0,      2.023336602,             0,
                           "2D",        0.859080227,               0,            0,              0,              0,                0,             0,
                           "2E",                  0,               0,  2.333056481,              0,              0,                0,             0,
                           "2F",                  0,     4.129704923,            0,    2.700818357,              0,                0,   2.700818357,
                           "2H",                  0,               0,  2.333056481,    3.182284592,              0,                0,   3.109141214,
                           "3A",                  0,               0,  2.970554964,    3.875461024,              0,                0,             0,
                           "3B",                  0,               0,  4.592839043,    1.776680722,              0,      1.342953283,             0,
                           "4A",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "4B",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "4E",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "4G",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "4H",                  0,     1.438454518,   3.33936827,    4.084305359,              0,                0,   3.166943116,
                           "5E",                  0,               0,            0,    4.594402317,              0,                0,             0,
                           "5F",                  0,     2.830692732,            0,    2.830692732,              0,                0,   4.980518137,
                           "5G",                  0,     2.063562226,            0,    5.508504867,              0,                0,             0,
                           "6A",                  0,               0,  2.333056481,              0,              0,                0,             0,
                           "6F",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "6H",                  0,     3.346178301,            0,    4.426691417,              0,                0,   2.700818357,
                           "7D",                  0,               0,            0,    6.512533918,              0,                0,   1.269588905,
                           "7F",                  0,     2.222744018,            0,    8.949300455,              0,                0,   2.700818357,
                           "7G",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "8A",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "8B",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "8C",                  0,               0,            0,    4.594402317,              0,                0,             0,
                           "8D",                  0,     2.830692732,            0,              0,              0,                0,             0,
                           "8E",                  0,               0,            0,    4.594402317,              0,      2.211808746,   0.540096358,
                           "8G",                  0,     3.025690271,  2.155958054,    5.117757061,              0,                0,    1.85267301,
                           "8H",                  0,     3.623754759,            0,    3.132102104,              0,                0,   2.700818357,
                           "9A",                  0,               0,   1.80374141,              0,              0,       1.80374141,             0,
                           "9B",                  0,               0,   1.80374141,              0,              0,       1.80374141,             0,
                           "9D",                  0,               0,  2.333056481,              0,              0,                0,             0,
                           "9E",                  0,               0,            0,    4.594402317,              0,                0,             0,
                           "9F",                  0,     1.006965294,  2.333056481,              0,              0,                0,   4.057452791,
                           "9G",                  0,               0,            0,              0,              0,                0,   2.700818357,
                           "9H",                  0,     2.830692732,   6.06602299,    5.614066274,     0.67213822,      0.751332527,             0,
                          "10A",                  0,               0,  0.874433896,              0,              0,                0,   4.790002243,
                          "10B",                  0,               0,            0,    2.006007898,              0,                0,    5.43408408,
                          "10D",                  0,               0,            0,    4.594402317,              0,                0,             0,
                          "10E",                  0,     2.830692732,            0,              0,              0,                0,             0,
                          "10F",                  0,               0,            0,              0,              0,                0,   2.700818357,
                          "10G",                  0,     1.526777458,            0,    6.252790297,              0,                0,             0,
                          "10H",                  0,     2.078731551,            0,              0,    2.078731551,                0,             0,
                          "11A",                  0,               0,   1.80374141,              0,              0,       1.80374141,             0,
                          "11B",                  0,               0,  1.856218562,              0,    1.856218562,                0,             0,
                          "11C",                  0,               0,  2.333056481,              0,              0,                0,             0,
                          "11D",                  0,               0,  2.333056481,              0,              0,                0,             0,
                          "11E",                  0,               0,  2.333056481,              0,              0,                0,             0,
                          "11F",                  0,               0,            0,    4.594402317,              0,                0,             0,
                          "11G",                  0,               0,            0,    4.594402317,              0,                0,             0,
                          "11H",                  0,               0,            0,    4.594402317,              0,                0,             0,
                          "12D",                  0,     2.321050311,  4.034593529,    4.905829872,              0,                0,   2.432065363,
                          "12F",                  0,               0,            0,              0,              0,                0,   2.700818357,
                          "12G",                  0,     2.830692732,  0.238576719,    4.787357446,              0,                0,             0,
                          "12H",                  0,     3.439569902,  4.295309968,    3.942523079,              0,                0,    1.51774825
                         )
)
attach(Family)
Family <- Family[,-1]
rownames(Family) <- index

Metadata<- data.frame (tibble::tribble(
                          ~SampleID, ~SamplingPoint,         ~Depth,      ~Month,
                               "1A",         "CEA1",        "80 cm",      "July",
                               "1C",         "CEA4", "Interstitial",      "July",
                               "1D",         "CEA1",        "80 cm",    "August",
                               "1E",         "CEA3",        "80 cm",    "August",
                               "1F",         "CEA5",        "80 cm",    "August",
                               "1G",         "CEA2",        "80 cm", "September",
                               "1H",         "CEA4",        "80 cm", "September",
                               "2A",         "CEA1",        "80 cm",      "July",
                               "2B",         "CEA2", "Interstitial",      "July",
                               "2C",         "CEA4", "Interstitial",      "July",
                               "2D",         "CEA1",        "80 cm",    "August",
                               "2E",         "CEA3",        "80 cm",    "August",
                               "2F",         "CEA5",        "80 cm",    "August",
                               "2H",         "CEA4",        "80 cm", "September",
                               "3A",         "CEA1", "Interstitial",      "July",
                               "3B",         "CEA2", "Interstitial",      "July",
                               "4A",         "CEA1", "Interstitial",      "July",
                               "4B",         "CEA3",        "80 cm",      "July",
                               "4E",         "CEA3", "Interstitial",    "August",
                               "4G",         "CEA2", "Interstitial", "September",
                               "4H",         "CEA4", "Interstitial", "September",
                               "5E",         "CEA3",        "80 cm",    "August",
                               "5F",         "CEA5",        "80 cm",    "August",
                               "5G",         "CEA2",        "80 cm", "September",
                               "6A",         "CEA1",        "80 cm",      "July",
                               "6F",         "CEA5", "Interstitial",    "August",
                               "6H",         "CEA4", "Interstitial", "September",
                               "7D",         "CEA2",        "80 cm",    "August",
                               "7F",         "CEA1",        "80 cm", "September",
                               "7G",         "CEA3",        "80 cm", "September",
                               "8A",         "CEA1", "Interstitial",      "July",
                               "8B",         "CEA3",        "80 cm",      "July",
                               "8C",         "CEA5", "Interstitial",      "July",
                               "8D",         "CEA2",        "80 cm",    "August",
                               "8E",         "CEA4",        "80 cm",    "August",
                               "8G",         "CEA3",        "80 cm", "September",
                               "8H",         "CEA5",        "80 cm", "September",
                               "9A",         "CEA2",        "80 cm",      "July",
                               "9B",         "CEA3", "Interstitial",      "July",
                               "9D",         "CEA2", "Interstitial",    "August",
                               "9E",         "CEA4", "Interstitial",    "August",
                               "9F",         "CEA1", "Interstitial", "September",
                               "9G",         "CEA3", "Interstitial", "September",
                               "9H",         "CEA5", "Interstitial", "September",
                              "10A",         "CEA2",        "80 cm",      "July",
                              "10B",         "CEA3", "Interstitial",      "July",
                              "10D",         "CEA2", "Interstitial",    "August",
                              "10E",         "CEA4", "Interstitial",    "August",
                              "10F",         "CEA1", "Interstitial", "September",
                              "10G",         "CEA3", "Interstitial", "September",
                              "10H",         "CEA5", "Interstitial", "September",
                              "11A",         "CEA2", "Interstitial",      "July",
                              "11B",         "CEA4",        "80 cm",      "July",
                              "11C",         "CEA5", "Interstitial",      "July",
                              "11D",         "CEA2",        "80 cm",    "August",
                              "11E",         "CEA4",        "80 cm",    "August",
                              "11F",         "CEA1",        "80 cm", "September",
                              "11G",         "CEA3",        "80 cm", "September",
                              "11H",         "CEA5",        "80 cm", "September",
                              "12D",         "CEA2", "Interstitial",    "August",
                              "12F",         "CEA1", "Interstitial", "September",
                              "12G",         "CEA3", "Interstitial", "September",
                              "12H",         "CEA5", "Interstitial", "September"
                          )
)



attach(Metadata)
rwnames <- SampleID
Metadata <- as.data.frame(Metadata[,-1])
rownames(Metadata) <- rwnames

Family %>% 
  left_join(Metadata %>% select(SampleID, Month), by = c("Index" = "SampleID")) %>% 
  gather(Microbe, count, -c(Month, Index)) %>% 
  group_by(Month, Microbe) %>% 
  summarise(count = sum(count)) %>% 
  mutate(prop = count/sum(count)) %>% 
  filter(prop > 0.0001) %>% 
  select(Month, Microbe) %>%
  ungroup() %>% 
  inner_join(Family %>% 
               left_join(Metadata %>% select(SampleID, Month), by = c("Index" = "SampleID")) %>% 
               gather(Microbe, count, -c(Month, Index)), by = c("Month", "Microbe")) %>% 
  spread(Microbe, count)
#> Unknown columns `1A`, `1C`, `1D`, `1E`, `1F` and ...


Metadata$Month <- factor(Metadata$Month,
                         levels = c("July", "August", "September"))
library(vegan)
#> Loading required package: permute
#> Loading required package: lattice
#> This is vegan 2.5-5
#NMDS
Family.mds <- metaMDS(Family, k=2, distance="bray", trymax=100, zerodist="add", autotransform=F)
#> Error in metaMDS(Family, k = 2, distance = "bray", trymax = 100, zerodist = "add", : objeto 'Family' no encontrado
stressplot(Family.mds)
#> Error in stressplot(Family.mds): objeto 'Family.mds' no encontrado
colvec<- c("yellowgreen","turquoise4", "tomato2")
plot(Family.mds, type="n", xlim=c(-.5,.5), ylim=c(-0.6,0.6))
#> Error in plot(Family.mds, type = "n", xlim = c(-0.5, 0.5), ylim = c(-0.6, : objeto 'Family.mds' no encontrado
pl <-ordiellipse(Family.mds, Metadata$Month, kind="se", conf=0.95, lwd=2, col="gray30", label=T)
#> Error in scores(ord, display = display, ...): objeto 'Family.mds' no encontrado

#plot with ggplot
data.scores <- as.data.frame(scores(Family.mds))
#> Error in scores(Family.mds): objeto 'Family.mds' no encontrado
data.scores$site <- rownames(data.scores)
#> Error in rownames(data.scores): objeto 'data.scores' no encontrado
data.scores$grp <- Metadata$Month
#> Error in eval(expr, envir, enclos): objeto 'Metadata' no encontrado
head(data.scores)
#> Error in head(data.scores): objeto 'data.scores' no encontrado
library(ggplot2)
NMDS <-  data.frame(MDS1 = Family.mds$points[,1], MDS2 = Family.mds$points[,2],group=Metadata$Month)
#> Error in data.frame(MDS1 = Family.mds$points[, 1], MDS2 = Family.mds$points[, : objeto 'Family.mds' no encontrado
#NMDS.mean <- aggregate(NMDS[,1:2],list(group=group),mean)
veganCovEllipse<-function (cov, center = c(0, 0), scale = 1, npoints = 100) 
{
  theta <- (0:npoints) * 2 * pi/npoints
  Circle <- cbind(cos(theta), sin(theta))
  t(center + scale * t(Circle %*% chol(cov)))
}
#attach(NMDS.mean)
df_ell <- data.frame()
for(g in levels(NMDS$group)){
  df_ell <- rbind(df_ell, cbind(as.data.frame(with(NMDS[NMDS$group==g,],
                                                   veganCovEllipse(pl[[g]]$cov,pl[[g]]$center,pl[[g]]$scale)))
                                ,group=g))
}
#> Error in levels(NMDS$group): objeto 'NMDS' no encontrado


ggplot() + 
  geom_path(data=df_ell, aes(x=NMDS1, y=NMDS2,colour=group), size=1, linetype=2)+
  geom_point(data=data.scores,aes(x=NMDS1,y=NMDS2,colour=grp),size=1.5) + # add the point markers
  theme(legend.title = element_blank()) +
  ylab("NMDS2")+
  xlab("NMDS1")+
  #geom_text(data=data.scores,aes(x=NMDS1,y=NMDS2,label=site),size=6,vjust=0) + 
  scale_colour_manual(values=c("July" = "yellowgreen", "August" = "turquoise4", "September" = "deeppink3"))
#> Error in fortify(data): objeto 'data.scores' no encontrado

Created on 2020-03-05 by the reprex package (v0.3.0)

Created on 2020-03-05 by the reprex package (v0.3.0)

With this steps you are eliminating the joining key, if you need to use row names assign them after the joint.

In general there is little value posting a page full of different errors. Errors will cascade, one error causing the next. Target the first error, toward the top of your code. In your second script you have an error because you rely on your first script to make Family. This does not exist for your second script. Reprexs are independent