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 e11deee. 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/

Unstaged changes:
    Modified:   analysis/.DS_Store
    Deleted:    analysis/JID_MelaninSiteAttenuation.Rmd
    Deleted:    analysis/issa-spectrum.Rmd
    Deleted:    analysis/skin-reflectance.Rmd
    Deleted:    analysis/sliding-window.Rmd

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 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.

  • FACE site refers to Forehead and 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, the average MI across those measurements is used.
  • 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 296
Intermediate low 3801
Intermediate 418
Intermediate high 80
High 7
Number of subjects in each eumelanin class (Palm)
Eumelanin class Number of subjects
Low 127
Intermediate low 623
Intermediate 27
Intermediate high 1

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

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

First derivatives of absorbance by eumelanin classes

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

Version Author Date
53d4f9c Junhui He 2025-12-11
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.07754 -0.01585 -0.00113  0.01262  0.11441 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1.608490   0.044784   35.92   <2e-16 ***
log_mi      -0.708782   0.024262  -29.21   <2e-16 ***
I(log_mi^2)  0.079846   0.003271   24.41   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.02462 on 4599 degrees of freedom
Multiple R-squared:  0.6491,    Adjusted R-squared:  0.6489 
F-statistic:  4253 on 2 and 4599 DF,  p-value: < 2.2e-16

Call:
lm(formula = sd_ref ~ log_mi, data = sd_palm)

Residuals:
      Min        1Q    Median        3Q       Max 
-0.066026 -0.016322  0.000318  0.015338  0.071978 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.560294   0.013141   42.64   <2e-16 ***
log_mi      -0.120610   0.003783  -31.88   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.02377 on 776 degrees of freedom
Multiple R-squared:  0.5671,    Adjusted R-squared:  0.5665 
F-statistic:  1016 on 1 and 776 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

Version Author Date
e11deee 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