Fix documentation of as.matrix to reflect current behaviour#2935
Fix documentation of as.matrix to reflect current behaviour#2935HughParsonage wants to merge 4 commits intomasterfrom
Conversation
| row names of the returned \code{matrix}.} | ||
| \item{rownames}{optional, one of the following specifications of the row names: | ||
| \enumerate{ | ||
| \item If \code{length(rownames) == length(nrow(x))} then \code{rownames} itself |
There was a problem hiding this comment.
not sure but it might not be possible to use \item inside \item{}{... \enumerate{.}}. Probably best move to lower more descriptive sections.
There was a problem hiding this comment.
They can be definitely be nested. I separated them so that I could emphasize the first point later. Too OTT?
There was a problem hiding this comment.
so maybe incorrect number/placement of { somewhere. To debug locally use R CMD check data.table_1.11.5.tar.gz --no-tests so you should be able to nail it down much faster.
|
Out of continued curiosity, what aspect of base R is this consistent with? Thanks |
|
@malcook data.frame instead of data.table |
|
Just looking at this now, I actually agree with @malcook and hadn't considered the edge case where the data.table had only 1 row. |
|
#2938 now fixes this from a functionality point of view, i.e. making the functionality work the same when the data.table has only 1 row. |
|
@sritchie73 for the record, would you mind rejecting this pull request seeing as yours supersedes? |
|
Sure, didn't realise I had the power to do so! Closing this PR as it is superseded by PR #2938 |
Closes #2930 from the documentation aspect. There may be a case for
nrow(x) == 1prioritizing column indices, however I chose a documentation change rather than a code change as (a) it's already released, (b) it's consistent with base R.