DeltaE( c(50,0,0), c(51,2,2, 52,10,11, 46,-13,16) )
## [1] 3 15 21
path = system.file( "extdata/ciede2000testdata.txt", package='spacesXYZ' )
df = read.table( path, sep='\t', quote='', head=TRUE )
Lab1 = as.matrix( df[ , 1:3 ] )
Lab2 = as.matrix( df[ , 4:6 ] )
cbind( Lab1, Lab2, DeltaE( Lab1, Lab2, metric=c(1976,2000) ) )[ 1:10, ]
## LAB_L_REF LAB_A_REF LAB_B_REF LAB_L_SAM LAB_A_SAM LAB_B_SAM DeltaE.1976 DeltaE.2000
## [1,] 50.0000 2.6772 -79.7751 50.0000 0.0000 -82.7485 4.0010633 2.0424597
## [2,] 50.0000 3.1571 -77.2803 50.0000 0.0000 -82.7485 6.3141501 2.8615102
## [3,] 50.0000 2.8361 -74.0200 50.0000 0.0000 -82.7485 9.1776999 3.4411906
## [4,] 50.0000 -1.3802 -84.2814 50.0000 0.0000 -82.7485 2.0627008 0.9999989
## [5,] 50.0000 -1.1848 -84.8006 50.0000 0.0000 -82.7485 2.3695707 1.0000047
## [6,] 50.0000 -0.9009 -85.5211 50.0000 0.0000 -82.7485 2.9152927 1.0000130
## [7,] 50.0000 0.0000 0.0000 50.0000 -1.0000 2.0000 2.2360680 2.3668588
## [8,] 50.0000 -1.0000 2.0000 50.0000 0.0000 0.0000 2.2360680 2.3668588
## [9,] 50.0000 2.4900 -0.0010 50.0000 -2.4900 0.0009 4.9800004 7.1791720
## [10,] 50.0000 2.4900 -0.0010 50.0000 -2.4900 0.0010 4.9800004 7.1791626
Run the code above in your browser using DataLab