[Rd] summaryRprof (PR#7137)

k.hansen at biostat.ku.dk k.hansen at biostat.ku.dk
Wed Jul 28 01:29:24 CEST 2004

Full_Name: Kasper Daniel Hansen
Version: 1.9.1
OS: linux
Submission from: (NULL) (

summaryRprof gives a very different result than R CMD Rprof. This is because
summaryRprof does not record calls starting with a dot, most notably .C calls.

Following a suggestion by P.Dalgaard I tried replacing the two ls calls with
ls(, all.names = TRUE). IE. the two lines

    totalt <- sapply(ls(envir = total), function(f) get(f, envir = total))
    selft <- sapply(ls(envir = self), function(f) get(f, envir = self))

was replaced with

    totalt <- sapply(ls(envir = total, all.names= TRUE), 
                     function(f) get(f, envir = total))
    selft <- sapply(ls(envir = self, all.names = TRUE), 
                    function(f) get(f, envir = self))

This seemed to solve the problem.

More information about the R-devel mailing list