Spatial variation of physicochemical parameters in a constructed wetland for wastewater treatment: An example of the use of the R programming language


Pennisetum alopecuroides
oxidation-reduction potential
dissolved oxygen
Artificial Wetland System of superficial Flow

How to Cite

Pérez-Molina, J. P., Scholz, C., Pérez-Salazar, R., Alfaro-Chinchilla, C., Abarca Méndez, A., Araya Leitón, L., Carranza Chaves, J., Echevarría Figueroa, A., Elizondo Blanco, M., Ardón Rivera, R., Flores Aguilar, S., & Solís Calderón, C. (2021). Spatial variation of physicochemical parameters in a constructed wetland for wastewater treatment: An example of the use of the R programming language . UNED Research Journal, 13(1), 15.


Introduction: The implementation of wastewater treatment systems such as constructed wetlands has a growing interest in the last decade due to its low cost and high effectiveness in treating industrial and residential wastewater. Objective: To evaluate the spatial variation of physicochemical parameters in a constructed wetland system of sub-superficial flow of Pennisetum alopecuroides (Pennisetum) and a Control (unplanted). The purpose is to provide an analysis of spatial dynamic of physicochemical parameters using R programming language. Methods: Each of the cells (Pennisetum and Control) had 12 piezometers, organized in three columns and four rows with a separation distance of 3,25m and 4,35m, respectively. The turbidity, biochemical oxygen demand (BOD), chemical oxygen demand (COD), total Kjeldahl nitrogen (TKN), ammoniacal nitrogen (N-NH4), organic nitrogen (N-org.) and phosphorous (P-PO4-3) were measured in water under in-flow and out-flow of both conditions Control and Pennisetum (n= 8). Additionally, the oxidation-reduction potential (ORP), dissolved oxygen (DO), conductivity, pH and water temperature, were measured (n= 167) in the piezometers. Results: No statistically significant differences between cells for TKN, N-NH4, conductivity, turbidity, BOD, and COD were found; but both Control and Pennisetum cells showed a significant reduction in these parameters (P<0,05). Overall, TKN and N-NH4 removal were from 65,8 to 84,1% and 67,5 to 90,8%, respectively; and decrease in turbidity, conductivity, BOD, and COD, were between 95,1-95,4%; 15-22,4%; 65,2-77,9% and 57,4-60,3% respectively. Both cells showed ORP increasing gradient along the water-flow direction, contrary to conductivity (p<0,05). However, OD, pH and temperature were inconsistent in the direction of the water flow in both cells. Conclusions: Pennisetum demonstrated pollutant removal efficiency, but presented results similar to the control cells, therefore, remains unclear if it is a superior option or not. Spatial variation analysis did not reflect any obstruction of flow along the CWs; but some preferential flow paths can be distinguished. An open-source repository of R was provided.


​​Ahmad, S., Majhi, P. K., Kothari, R., & Singh, R. P. (2020). Industrial Wastewater Footprinting: A Need for Water Security in Indian Context. Environmental Concerns and Sustainable Development, 1, 197–212.

AyA, MINAE & MS. (2016). Política Nacional de Saneamiento en Aguas Residuales 2016-2045 (1st ed.). AyA-MINAE-MS. Retrieved from Nacional de Saneamiento en Aguas Residuales marzo 2017.pdf

Cui, L., Ouyang, Y., Gu, W., Yang, W., & Xu, Q. (2013). Evaluation of nutrient removal efficiency and microbial enzyme activity in a baffled subsurface-flow constructed wetland system. Bioresource Technology, 146, 656–662.

Daphne, L. H. X., Utomo, H. D., & Kenneth, L. Z. H. (2011). Correlation between Turbidity and Total Suspended Solids in Singapore Rivers. Journal of Water Sustainability, 1(3), 313–322.

Doherty, L., Zhao, Y., Zhao, X., Hu, Y., Hao, X., Xu, L., & Liu, R. (2015). A review of a recently emerged technology: Constructed wetland – Microbial fuel cells. Water Research, 85, 38–45.

García, J., Rousseau, D. P. L., Morató, J., Lesage, E., Matamoros, V., & Bayona, J. . (2010). Contaminant Removal Processes in Subsurface-Flow Constructed Wetlands: A Review. Critical Reviews in Environmental Science and Technology, 40(7), 561–661.

Gomes da Silva, F. J. & Gouveia, R. M. (2020). Global Population Growth and Industrial Impact on the Environment. Cleaner Production, 33–75.

Grayson, R. B., Finlayson, B. L., Gippel, C. J., & Hart, B. T. (1996). The potential of field turbidity measurements for the computation of total phosphorus and suspended solids loads. Journal of Environmental Management, 47(3), 257–267.

Haddis, A., Van der Bruggen, B., & Smets, I. (2020). Constructed wetlands as nature based solutions in removing organic pollutants from wastewater under irregular flow conditions in a tropical climate. Ecohydrology & Hydrobiology, 20(1), 38–47.

