[Rd] Possible bug, Rprof() and scan(pipe()) (PR#1140)
macq@llnl.gov
macq@llnl.gov
Tue, 23 Oct 2001 22:51:04 +0200 (MET DST)
This looks like a bug?
Unable to use scan(pipe()) while profiling.
I have no idea whether this version of R violates the
"do not use `Rprof' in an executable built for profiling"
warning in ?Rprof.
Thanks
-Don
> version
_
platform powerpc-apple-darwin1.4
arch powerpc
os darwin1.4
system powerpc, darwin1.4
status Patched
major 1
minor 3.1
year 2001
month 10
day 15
language R
>
> foo <- scan(pipe('ls -1 | head -3'),what='')
Read 3 items
> foo
[1] "README" "RMfiles.dat" "RMfiles.tmp"
> Rprof()
> foo <- scan(pipe('ls -1 | head -3'),what='')
Read 0 items
> foo
character(0)
> Rprof(NULL)
> foo <- scan(pipe('ls -1 | head -3'),what='')
Read 3 items
>
note, profiling does appear to be functional:
> Rprof() ; hist(rnorm(10000)) ; Rprof(NULL)
> system('R CMD Rprof Rprof.out')
Each sample represents 0.02 seconds.
Total run time: 0.1 seconds.
Total seconds: time spent in function and callees.
Self seconds: time spent in function alone.
% total % self
total seconds self seconds name
100.00 0.10 0.00 0.00 "hist"
60.00 0.06 0.00 0.00 "hist.default"
40.00 0.04 40.00 0.04 "rnorm"
40.00 0.04 0.00 0.00 "plot"
40.00 0.04 0.00 0.00 "plot.histogram"
20.00 0.02 0.00 0.00 "storage.mode<-"
20.00 0.02 20.00 0.02 "X11"
20.00 0.02 0.00 0.00 "paste"
20.00 0.02 0.00 0.00 "rect"
20.00 0.02 0.00 0.00 "plot.new"
20.00 0.02 20.00 0.02 "seq.default"
20.00 0.02 0.00 0.00 "seq"
20.00 0.02 20.00 0.02 "par"
% self % total
self seconds total seconds name
40.00 0.04 40.00 0.04 "rnorm"
20.00 0.02 20.00 0.02 "X11"
20.00 0.02 20.00 0.02 "seq.default"
20.00 0.02 20.00 0.02 "par"
--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
--------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._