Bug 16395 - summaryRprof(memory = "both") fails when there are just a few lines in the file
Summary: summaryRprof(memory = "both") fails when there are just a few lines in the file
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: R 3.2.0
Hardware: Other Linux
: P5 normal
Assignee: R-core
Depends on:
Reported: 2015-05-24 19:39 UTC by Benjamin Tyner
Modified: 2015-12-14 13:45 UTC (History)
1 user (show)

See Also:

test case (166 bytes, text/plain)
2015-05-24 19:39 UTC, Benjamin Tyner
the input file for summaryRprof (249 bytes, text/plain)
2015-05-24 19:40 UTC, Benjamin Tyner
test case for r68399 (179 bytes, text/plain)
2015-05-24 23:30 UTC, Benjamin Tyner

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Tyner 2015-05-24 19:39:10 UTC
Created attachment 1830 [details]
test case

I have attached a test case. The error is:

Error in memcounts[, 1L:2L] : incorrect number of dimensions
Calls: summaryRprof -> rowSums -> is.data.frame -> cbind
Execution halted
Comment 1 Benjamin Tyner 2015-05-24 19:40:53 UTC
Created attachment 1831 [details]
the input file for summaryRprof
Comment 2 Duncan Murdoch 2015-05-24 20:03:03 UTC
I don't get an error in 3.2.0 Patched r68272 on Mac OS X, or r68331 on Windows.  Could you please try R-patched?
Comment 3 Benjamin Tyner 2015-05-24 21:44:30 UTC
Agreed; tested fine in r68399. Apologies for the false alarm.
Comment 4 Benjamin Tyner 2015-05-24 23:30:34 UTC
Created attachment 1832 [details]
test case for r68399

I found a test case which still fails under r68399
Comment 5 Benjamin Tyner 2015-05-24 23:31:05 UTC
Found a new test case which still fails under r68399, see test2.R attachment.
Comment 6 Duncan Murdoch 2015-05-25 00:11:59 UTC
Got it this time.  The problem is an assumption in summaryRprof that apply(z, 1, diff) (for a complicated expression giving z) returns a matrix, but in your sample, it is simplified to a vector because there are only two columns.  Pretty easy to fix.  After a bit of testing I'll commit the fix to R-devel and R-patched.