He, Y., Peng, L., Hua, Y., Zhao, J., & Xiao, N. (2018). Treatment for domestic wastewater from university dorms using a hybrid constructed wetland at pilot scale. Environmental Science and Pollution Research, 25(9), 8532–8541.

IMN. (2020). Instituto Meterológico Nacional de Costa Rica. Retrieved January 9, 2020, from

Kadlec, R. H. & Reddy, K. R. (2001). Temperature Effects in Treatment Wetlands. Water Environment Research, 73(5), 543–557.

Kassambara, A. & Mundt, F. (2020). Factoextra: extract and visualize the results of multivariate data analyses. R Package version 1.0.7. Retrieved January 9, 2020, from

López-Ocaña, G., Bautista-Margulis, R. G., Ramos-Herrera, S., Torres-Balcazar, C. A., López-Vidal, R., & Pampillón-González, L. (2018). Phytoremediation of wastewater with thalia geniculata in constructed wetlands: basic pollutants distribution. Ecology and the Environment, 228, 53–63.

Nychka, D., Furrer, R., Paige, J., & Sain, S. (2017). Package “fields” Tools for Spatial Data. R package version 11.6. January 9, 2020. Retrieved from

Perez-Salazar, R., Alfaro-Chinchilla, C., & Scholz, C. (2019). Experiencia en la fase de estabilización del nuevo sistema de tratamiento de aguas residuales en la Escuela de Medicina Veterinaria, Campus Benjamín Núñez, UNA. In Y. Morales-López (Ed.), Memorias del I Congreso Internacional de Ciencias Exactas y Naturales (pp. 1–8). Universidad Nacional.

RCoreTeam. (2020). R: A language and environment for statistical computing (R version 3.6.1). Retrieved January 9, 2020, from

Rencher, A. C. (2005). A Review Of “Methods of Multivariate Analysis, Second Edition.” IIE Transactions, 37(11), 1083–1085.

Rice, E. W., Baird, R. B., & Eaton, A. D. (2017). Standard Methods for the Examination of Water and Wastewater, 23rd Edition. American Public Health Association.

Rügner, H., Schwientek, M., Beckingham, B., Kuch, B., & Grathwohl, P. (2013). Turbidity as a proxy for total suspended solids (TSS) and particle facilitated pollutant transport in catchments. Environmental Earth Sciences, 69(2), 373–380.

Ruiz, F. F. (2012). Gestión de las Excretas y Aguas Residuales en Costa Rica: Situación Actual y Perspectiva. Retrieved January 9, 2020, from

Srivastava, P., Abbassi, R., Garaniya, V., Lewis, T., & Yadav, A. K. (2020). Performance of pilot-scale horizontal subsurface flow constructed wetland coupled with a microbial fuel cell for treating wastewater. Journal of Water Process Engineering, 33, 100994.

Tang, X., Huang, S., Scholz, M., & Li, J. (2011). Nutrient removal in vertical subsurface flow constructed wetlands treating eutrophic river water. International Journal of Environmental Analytical Chemistry, 91(7–8), 727–739.

Tatoulis, T., Akratos, C. S., Tekerlekopoulou, A. G., Vayenas, D. V., & Stefanakis, A. I. (2017). A novel horizontal subsurface flow constructed wetland: Reducing area requirements and clogging risk. Chemosphere, 186, 257–268.

Teixeira, D. L., Matos, A. T., Matos, M. P., Hamakawa, P. J., & Teixeira, D. V. (2020). Evapotranspiration of the Vetiver and Tifton 85 grasses grown in horizontal subsurface flow constructed wetlands. Journal of Environmental Science and Health, Part A, 1–8.

van Puijenbroek, P. J. T. M., Beusen, A. H. W., & Bouwman, A. F. (2019). Global nitrogen and phosphorus in urban waste water based on the Shared Socio-economic pathways. Journal of Environmental Management, 231, 446–456.

Viessman, W. & Hammer, M. J. (2005). Water supply and pollution control. Michigan, USA: Pearson Prentice Hall.

Villa, A., Fölster, J., & Kyllmar, K. (2019). Determining suspended solids and total phosphorus from turbidity: comparison of high-frequency sampling with conventional monitoring methods. Environmental Monitoring and Assessment, 191(10), 605.

Vymazal, J. (2010). Constructed Wetlands for Wastewater Treatment. Water, 2(3), 530–549.

Vymazal, J. (2019). Is removal of organics and suspended solids in horizontal sub-surface flow constructed wetlands sustainable for twenty and more years? Chemical Engineering Journal, 378, 122117.

Vymazal, J. & Kröpfelová, L. (2009). Removal of organics in constructed wetlands with horizontal sub-surface flow: A review of the field experience. Science of the Total Environment, 407(13), 3911–3922.

Xu, Q. & Cui, L. (2019). Removal of COD from synthetic wastewater in vertical flow constructed wetland. Water Environment Research, 91(12), 1661–1668.

Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 International License.