Last updated: 2025-12-11

Checks: 7 0

Knit directory: SkinOptics/

This reproducible R Markdown analysis was created with workflowr (version 1.7.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

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.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

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 df71367. 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:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  output/absorbance_derivative_palm_face.pdf
    Untracked:  output/reflectance_derivative_palm_face.pdf
    Untracked:  output/reflectance_derivative_palmface.pdf

Unstaged changes:
    Modified:   .DS_Store
    Modified:   output/absorbance_derivative_face.pdf
    Modified:   output/absorbance_derivative_palm.pdf
    Modified:   output/absorbance_mi_sd.pdf
    Modified:   output/ei_mi_correlation.pdf
    Modified:   output/ei_sd_mi_correlation.pdf
    Modified:   output/facepalm_ei_mi_correlation.pdf
    Modified:   output/heatmap.pdf
    Modified:   output/mi_distribution.pdf
    Modified:   output/reflectance_derivative_face.pdf
    Modified:   output/reflectance_derivative_palm.pdf
    Modified:   output/reflectance_mi_sd.pdf
    Modified:   output/reflectance_mi_sd_regression.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
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

Clarifications

  • Melanin index (MI) is calculated based on skin reflectance at 680 nm. Specifically, MI = -100 * log10(R680 / 100), where R680 is the reflectance percentage at 680 nm.

  • Erythema index (EI) is calculated as EI = 100 * log10(R680 / ((R550 + R560)/2)), where R550 and R560 are the reflectance percentages at 550 nm and 560 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.

    • For each center MI value in the sequence, all EI values corresponding to MI values within the window (center MI ± 10) are collected, and their standard deviation is computed.
    • The center MI values range from the 1st to the 99th percentile of observed MI values.
  • FACE site refers to Forehead or Cheek, while PALM site refers to the Palm of the hand.

  • Representative FACE MI:

    • For each subject, the FACE MI is given by the Forehead MI if the Forehead MI is available; otherwise, it is the Cheek MI.
    • For subjects with multiple measurements at the same FACE site, we randomly select one measurement.
    • Each subject has only one representative FACE reflectance spectra.
  • 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:

    • Low: MI < 25
    • Intermediate low: 25 ≤ MI < 50
    • Intermediate: 50 ≤ MI < 75
    • Intermediate high: 75 ≤ MI < 100
    • High: MI ≥ 100
  • The pdf files generated in this analysis are saved in the “output” directory.

Visualizations

Distribution of melanin index by site

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Unique subjects per site across representative face melanin index bins (Heatmap)

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

First derivatives of reflectance by eumelanin classes

Number of subjects in each eumelanin class (Forehead/Cheek)
Eumelanin class Number of subjects
Low 77
Intermediate low 1800
Intermediate 191
Intermediate high 30
High 3
Number of subjects in each eumelanin class (Palm)
Eumelanin class Number of subjects
Low 127
Intermediate low 621
Intermediate 27
Intermediate high 1

Face reflectance derivatives by face eumelanin class

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Palm reflectance derivatives by palm eumelanin class

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Palm reflectance derivatives by face eumelanin class

quartz_off_screen 
                2 

First derivatives of absorbance by eumelanin classes

Face absorbance derivatives by face eumelanin class

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Palm absorbance derivatives by palm eumelanin class

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Palm absorbance derivatives by face eumelanin class

quartz_off_screen 
                2 

Correlation between reflectance derivative sd and melanin index

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 
  • Regression analysis

Call:
lm(formula = sd_ref ~ log_mi + I(log_mi^2), data = sd_face)

Residuals:
      Min        1Q    Median        3Q       Max 
-0.069041 -0.014131 -0.001693  0.011082  0.100521 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1.560287   0.066388   23.50   <2e-16 ***
log_mi      -0.682188   0.035856  -19.03   <2e-16 ***
I(log_mi^2)  0.076287   0.004825   15.81   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.02265 on 2098 degrees of freedom
Multiple R-squared:  0.6498,    Adjusted R-squared:  0.6495 
F-statistic:  1947 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
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Correlation between absorbance derivative sd and melanin index

Version Author Date
53d4f9c Junhui He 2025-12-11
quartz_off_screen 
                2 

Correlation between erythema index and melanin index by site

Version Author Date
e11deee Junhui He 2025-12-11
quartz_off_screen 
                2 

Correlation between erythema index variability and melanin index by site

  • 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.
    • For each center MI value in the sequence, all EI values corresponding to MI values within the window (center MI ± 10) are collected, and their standard deviation is computed.
    • The center MI values range from the 1st to the 99th percentile of observed MI values.

Version Author Date
d98f12d Junhui He 2025-12-11
quartz_off_screen 
                2 

Correlation between erythema index variability and melanin index for combined face and palm data

Version Author Date
d98f12d Junhui He 2025-12-11
quartz_off_screen 
                2 

R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 15.6.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

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] KernSmooth_2.23-26 openxlsx_4.2.8.1   scales_1.4.0       lubridate_1.9.4   
 [5] forcats_1.0.1      stringr_1.6.0      dplyr_1.1.4        purrr_1.2.0       
 [9] readr_2.1.6        tidyr_1.3.1        tibble_3.3.0       ggplot2_4.0.1     
[13] tidyverse_2.0.0    patchwork_1.3.2    knitr_1.50        

loaded via a namespace (and not attached):
 [1] sass_0.4.10        generics_0.1.4     lattice_0.22-7     stringi_1.8.7     
 [5] hms_1.1.4          digest_0.6.39      magrittr_2.0.4     timechange_0.3.0  
 [9] evaluate_1.0.5     grid_4.3.1         RColorBrewer_1.1-3 fastmap_1.2.0     
[13] Matrix_1.5-4.1     rprojroot_2.1.1    workflowr_1.7.2    jsonlite_2.0.0    
[17] zip_2.3.3          whisker_0.4.1      promises_1.5.0     mgcv_1.8-42       
[21] viridisLite_0.4.2  jquerylib_0.1.4    cli_3.6.5          rlang_1.1.6       
[25] splines_4.3.1      withr_3.0.2        cachem_1.1.0       yaml_2.3.11       
[29] otel_0.2.0         tools_4.3.1        tzdb_0.5.0         httpuv_1.6.16     
[33] vctrs_0.6.5        R6_2.6.1           lifecycle_1.0.4    git2r_0.36.2      
[37] fs_1.6.6           pkgconfig_2.0.3    pillar_1.11.1      bslib_0.9.0       
[41] later_1.4.4        gtable_0.3.6       glue_1.8.0         Rcpp_1.1.0        
[45] xfun_0.54          tidyselect_1.2.1   farver_2.1.2       nlme_3.1-168      
[49] htmltools_0.5.9    labeling_0.4.3     rmarkdown_2.30     compiler_4.3.1    
[53] S7_0.2.1