R Under development (unstable) (2024-01-26 r85832 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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( colorSpec ) Attaching colorSpec. Version: 1.5-0. Author: Glenn Davis [aut, cre]. Built: R 4.4.0; ; 2024-01-28 04:15:05 UTC; windows > > cs.options( loglevel='TRACE' ) $colorSpec.loglevel [1] "TRACE" $colorSpec.logformat [1] "%t{%H:%M:%OS3} %l %n::%f(). %m" $colorSpec.stoponerror [1] TRUE > > testCGATS <- function() + { + mess = sprintf( "in testCGATS(). getwd() = '%s'", getwd() ) + cat( mess, '\n', file=stderr() ) + + # find the extdata folder + if( grepl( "[..]Rcheck", getwd() ) ) + extdata = "../colorSpec/extdata" + else + extdata = "inst/extdata" + + # extdata = system.file( "extdata", package="colorSpec" ) # override + extdata = '.' + + + if( ! file.exists( extdata ) ) + { + print( getwd() ) + print( extdata ) + cat( "Cannot find the extdata folder !\n", file=stderr() ) + return(FALSE) + } + + + + # test-CGATS-2-2S.txt 2 tables, both are spectral + path = file.path( extdata, "test-CGATS-2-2S.txt" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + junk = readSpectraCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + + # test-CGATS-2-1S.txt 2 tables, only the 1st one is spectral + path = file.path( extdata, "test-CGATS-2-1S.txt" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + junk = readSpectraCGATS(path) # should be 1 table + if( length(junk) != 1 ) + return(FALSE) + + # test-CGATS-2-1S-swap.txt 2 tables, only the 2nd one is spectral + path = file.path( extdata, "test-CGATS-2-1S-swap.txt" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + junk = readSpectraCGATS(path) # should be 1 table + if( length(junk) != 1 ) + return(FALSE) + + + + # A70.ti3 has 2 tables, both non-spectral + path = file.path( extdata, "A70.ti3" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + + # the final call should generate an ERROR and return NULL, so disable stopping + cs.options( stoponerror=FALSE ) + junk = readSpectraCGATS(path) + if( ! is.null(junk) ) + return(FALSE) + + return(TRUE) + } > > > > if( ! testCGATS() ) stop( "testCGATS() failed !" ) in testCGATS(). getwd() = 'd:/RCompile/CRANincoming/R-devel/colorSpec.Rcheck/tests' 05:16:09.671 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:09.771 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:09.781 INFO colorSpec::readCGATS(). 2 tables read from './test-CGATS-2-2S.txt'. 05:16:09.812 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:09.821 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:09.832 INFO colorSpec::readCGATS(). 2 tables read from './test-CGATS-2-2S.txt'. 05:16:09.833 INFO colorSpec::spectralColumns(). In file './test-CGATS-2-2S.txt' and table 2, using non-standard convention for spectral data. 05:16:09.835 DEBUG colorSpec::guessSpectrumQuantity(). guessed type=NA 05:16:09.837 WARN colorSpec::colorSpecFromDF(). Perturbed wavelengths in './test-CGATS-2-2S.txt' to have equal increments of 3.33333 nm [380 to 730 nm] 05:16:09.915 INFO colorSpec::spectralColumns(). In file './test-CGATS-2-2S.txt' and table 1, using non-standard convention for spectral data. 05:16:09.916 INFO colorSpec::colorSpecFromDF(). Dividing spectral values by SPECTRAL_NORM=1923.81. 05:16:09.962 DEBUG colorSpec::guessSpectrumQuantity(). guessed type=NA 05:16:10.000 WARN colorSpec::colorSpecFromDF(). Perturbed wavelengths in './test-CGATS-2-2S.txt' to have equal increments of 3.33333 nm [380 to 730 nm] 05:16:10.012 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:10.021 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:10.023 INFO colorSpec::readCGATS(). 2 tables read from './test-CGATS-2-1S.txt'. 05:16:10.033 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:10.043 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:10.045 INFO colorSpec::readCGATS(). 2 tables read from './test-CGATS-2-1S.txt'. 05:16:10.045 DEBUG colorSpec::is.colorSpec(). 'obj' class 'logical' is invalid. 05:16:10.045 INFO colorSpec::spectralColumns(). In file './test-CGATS-2-1S.txt' and table 1, using non-standard convention for spectral data. 05:16:10.047 INFO colorSpec::colorSpecFromDF(). Dividing spectral values by SPECTRAL_NORM=1923.81. 05:16:10.047 DEBUG colorSpec::guessSpectrumQuantity(). guessed type=NA 05:16:10.048 WARN colorSpec::colorSpecFromDF(). Perturbed wavelengths in './test-CGATS-2-1S.txt' to have equal increments of 3.33333 nm [380 to 730 nm] 05:16:10.050 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:10.051 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:10.061 INFO colorSpec::readCGATS(). 2 tables read from './test-CGATS-2-1S-swap.txt'. 05:16:10.062 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:10.063 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:10.074 INFO colorSpec::readCGATS(). 2 tables read from './test-CGATS-2-1S-swap.txt'. 05:16:10.074 INFO colorSpec::spectralColumns(). In file './test-CGATS-2-1S-swap.txt' and table 2, using non-standard convention for spectral data. 05:16:10.076 INFO colorSpec::colorSpecFromDF(). Dividing spectral values by SPECTRAL_NORM=1923.81. 05:16:10.076 DEBUG colorSpec::guessSpectrumQuantity(). guessed type=NA 05:16:10.077 WARN colorSpec::colorSpecFromDF(). Perturbed wavelengths in './test-CGATS-2-1S-swap.txt' to have equal increments of 3.33333 nm [380 to 730 nm] 05:16:10.078 DEBUG colorSpec::is.colorSpec(). 'obj' class 'logical' is invalid. 05:16:10.079 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:10.081 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:10.083 INFO colorSpec::readCGATS(). 2 tables read from './A70.ti3'. 05:16:10.103 INFO colorSpec::extractTableCGATS(). In table 1, using CGATS-standard white-space specification. 05:16:10.106 INFO colorSpec::extractTableCGATS(). In table 2, using CGATS-standard white-space specification. 05:16:10.108 INFO colorSpec::readCGATS(). 2 tables read from './A70.ti3'. 05:16:10.108 DEBUG colorSpec::is.colorSpec(). 'obj' class 'logical' is invalid. 05:16:10.108 DEBUG colorSpec::is.colorSpec(). 'obj' class 'logical' is invalid. 05:16:10.108 ERROR colorSpec::readSpectraCGATS(). Found no tables with spectral data in './A70.ti3'. > > cat( "Passed all CGATS read tests !\n", file=stderr() ) Passed all CGATS read tests ! > > proc.time() user system elapsed 0.59 0.09 0.67