R Under development (unstable) (2025-01-18 r87593 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > library( munsellinterpol ) > > # > # checkColorLookup() > # performs lookup with ColorBlockFromMunsell() and verifies that the color block number is correct > # > # return value: TRUE or FALSE > # > testColorBlock <- function() + { + Number = ColorBlockFromMunsell( CentroidsISCCNBS$MunsellSpec )$Number + + # Number[1] = 57L test the test ! + + # compute the number of classification errors + idx = which( Number != CentroidsISCCNBS$Number ) + + out = (length(idx) == 0) + + if( ! out ) + { + mess = sprintf( "testColorBlock(). There are %d errors\n", length(idx) ) + cat(mess) + df = cbind( CentroidsISCCNBS[ idx, ], NumberLookup=Number[idx] ) + print( df ) + } + + return( out ) + } > > > if( ! testColorBlock() ) stop( "testColorBlock() failed !\n" ) > > > cat( "Passed all ISCC-NBS tests !\n" ) Passed all ISCC-NBS tests ! > > proc.time() user system elapsed 0.25 0.07 0.31