Does anyone know how to fix this error?
Error in filter()
:
Problem while computing ..1 = rowname %in% colnames(metadata)
.
Caused by error in rowname %in% colnames(metadata)
:
! objeto 'rowname' no encontrado
Thank u in advance
This error was generated after I updated my R to the latest version.4.1.2
library(tidyverse)
library(corrplot)
#> corrplot 0.92 loaded
library(corrr)
library(rlang)
#>
#> Attaching package: 'rlang'
#> The following objects are masked from 'package:purrr':
#>
#> %@%, as_function, flatten, flatten_chr, flatten_dbl, flatten_int,
#> flatten_lgl, flatten_raw, invoke, splice
library(purrr)
metadata <- data.frame (tibble::tribble(
~SampleID, ~Dissolved.oxygen, ~pH, ~Water.temperature, ~Turbidity, ~ORP, ~Ammonium, ~Nitrates, ~`Blue-Green.Algae`, ~Chlrophyll, ~TN, ~TP, ~CE, ~Air.temperature, ~Evaporation, ~Precipitation,
"1A", 4.24, 9.94, 24.48, 87.3, 97, 4.46, 3.6, 279133L, 36.6, 10.74, 1.62, 1.074, 13.95, 4.34, 2.55,
"1B", 2.58, 10.06, 24.95, 95.2, 108.4, 4.62, 3.98, 279113L, 38.9, 11.82, 1.45, 1.082, 13.95, 4.34, 2.55,
"1C", 2.85, 9.98, 24.01, 98.8, 102.9, 4.37, 3.57, 265304L, 40, 13.37, 1.47, 1.081, 13.95, 4.34, 2.55,
"1D", 3.81, 9.07, 26.67, 24.9, 94, 5.6, 3.53, 11603L, 44, 14.56, 1.87, 1.147, 17.11, 5.8, 4.54,
"1E", 2.64, 8.99, 24.01, 43.1, 63.9, 3.38, 2.55, 218471L, 35, 16.56, 1.27, 1.156, 17.11, 5.8, 4.54,
"1F", 4.61, 8.93, 23.5, 49.1, 64.7, 3.21, 2.28, 226658L, 32.8, 12.57, 1.38, 1.157, 17.11, 5.8, 4.54,
"1G", 5.74, 9.24, 24.46, 68.6, 40.3, 1.93, 0.71, 267389L, 44, 9.94, 1.43, 1.155, 17.9, 6.86, 6.88,
"1H", 3.69, 9.32, 24.65, 69.8, 48.1, 2.21, 1.2, 267144L, 44.8, 10.62, 1.34, 1.152, 17.9, 6.86, 6.88,
"2A", 4.24, 9.94, 24.48, 87.3, 97, 4.46, 3.6, 279133L, 36.6, 10.74, 1.62, 1.074, 13.95, 4.34, 2.55,
"2B", 2.66, 10, 24.92, 113, 111.9, 4.75, 3.21, 270193L, 39.8, 11.82, 1.45, 1.081, 13.95, 4.34, 2.55,
"2C", 2.85, 9.98, 24.01, 98.8, 102.9, 4.37, 3.57, 265304L, 40, 13.37, 1.47, 1.081, 13.95, 4.34, 2.55,
"2D", 3.81, 9.07, 26.67, 24.9, 94, 5.6, 3.53, 11603L, 44, 14.56, 1.87, 1.147, 17.11, 5.8, 4.54,
"2E", 2.64, 8.99, 24.01, 43.1, 63.9, 3.38, 2.55, 218471L, 35, 16.56, 1.27, 1.156, 17.11, 5.8, 4.54,
"2F", 4.61, 8.93, 23.5, 49.1, 64.7, 3.21, 2.28, 226658L, 32.8, 12.57, 1.38, 1.157, 17.11, 5.8, 4.54,
"2G", 5.74, 9.24, 24.46, 68.6, 40.3, 1.93, 0.71, 267389L, 44, 9.94, 1.43, 1.155, 17.9, 6.86, 6.88,
"2H", 3.69, 9.32, 24.65, 69.8, 48.1, 2.21, 1.2, 267144L, 44.8, 10.62, 1.34, 1.152, 17.9, 6.86, 6.88,
"3A", 2.51, 10.04, 24.35, 87.7, 91.3, 4.5, 3.36, 267716L, 39.6, 10.74, 1.62, 1.075, 13.95, 4.34, 2.55,
"3B", 2.66, 10, 24.92, 113, 111.9, 4.75, 3.21, 270193L, 39.8, 11.82, 1.45, 1.081, 13.95, 4.34, 2.55,
"3C", 3.14, 10, 24, 96.9, 108, 4.48, 3.76, 279119L, 38.5, 13.37, 1.47, 1.08, 13.95, 4.34, 2.55,
"3D", 2.92, 9.06, 26.46, 39.7, 23.7, 7.64, 3.66, 66608L, 45.1, 14.56, 1.87, 1.138, 17.11, 5.8, 4.54,
"3E", 1.83, 8.99, 23.99, 49, 64.1, 3.18, 2.44, 213497L, 42.2, 16.56, 1.27, 1.155, 17.11, 5.8, 4.54,
"3F", 1.82, 8.92, 23.43, 47.6, 60.4, 3.09, 2.06, 242331L, 50.2, 12.57, 1.38, 1.157, 17.11, 5.8, 4.54,
"3G", 3.02, 9.18, 24.14, 66.6, 40.6, 2.19, 0.67, 267007L, 43.6, 9.94, 1.43, 1.51, 17.9, 6.86, 6.88,
"3H", 3.3, 9.32, 24.67, 74.1, 49.8, 2.14, 0.87, 261363L, 45.1, 10.62, 1.34, 1.142, 17.9, 6.86, 6.88,
"4A", 2.51, 10.04, 24.35, 87.7, 91.3, 4.5, 3.36, 267716L, 39.6, 10.74, 1.62, 1.075, 13.95, 4.34, 2.55,
"4B", 3.04, 9.96, 24.04, 98.5, 98.9, 3.97, 4.35, 279109L, 43, 10.91, 1.48, 1.083, 13.95, 4.34, 2.55,
"4C", 2.85, 9.98, 24.01, 98.8, 102.9, 4.37, 3.57, 265304L, 40, 13.37, 1.47, 1.081, 13.95, 4.34, 2.55,
"4D", 2.92, 9.06, 26.46, 39.7, 23.7, 7.64, 3.66, 66608L, 45.1, 14.56, 1.87, 1.138, 17.11, 5.8, 4.54,
"4E", 1.83, 8.99, 23.99, 49, 64.1, 3.18, 2.44, 213497L, 42.2, 16.56, 1.27, 1.155, 17.11, 5.8, 4.54,
"4F", 1.82, 8.92, 23.43, 47.6, 60.4, 3.09, 2.06, 242331L, 50.2, 12.57, 1.38, 1.157, 17.11, 5.8, 4.54,
"4G", 3.02, 9.18, 24.14, 66.6, 40.6, 2.19, 0.67, 267007L, 43.6, 9.94, 1.43, 1.51, 17.9, 6.86, 6.88,
"4H", 3.3, 9.32, 24.67, 74.1, 49.8, 2.14, 0.87, 261363L, 45.1, 10.62, 1.34, 1.142, 17.9, 6.86, 6.88,
"5A", 4.24, 9.94, 24.48, 87.3, 97, 4.46, 3.6, 279133L, 36.6, 10.74, 1.62, 1.074, 13.95, 4.34, 2.55,
"5B", 3.04, 9.96, 24.04, 98.5, 98.9, 3.97, 4.35, 279109L, 43, 10.91, 1.48, 1.083, 13.95, 4.34, 2.55,
"5C", 2.85, 9.98, 24.01, 98.8, 102.9, 4.37, 3.57, 265304L, 40, 13.37, 1.47, 1.081, 13.95, 4.34, 2.55,
"5D", 3.81, 9.07, 26.67, 24.9, 94, 5.6, 3.53, 11603L, 44, 14.56, 1.87, 1.147, 17.11, 5.8, 4.54,
"5E", 2.64, 8.99, 24.01, 43.1, 63.9, 3.38, 2.55, 218471L, 35, 16.56, 1.27, 1.156, 17.11, 5.8, 4.54,
"5F", 4.61, 8.93, 23.5, 49.1, 64.7, 3.21, 2.28, 226658L, 32.8, 12.57, 1.38, 1.157, 17.11, 5.8, 4.54,
"5G", 5.74, 9.24, 24.46, 68.6, 40.3, 1.93, 0.71, 267389L, 44, 9.94, 1.43, 1.155, 17.9, 6.86, 6.88,
"5H", 3.69, 9.32, 24.65, 69.8, 48.1, 2.21, 1.2, 267144L, 44.8, 10.62, 1.34, 1.152, 17.9, 6.86, 6.88,
"6A", 4.24, 9.94, 24.48, 87.3, 97, 4.46, 3.6, 279133L, 36.6, 10.74, 1.62, 1.074, 13.95, 4.34, 2.55,
"6B", 2.09, 9.95, 24.01, 95.9, 92.8, 4.06, 3.68, 279100L, 50, 10.91, 1.48, 1.081, 13.95, 4.34, 2.55,
"6C", 2.98, 10.09, 24.36, 97.2, 106.9, 4.43, 3.34, 279099L, 43, 10.39, 1.49, 1.077, 13.95, 4.34, 2.55,
"6D", 3.81, 9.07, 26.67, 24.9, 94, 5.6, 3.53, 11603L, 44, 14.56, 1.87, 1.147, 17.11, 5.8, 4.54,
"6E", 1.83, 8.99, 23.99, 49, 64.1, 3.18, 2.44, 213497L, 42.2, 16.56, 1.27, 1.155, 17.11, 5.8, 4.54,
"6F", 1.82, 8.92, 23.43, 47.6, 60.4, 3.09, 2.06, 242331L, 50.2, 12.57, 1.38, 1.157, 17.11, 5.8, 4.54,
"6G", 3.02, 9.18, 24.14, 66.6, 40.6, 2.19, 0.67, 267007L, 43.6, 9.94, 1.43, 1.51, 17.9, 6.86, 6.88,
"6H", 3.3, 9.32, 24.67, 74.1, 49.8, 2.14, 0.87, 261363L, 45.1, 10.62, 1.34, 1.142, 17.9, 6.86, 6.88,
"7A", 2.51, 10.04, 24.35, 87.7, 91.3, 4.5, 3.36, 267716L, 39.6, 10.74, 1.62, 1.075, 13.95, 4.34, 2.55,
"7B", 2.09, 9.95, 24.01, 95.9, 92.8, 4.06, 3.68, 279100L, 50, 10.91, 1.48, 1.081, 13.95, 4.34, 2.55,
"7C", 2.98, 10.09, 24.36, 97.2, 106.9, 4.43, 3.34, 279099L, 43, 10.39, 1.49, 1.077, 13.95, 4.34, 2.55,
"7D", 8.17, 9.04, 24.88, 46.9, 90.4, 2.81, 2.25, 246979L, 34, 9.68, 1.34, 1.154, 17.11, 5.8, 4.54,
"7E", 2.63, 9, 24.7, 37.2, 74.9, 4.2, 2.99, 169175L, 38.4, 10.74, 1.67, 1.179, 17.11, 5.8, 4.54,
"7F", 7.69, 9.53, 26.14, 74.2, 67.7, 4.5, 1.3, 272332L, 58.5, 10.39, 1.59, 1.072, 17.9, 6.86, 6.88,
"7G", 3.07, 9.31, 24.19, 69.9, 42, 1.99, 0.74, 269519L, 44.3, 9.2, 1.32, 1.152, 17.9, 6.86, 6.88,
"7H", 3.7, 9.14, 22.65, 71.3, 37.1, 2.07, 0.68, 272096L, 40, 9.08, 1.38, 1.127, 17.9, 6.86, 6.88,
"8A", 2.51, 10.04, 24.35, 87.7, 91.3, 4.5, 3.36, 267716L, 39.6, 10.74, 1.62, 1.075, 13.95, 4.34, 2.55,
"8B", 3.04, 9.96, 24.04, 98.5, 98.9, 3.97, 4.35, 279109L, 43, 10.91, 1.48, 1.083, 13.95, 4.34, 2.55,
"8C", 2.18, 9.97, 24.4, 100.6, 102.7, 5.47, 4.11, 278137L, 53.8, 10.39, 1.49, 1.078, 13.95, 4.34, 2.55,
"8D", 8.17, 9.04, 24.88, 46.9, 90.4, 2.81, 2.25, 246979L, 34, 9.68, 1.34, 1.154, 17.11, 5.8, 4.54,
"8E", 2.63, 9, 24.7, 37.2, 74.9, 4.2, 2.99, 169175L, 38.4, 10.74, 1.67, 1.179, 17.11, 5.8, 4.54,
"8F", 7.69, 9.53, 26.14, 74.2, 67.7, 4.5, 1.3, 272332L, 58.5, 10.39, 1.59, 1.072, 17.9, 6.86, 6.88,
"8G", 3.07, 9.31, 24.19, 69.9, 42, 1.99, 0.74, 269519L, 44.3, 9.2, 1.32, 1.152, 17.9, 6.86, 6.88,
"8H", 3.7, 9.14, 22.65, 71.3, 37.1, 2.07, 0.68, 272096L, 40, 9.08, 1.38, 1.127, 17.9, 6.86, 6.88,
"9A", 2.58, 10.06, 24.95, 95.2, 108.4, 4.62, 3.98, 279113L, 38.9, 11.82, 1.45, 1.082, 13.95, 4.34, 2.55,
"9B", 2.09, 9.95, 24.01, 95.9, 92.8, 4.06, 3.68, 279100L, 50, 10.91, 1.48, 1.081, 13.95, 4.34, 2.55,
"9C", 2.18, 9.97, 24.4, 100.6, 102.7, 5.47, 4.11, 278137L, 53.8, 10.39, 1.49, 1.078, 13.95, 4.34, 2.55,
"9D", 2.16, 8.96, 24.3, 42, 53, 3.19, 2.1, 174271L, 50.3, 9.68, 1.34, 1.161, 17.11, 5.8, 4.54,
"9E", 1.7, 9.02, 24.72, 36.1, 63.4, 3.97, 2.55, 159046L, 55.9, 10.74, 1.67, 1.69, 17.11, 5.8, 4.54,
"9F", 6.8, 9.51, 26.15, 74.4, 73.9, 3.3, 1.11, 271503L, 51.3, 10.39, 1.59, 1.061, 17.9, 6.86, 6.88,
"9G", 1.95, 9.39, 23.9, 44.4, 42, 3.38, 0.69, 261124L, 68.2, 9.2, 1.32, 1.168, 17.9, 6.86, 6.88,
"9H", 4.28, 8.85, 20.65, 71.3, 37.5, 1.18, 0.69, 271303L, 34.2, 9.08, 1.38, 1.102, 17.9, 6.86, 6.88,
"10A", 2.58, 10.06, 24.95, 95.2, 108.4, 4.62, 3.98, 279113L, 38.9, 11.82, 1.45, 1.082, 13.95, 4.34, 2.55,
"10B", 2.09, 9.95, 24.01, 95.9, 92.8, 4.06, 3.68, 279100L, 50, 10.91, 1.48, 1.081, 13.95, 4.34, 2.55,
"10C", 2.98, 10.09, 24.36, 97.2, 106.9, 4.43, 3.34, 279099L, 43, 10.39, 1.49, 1.077, 13.95, 4.34, 2.55,
"10D", 2.16, 8.96, 24.3, 42, 53, 3.19, 2.1, 174271L, 50.3, 9.68, 1.34, 1.161, 17.11, 5.8, 4.54,
"10E", 1.7, 9.02, 24.72, 36.1, 63.4, 3.97, 2.55, 159046L, 55.9, 10.74, 1.67, 1.69, 17.11, 5.8, 4.54,
"10F", 6.8, 9.51, 26.15, 74.4, 73.9, 3.3, 1.11, 271503L, 51.3, 10.39, 1.59, 1.061, 17.9, 6.86, 6.88,
"10G", 1.95, 9.39, 23.9, 44.4, 42, 3.38, 0.69, 261124L, 68.2, 9.2, 1.32, 1.168, 17.9, 6.86, 6.88,
"10H", 4.28, 8.85, 20.65, 71.3, 37.5, 1.18, 0.69, 271303L, 34.2, 9.08, 1.38, 1.102, 17.9, 6.86, 6.88,
"11A", 2.66, 10, 24.92, 113, 111.9, 4.75, 3.21, 270193L, 39.8, 11.82, 1.45, 1.081, 13.95, 4.34, 2.55,
"11B", 3.14, 10, 24, 96.9, 108, 4.48, 3.76, 279119L, 38.5, 13.37, 1.47, 1.08, 13.95, 4.34, 2.55,
"11C", 2.18, 9.97, 24.4, 100.6, 102.7, 5.47, 4.11, 278137L, 53.8, 10.39, 1.49, 1.078, 13.95, 4.34, 2.55,
"11D", 8.17, 9.04, 24.88, 46.9, 90.4, 2.81, 2.25, 246979L, 34, 9.68, 1.34, 1.154, 17.11, 5.8, 4.54,
"11E", 2.63, 9, 24.7, 37.2, 74.9, 4.2, 2.99, 169175L, 38.4, 10.74, 1.67, 1.179, 17.11, 5.8, 4.54,
"11F", 7.69, 9.53, 26.14, 74.2, 67.7, 4.5, 1.3, 272332L, 58.5, 10.39, 1.59, 1.072, 17.9, 6.86, 6.88,
)
)
bacteria <- data.frame (tibble::tribble(
~index, ~Flavobacterium, ~Pseudomonas, ~Un.Oxyphotobacteria, ~Un.Cyanobacteria,
"1A", 5085L, 13320L, 7137L, 1467L,
"1B", 4477L, 3634L, 5549L, 238L,
"1C", 389L, 179L, 1861L, 708L,
"1D", 1123L, 10484L, 3185L, 4001L,
"1E", 684L, 2449L, 7468L, 1928L,
"1F", 5928L, 568L, 18421L, 4460L,
"1G", 2934L, 169L, 4191L, 361L,
"1H", 9780L, 8066L, 12240L, 1970L,
"2A", 12229L, 326L, 20728L, 4350L,
"2B", 7977L, 578L, 13438L, 3076L,
"2C", 14624L, 808L, 17664L, 2008L,
"2D", 1747L, 3878L, 5085L, 2745L,
"2E", 5684L, 6987L, 8376L, 1613L,
"2F", 6915L, 3560L, 8906L, 983L,
"2G", 10096L, 2769L, 13273L, 1514L,
"2H", 12027L, 962L, 18506L, 3531L,
"3A", 1735L, 1071L, 7959L, 1700L,
"3B", 76L, 16L, 762L, 367L,
"3C", 2433L, 682L, 3088L, 45L,
"3D", 1934L, 2055L, 3009L, 1683L,
"3E", 2251L, 1592L, 4120L, 754L,
"3F", 2419L, 1026L, 5083L, 675L,
"3G", 2165L, 355L, 5573L, 1031L,
"3H", 481L, 762L, 473L, 0L,
"4A", 2031L, 1698L, 24267L, 9707L,
"4B", 12920L, 665L, 16403L, 3105L,
"4C", 5153L, 171L, 6043L, 570L,
"4D", 4511L, 1198L, 8472L, 2357L,
"4E", 2571L, 711L, 8351L, 2424L,
"4F", 156L, 131L, 491L, 570L,
"4G", 7938L, 7290L, 13031L, 3066L,
"4H", 20935L, 37192L, 33094L, 6509L,
"5A", 4715L, 8651L, 11083L, 4240L,
"5B", 814L, 1257L, 4248L, 676L,
"5C", 104L, 2660L, 363L, 222L,
"5D", 7422L, 2059L, 8839L, 1176L,
"5E", 7242L, 2484L, 10286L, 213L,
"5F", 10170L, 11940L, 14778L, 1765L,
"5G", 47L, 9398L, 3584L, 1574L,
"5H", 5994L, 6180L, 10905L, 7012L,
"6A", 13069L, 2711L, 22140L, 5237L,
"6B", 18646L, 5370L, 22958L, 3646L,
"6C", 3626L, 221L, 5937L, 1510L,
"6D", 7204L, 2521L, 8240L, 900L,
"6E", 1437L, 680L, 6252L, 1583L,
"6F", 8190L, 582L, 15494L, 3392L,
"6G", 1502L, 1177L, 9631L, 5514L,
"6H", 30576L, 13999L, 40839L, 7004L,
"7A", 4045L, 24509L, 7201L, 4795L,
"7B", 1241L, 183L, 2146L, 732L,
"7C", 3354L, 840L, 3927L, 450L,
"7D", 19627L, 2357L, 26197L, 1932L,
"7E", 11668L, 11463L, 17161L, 4310L,
"7F", 8090L, 18604L, 14640L, 293L,
"7G", 54L, 1993L, 1888L, 1837L,
"7H", 1092L, 1990L, 2860L, 2943L,
"8A", 12086L, 3803L, 18949L, 3364L,
"8B", 19097L, 4718L, 30505L, 6066L,
"8C", 9162L, 394L, 10406L, 572L,
"8D", 2941L, 1088L, 14814L, 8608L,
"8E", 895L, 4012L, 7553L, 2455L,
"8F", 14441L, 15757L, 24075L, 3692L,
"8G", 287L, 20914L, 7788L, 4399L,
"8H", 12554L, 23247L, 16103L, 3045L,
"9A", 786L, 1514L, 3794L, 1919L,
"9B", 3099L, 3638L, 8916L, 1307L,
"9C", 1612L, 2258L, 2817L, 1041L,
"9D", 4176L, 2200L, 17692L, 8381L,
"9E", 15867L, 33854L, 20302L, 2008L,
"9F", 41028L, 3951L, 48687L, 5115L,
"9G", 670L, 2702L, 14834L, 2512L,
"9H", 1148L, 425L, 4402L, 1391L,
"10A", 9700L, 631L, 14300L, 3054L,
"10B", 13788L, 597L, 15485L, 1203L,
"10C", 1434L, 1455L, 2695L, 1719L,
"10D", 9608L, 2391L, 13401L, 342L,
"10E", 5689L, 1251L, 9052L, 2779L,
"10F", 10267L, 376L, 13282L, 743L,
"10G", 1442L, 3148L, 2492L, 939L,
"10H", 2510L, 2078L, 2924L, 700L,
"11A", 53L, 702L, 317L, 1532L,
"11B", 771L, 416L, 968L, 702L,
"11C", 2700L, 7239L, 4148L, 2733L,
"11D", 2119L, 393L, 10756L, 4030L,
"11E", 7484L, 2496L, 10605L, 1595L,
"11F", 3407L, 1597L, 4327L, 390L,
)
)
metadata <- metadata[,-1]
bacteria <- bacteria[,-1]
library(RColorBrewer)
#cor.vals = cor(metadata)
#cor.p = cor.mtest(metadata, conf.level = 0.95)$p
#rownames(cor.p) = rownames(cor.vals)
#colnames(cor.p) = colnames(cor.vals)
#res1 <- cor.mtest(metadata, conf.level = 0.95)$p
#res2 <- cor.mtest(bacteria, conf.level = 0.95)$p
#summary(res1, loadings=TRUE)
#p.mat = res1$p, insig= "blank", sig.level = 0.05
corrr::correlate(bind_cols(metadata[, -1], bacteria[, -1])) %>%
filter(rowname %in% colnames(metadata)) %>%
select(one_of(c("rowname", colnames(bacteria)[-1]))) %>%
as.data.frame() %>%
column_to_rownames("rowname") %>%
as.matrix() %>%
corrplot::corrplot(is.corr = FALSE, method = "number",p.mat = res1$p, insig= "blank", sig.level = 0.05, tl.col = "black", tl.srt = 45,
col= brewer.pal (n=10, name= "PuOr"))
#>
#> Correlation method: 'pearson'
#> Missing treated using: 'pairwise.complete.obs'
#> Error in `filter()`:
#> ! Problem while computing `..1 = rowname %in% colnames(metadata)`.
#> Caused by error in `rowname %in% colnames(metadata)`:
#> ! objeto 'rowname' no encontrado
Created on 2022-03-10 by the reprex package (v2.0.1)