Lienert Christophe
2008-Mar-11  20:04 UTC
[Rd] R-console vs. bash console (execution halted)
Dear Everyone,
I am using R 2.6.2 on my Redhat AS4. I installed the RPM offered on the cran
website. I would like to use R from my bash console with the following command:
 
/path/to/R --vanilla --slave --args < /data/myscript.R
 
this script invokes a range of functions and tools, among others to process a
bunch of raster images in a loop using GDAL. The thing is that releasing this
command in the bash results in the following error
 
 
Error in function (handle)  :
        GDAL Error 1: TIFFReadDirectory:/tmp/RtmpPCALnL/file265f67a6: cannot
handle zero scanline size
Calls: <Anonymous> -> .Call
Execution halted
The scripts halts, although there are more images to process. The question is
why the script halts and why the script is not halted (but still
"decorated" with errors) when releasing it within the R console like
so
 
R CMD source("/data/myscript.R")
 
The result of this R CMD is shown below. Note that the script is doing what it
is supposed to, despite the error it produces. The loop is completely finalized
 
Error in function (handle)  :
        GDAL Error 1: TIFFReadDirectory:/tmp/Rtmp6gXG5W/file67e9e074: cannot
handle zero scanline size
[1] "/data/someimg1.tiff"
Error in function (handle)  :
        GDAL Error 1: TIFFReadDirectory:/tmp/Rtmp6gXG5W/file21e4ef74: cannot
handle zero scanline size
[1] "/data/someimg2.tiff"
Error in function (handle)  :
        GDAL Error 1: TIFFReadDirectory:/tmp/Rtmp6gXG5W/file67e9e074: cannot
handle zero scanline size
[1] "/data/someimg3.tiff"
etc.
 
Obviously, the tmp directory is being deleted before the stored image in it can
be used. Does anybody know what to consider or provide when working in a
external console like bash and/or does anybody know about such halted executions
when working with GDAL?
Help is greatly appreciated,
 
Ciao,
Chris
 
_______________________________________________
Christophe Lienert  
ETH Zurich  
Institute of Cartography  
Wolfgang-Pauli-Str. 15  
HIL G 13.3  
CH-8093 Zurich
SWITZERLAND
Fon: +41-44-6333036  
Fax: +41-44-6331153 
www.karto.ethz.ch  
lienert at karto.baug.ethz.ch
<mailto:lienert at karto.baug.ethz.ch>
Prof Brian Ripley
2008-Mar-11  20:35 UTC
[Rd] R-console vs. bash console (execution halted)
Your first use is non-interactive.  I have no idea what
R CMD source("/data/myscript.R")
is supposed to do (it does not work for me), but source() when run in RGui 
is interactive.
See ?options and in particular 'error' and the reference to ?stop for
the
different ways errors are handled in interactive and non-interactive use.
On Tue, 11 Mar 2008, Lienert  Christophe wrote:
> Dear Everyone,
> I am using R 2.6.2 on my Redhat AS4. I installed the RPM offered on the
cran website. I would like to use R from my bash console with the following
command:
>
> /path/to/R --vanilla --slave --args < /data/myscript.R
>
> this script invokes a range of functions and tools, among others to process
a bunch of raster images in a loop using GDAL. The thing is that releasing this
command in the bash results in the following error
>
>
> Error in function (handle)  :
>        GDAL Error 1: TIFFReadDirectory:/tmp/RtmpPCALnL/file265f67a6: cannot
handle zero scanline size
> Calls: <Anonymous> -> .Call
> Execution halted
>
> The scripts halts, although there are more images to process. The question
is why the script halts and why the script is not halted (but still
"decorated" with errors) when releasing it within the R console like
so
>
> R CMD source("/data/myscript.R")
>
> The result of this R CMD is shown below. Note that the script is doing what
it is supposed to, despite the error it produces. The loop is completely
finalized
>
> Error in function (handle)  :
>        GDAL Error 1: TIFFReadDirectory:/tmp/Rtmp6gXG5W/file67e9e074: cannot
handle zero scanline size
> [1] "/data/someimg1.tiff"
> Error in function (handle)  :
>        GDAL Error 1: TIFFReadDirectory:/tmp/Rtmp6gXG5W/file21e4ef74: cannot
handle zero scanline size
> [1] "/data/someimg2.tiff"
> Error in function (handle)  :
>        GDAL Error 1: TIFFReadDirectory:/tmp/Rtmp6gXG5W/file67e9e074: cannot
handle zero scanline size
> [1] "/data/someimg3.tiff"
>
> etc.
>
> Obviously, the tmp directory is being deleted before the stored image in it
can be used. Does anybody know what to consider or provide when working in a
external console like bash and/or does anybody know about such halted executions
when working with GDAL?
> Help is greatly appreciated,
>
> Ciao,
> Chris
>
> _______________________________________________
> Christophe Lienert
> ETH Zurich
> Institute of Cartography
> Wolfgang-Pauli-Str. 15
> HIL G 13.3
> CH-8093 Zurich
> SWITZERLAND
>
> Fon: +41-44-6333036
> Fax: +41-44-6331153
> www.karto.ethz.ch
> lienert at karto.baug.ethz.ch
> <mailto:lienert at karto.baug.ethz.ch>
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595
Seemingly Similar Threads
- Re: SpanDSP TXFax and multipage faxes problems
- matrix matching NA
- Non-parametric test for repeated measures and post-hoc single comparisons in R?
- Two questions
- exact Wilcoxon signed rank test with ties and the "no longer under development" exactRanksumTests package