Closed
Description
readSLI cannot find the hdr file if files are not in the working directory
unless hdr file is named *.sli.hdr
> require("RStoolbox")
> #readSLI works fine with the files in the working directory
> list.files(patt=glob2rx("a*"))
[1] "a.hdr" "a.sli" "adir"
> x <- readSLI("a.sli")
> #but does not work if the files are in another directory
> list.files("adir",patt=glob2rx("a*"))
[1] "a.hdr" "a.sli"
> x <- readSLI(file.path("./adir","a.sli"))
Error: Can't find header file of./adir/a.sli
#instead it also works fine if the hdr is renamed to a.sli.hdr
> file.copy(file.path("./adir","a.hdr"),file.path("./adir","a.sli.hdr") )
[1] TRUE
> x <- readSLI(file.path("./adir","a.sli"))
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RStoolbox_0.2.4
Metadata
Assignees
Labels
No labels