Type: | Package |
Title: | Statistical Analysis and Visualization of Surface-Engineered Material Properties |
Version: | 0.1.0 |
Author: | Paul Angelo C. Manlapaz
|
Maintainer: | Paul Angelo C. Manlapaz <pacmanlapaz@gmail.com> |
Description: | A collection of functions for statistical and multivariate analysis of surface-related data, with a focus on antimicrobial activity and omniphobicity. Designed to support materials scientists and researchers in exploring structure–function relationships in surface-engineered materials through reproducible and interpretable workflows. For more details, see Li et al. (2021) <doi:10.1002/advs.202100368>, and Kwon et al. (2020) <doi:10.3390/polym12081826>. |
License: | GPL-3 |
Encoding: | UTF-8 |
Depends: | R (≥ 4.1.0) |
Imports: | dplyr, ggplot2, effectsize, stats, FactoMineR, factoextra, randomForest, multcompView, grid |
Suggests: | testthat, scales |
Config/testthat/edition: | 3 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-07-29 15:18:31 UTC; PTRI |
Repository: | CRAN |
Date/Publication: | 2025-07-31 10:20:02 UTC |
Antimicrobial Data Analysis
Description
Analyzes and visualizes antimicrobial test data through a combination of descriptive statistics, inferential analyses (ANOVA, Tukey HSD, Chi-square), and multivariate techniques including Multidimensional Scaling (MDS), and Random Forest classification. This function provides insights into group differences, underlying data structure, and variable importance in antimicrobial activity.
Arguments
zone_data |
A data frame containing the results of antimicrobial testing, with the following columns: 'bacterial_strain', 'antimicrobial_agent', 'zone_inhibition', and 'contact_area'. |
seed |
Optional. A numeric value to set the seed for reproducibility. If NULL (default), no seed is set. |
Value
A list containing the results of the antimicrobial analysis, including:
-
Summary statistics of the zone of inhibition per bacterial strain and antimicrobial agent.
-
Chi-square test results for associations between bacterial strain and contact area.
-
Boxplot visualizing the distribution of zone of inhibition across antimicrobial treatments and bacterial strains.
-
Heatmap displaying zone of inhibition values across bacterial strains and antimicrobial agents.
-
ANOVA and Tukey HSD test results for differences in zone of inhibition across treatments.
-
Linear model diagnostics including residuals vs. fitted for model assumptions.
-
MDS plot representing similarity of samples in reduced dimensions based on zone of inhibition.
-
Random forest model used to classify bacterial response based on zone of inhibition.
-
Variable importance results identifying key predictors from the random forest model.
-
Variable importance plot visualizing the most influential variables in the classification task.
Author(s)
Paul Angelo C. Manlapaz
Examples
# EXAMPLE 1: Two Bacterial Strain
bacterial_strain = rep(c("S. aureus", "K. pneumoniae"), each = 12)
antimicrobial_agent = rep(rep(c("Control", "HGS1 (30% wet pick-up)", "HGS2 (50% wet pick-up)",
"HGS3 (80% wet pick-up)"), each = 3), times = 2)
zone_inhibition = c(0, 0, 0, 10.2, 11.0, 9.8, 14.1, 13.8, 15.0, 18.5, 17.9, 19.2,
0, 0, 0, 8.5, 9.0, 8.8, 12.7, 13.1, 12.9, 16.4, 15.8, 16.9)
contact_area = c("Growth", "Growth", "Growth", "Partial Growth",
"Growth", "Partial Growth", "No Growth", "No Growth",
"Partial Growth", "No Growth", "No Growth", "No Growth",
"Growth", "Growth", "Growth", "Growth",
"Partial Growth", "Growth", "Partial Growth", "No Growth",
"No Growth", "No Growth", "No Growth", "No Growth")
zone_data <- data.frame(bacterial_strain, antimicrobial_agent, zone_inhibition, contact_area)
antimicrobial_analysis(zone_data) # seed = NULL, no seed is set
antimicrobial_analysis(zone_data, seed = 123) # seed is set to ensure reproducible results
# EXAMPLE 2: Four Bacterial Strain
bacterial_strain = rep(c("S. aureus", "K. pneumoniae", "E. coli", "S. pneumoniae"), each = 12)
antimicrobial_agent = rep(rep(c("Control", "HGS1 (30% wet pick-up)", "HGS2 (50% wet pick-up)",
"HGS3 (80% wet pick-up)"), each = 3), times = 4)
zone_inhibition = c(0, 0, 0, 10.2, 11.0, 9.8, 14.1, 13.8, 15.0, 18.5, 17.9, 19.2,
0, 0, 0, 8.5, 9.0, 8.8, 12.7, 13.1, 12.9, 16.4, 15.8, 16.9,
0, 0, 0, 9.3, 8.9, 9.1, 13.0, 13.5, 13.2, 16.7, 17.0, 16.9,
0, 0, 0, 11.5, 11.2, 11.0, 15.2, 14.9, 15.0, 19.0, 18.7, 19.3)
contact_area = c("Growth", "Growth", "Growth", "Partial Growth",
"Growth", "Partial Growth", "No Growth", "No Growth",
"Partial Growth", "No Growth", "No Growth", "No Growth",
"Growth", "Growth", "Growth", "Growth",
"Partial Growth", "Growth", "Partial Growth", "No Growth",
"No Growth", "No Growth", "No Growth", "No Growth",
"Growth", "Growth", "Growth", "Partial Growth",
"Partial Growth", "Growth", "Partial Growth", "No Growth",
"Partial Growth", "No Growth", "No Growth", "No Growth",
"Growth", "Growth", "Growth", "Partial Growth",
"Partial Growth", "Growth", "No Growth", "No Growth",
"Partial Growth", "No Growth", "No Growth", "No Growth")
zone_data <- data.frame(bacterial_strain, antimicrobial_agent, zone_inhibition, contact_area)
antimicrobial_analysis(zone_data) # seed = NULL, no seed is set
antimicrobial_analysis(zone_data, seed = 123) # seed is set to ensure reproducible results
Omniphobicity Data Analysis
Description
This function classifies surface wetting behavior based on water contact angle (WCA) and oil contact angle (OCA) values, then visualizes the results using scatter plots, bar plots, and Principal Component Analysis (PCA). PCA plots include group ellipses to show clustering trends, with the ellipse confidence level set by the 'ellipse_level' parameter (default = 0.68, corresponding to approximately 1 standard deviation).
Arguments
contact_data |
A data frame containing at least two numeric columns: 'WCA' and 'OCA'. |
ellipse_level |
A numeric value between 0 and 1 specifying the confidence level for the ellipse in the PCA plot. Default is 0.68. |
Value
A list containing the results of the omniphobicity analysis, including:
-
Classification table summarizing surface categories based on water and oil contact angles.
-
Contact angle summary statistics including minimum, maximum, mean, and standard deviation of WCA and OCA.
-
Bar plot visualizing the distribution of surface classifications.
-
Scatter plot showing the relationship between water and oil contact angles across samples.
-
PCA plot with ellipses and sample scores to visualize clustering among surface types.
-
PCA loadings plot showing contributions of WCA and OCA to the principal components.
-
Boxplots of PC1 and PC2 scores grouped by surface type.
-
ANOVA and Tukey HSD test results for PC1 and PC2 scores across surface types.
-
Compact Letter Displays (CLDs) indicating statistically significant groupings based on post-hoc tests.
Author(s)
Paul Angelo C. Manlapaz
Examples
# EXAMPLE 1:
WCA = c(151.3, 154.1, 144.5, 143.0, 147.6, 85.2, 60.4, 152.1, 149.8, 148.7, 140.0, 88.0, 65.0,
152.4, 70.0, 144.33, 150.50, 147.05, 149.35, 145.66, 141.2, 60.1, 92.7, 75.3, 155.0)
OCA = c(145.1, 143.4, 147.6, 139.0, 151.7, 80.3, 49.5, 143.8, 141.1, 143.8, 147.6, 72.5, 40.0,
143.6, 65.2, 140.10, 141.65, 142.17, 138.84, 138.23, 137.8, 45.6, 91.3, 60.2, 150.2)
contact_data <- data.frame(WCA, OCA)
omniphobicity_analysis(contact_data) # ellipse_level = 0.68 (default unless specified)
omniphobicity_analysis(contact_data, ellipse_level = 0.95)
# EXAMPLE 2:
WCA = c(65.2, 72.1, 58.7, 75.4, 68.9, 70.1, 66.5, 122.3, 135.5,
140.8, 125.6, 130.2, 115.0, 138.3, 143.0, 127.6, 119.7,
72.4, 85.3, 79.6, 68.5, 82.9, 76.1, 88.0, 84.2, 110.5,
97.6, 104.2, 111.3, 120.7, 99.4)
OCA = c(72.6, 75.1, 60.8, 69.4, 80.2, 77.5, 68.3, 120.4, 130.7,
133.2, 127.5, 123.3, 115.6, 134.1, 125.9, 117.4, 129.0,
110.2, 103.8, 112.5, 108.4, 115.9, 111.3, 120.0, 106.6,
72.1, 85.2, 70.3, 78.4, 88.6, 66.0)
contact_data <- data.frame(WCA, OCA)
omniphobicity_analysis(contact_data) # ellipse_level = 0.68 (default unless specified)
omniphobicity_analysis(contact_data, ellipse_level = 0.95)