Last updated: 2025-12-18
Checks: 5 2
Knit directory: SkinOptics/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of
the R Markdown file created these results, you’ll want to first commit
it to the Git repo. If you’re still working on the analysis, you can
ignore this warning. When you’re finished, you can run
wflow_publish to commit the R Markdown file and build the
HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20251211) was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
To ensure reproducibility of the results, delete the cache directory
JID_SkinOptics_cache and re-run the analysis. To have
workflowr automatically delete the cache directory prior to building the
file, set delete_cache = TRUE when running
wflow_build() or wflow_publish().
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 1ff1191. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish or
wflow_git_commit). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .DS_Store
Ignored: analysis/skin-map_cache/
Ignored: data/worldclim/
Untracked files:
Untracked: analysis/JID_SkinOptics_cache/
Untracked: code/install_packages.R
Untracked: data/ISSA_17_Jan_2025_Yan_Lu.xlsx
Unstaged changes:
Modified: analysis/JID_SkinOptics.Rmd
Modified: output/absorbance_derivative_face.pdf
Modified: output/absorbance_derivative_palm.pdf
Modified: output/absorbance_derivative_palm_face.pdf
Modified: output/absorbance_mi_sd.pdf
Modified: output/ei_mi_correlation.pdf
Modified: output/ei_sd_mi_correlation.pdf
Modified: output/heatmap.pdf
Modified: output/mi_distribution.pdf
Modified: output/palm_ei_face_mi_correlation.pdf
Modified: output/palm_ei_face_mi_sd_correlation.pdf
Modified: output/reflectance_derivative_face.pdf
Modified: output/reflectance_derivative_palm.pdf
Modified: output/reflectance_derivative_palm_face.pdf
Modified: output/reflectance_face.pdf
Modified: output/reflectance_mi_sd.pdf
Modified: output/reflectance_mi_sd_regression.pdf
Modified: output/reflectance_palm.pdf
Modified: output/reflectance_palm_face.pdf
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/JID_SkinOptics.Rmd) and
HTML (docs/JID_SkinOptics.html) files. If you’ve configured
a remote Git repository (see ?wflow_git_remote), click on
the hyperlinks in the table below to view the files as they were in that
past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| html | 9956d2d | Junhui He | 2025-12-17 | Build site. |
| Rmd | a6f7dc4 | Junhui He | 2025-12-17 | update JID_SkinOptics.Rmd |
| html | 32c3e8f | Junhui He | 2025-12-11 | Rebuild site to apply navbar layout |
| html | b2cbe44 | Junhui He | 2025-12-11 | Build site. |
| Rmd | df71367 | Junhui He | 2025-12-11 | modify face site |
| html | d98f12d | Junhui He | 2025-12-11 | Build site. |
| Rmd | 2fc3d03 | Junhui He | 2025-12-11 | add correlation analysis |
| html | 81580b5 | Junhui He | 2025-12-11 | build workflowr |
| Rmd | e11deee | Junhui He | 2025-12-11 | calculate EI |
| html | e11deee | Junhui He | 2025-12-11 | calculate EI |
| Rmd | 53d4f9c | Junhui He | 2025-12-11 | create SkinOptics |
| html | 53d4f9c | Junhui He | 2025-12-11 | create SkinOptics |
Melanin index (MI) is calculated from skin reflectance at 680 nm, where \(R_{680}\) is the measured reflectance percentage (0-100):
Erythema index (EI) is calculated as: \[EI = 100 \times \log_{10}\left(\frac{R_{680}}{(R_{550} + R_{560})/2}\right)\] where \(R_{550}\), \(R_{560}\), and \(R_{680}\) are the reflectance percentages at 550 nm, 560 nm, and 680 nm, respectively.
EI variability is measured by the standard deviation of EIs within a sliding window of MI values. The window size is set to 20 MI units, and the step size is 1 MI unit.
FACE site refers to Forehead or Cheek, while PALM site refers to the Palm of the hand.
Representative FACE MI:
First derivatives of skin spectra are estimated using local polynomial regression with bandwidth selected by the dpill function, scaled by a factor of 0.7.
Eumelanin classes are defined based on melanin index ranges as follows:
The pdf files generated in this analysis are saved in the “output” directory.
Face readings before deduplication: 4603
Unique individuals with Face readings: 2102
Face readings after deduplication: 2102
Palm readings before deduplication: 776
Unique individuals with Palm readings: 776
Palm readings after deduplication: 776
Final data summary:
Face: n = 2101 | Unique individuals: 2101
Palm: n = 776 | Unique individuals: 776
Combined: n = 2877


| Version | Author | Date |
|---|---|---|
| 53d4f9c | Junhui He | 2025-12-11 |
| Eumelanin class | Number of subjects |
|---|---|
| Low | 77 |
| Intermediate low | 1800 |
| Intermediate | 191 |
| Intermediate high | 30 |
| High | 3 |
| Eumelanin class | Number of subjects |
|---|---|
| Low | 127 |
| Intermediate low | 621 |
| Intermediate | 27 |
| Intermediate high | 1 |



| Version | Author | Date |
|---|---|---|
| b2cbe44 | Junhui He | 2025-12-11 |




| Version | Author | Date |
|---|---|---|
| b2cbe44 | Junhui He | 2025-12-11 |

Call:
lm(formula = sd_ref ~ log_mi + I(log_mi^2), data = sd_face)
Residuals:
Min 1Q Median 3Q Max
-0.069033 -0.014140 -0.001695 0.011080 0.100513
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.558619 0.066400 23.47 <2e-16 ***
log_mi -0.681307 0.035862 -19.00 <2e-16 ***
I(log_mi^2) 0.076171 0.004826 15.78 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.02264 on 2098 degrees of freedom
Multiple R-squared: 0.6497, Adjusted R-squared: 0.6494
F-statistic: 1946 on 2 and 2098 DF, p-value: < 2.2e-16
Call:
lm(formula = sd_ref ~ log_mi, data = sd_palm)
Residuals:
Min 1Q Median 3Q Max
-0.066053 -0.016370 0.000337 0.015371 0.071971
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.560165 0.013160 42.56 <2e-16 ***
log_mi -0.120567 0.003789 -31.82 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.0238 on 774 degrees of freedom
Multiple R-squared: 0.5668, Adjusted R-squared: 0.5662
F-statistic: 1013 on 1 and 774 DF, p-value: < 2.2e-16




| Version | Author | Date |
|---|---|---|
| 9956d2d | Junhui He | 2025-12-17 |


| Version | Author | Date |
|---|---|---|
| 9956d2d | Junhui He | 2025-12-17 |
R version 4.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Tahoe 26.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Detroit
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggpubr_0.6.0 here_1.0.1 KernSmooth_2.23-26 openxlsx_4.2.8.1
[5] scales_1.4.0 lubridate_1.9.4 forcats_1.0.0 stringr_1.5.1
[9] dplyr_1.1.4 purrr_1.0.4 readr_2.1.5 tidyr_1.3.1
[13] tibble_3.2.1 ggplot2_4.0.1 tidyverse_2.0.0 knitr_1.50
loaded via a namespace (and not attached):
[1] gtable_0.3.6 xfun_0.54 bslib_0.9.0 rstatix_0.7.2
[5] lattice_0.22-7 tzdb_0.5.0 vctrs_0.6.5 tools_4.5.2
[9] generics_0.1.4 pkgconfig_2.0.3 Matrix_1.7-4 RColorBrewer_1.1-3
[13] S7_0.2.0 lifecycle_1.0.4 compiler_4.5.2 farver_2.1.2
[17] git2r_0.36.2 textshaping_1.0.1 carData_3.0-5 httpuv_1.6.16
[21] htmltools_0.5.8.1 sass_0.4.10 yaml_2.3.10 Formula_1.2-5
[25] later_1.4.2 pillar_1.10.2 car_3.1-3 jquerylib_0.1.4
[29] whisker_0.4.1 cachem_1.1.0 abind_1.4-8 nlme_3.1-168
[33] tidyselect_1.2.1 zip_2.3.3 digest_0.6.37 stringi_1.8.7
[37] splines_4.5.2 labeling_0.4.3 cowplot_1.1.3 rprojroot_2.0.4
[41] fastmap_1.2.0 grid_4.5.2 cli_3.6.5 magrittr_2.0.3
[45] dichromat_2.0-0.1 broom_1.0.8 withr_3.0.2 promises_1.3.3
[49] backports_1.5.0 timechange_0.3.0 rmarkdown_2.29 ggsignif_0.6.4
[53] workflowr_1.7.1 ragg_1.4.0 hms_1.1.3 evaluate_1.0.3
[57] viridisLite_0.4.2 mgcv_1.9-3 rlang_1.1.6 Rcpp_1.1.0
[61] glue_1.8.0 jsonlite_2.0.0 R6_2.6.1 systemfonts_1.3.1
[65] fs_1.6.6