> David Winsemius
> on Sat, 21 Oct 2017 09:05:38 -0700 writes:
>> On Oct 21, 2017, at 7:50 AM, Martin Maechler
wrote:
>>
>>> C W
>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes:
>>
>>> Thank you for your responses. I guess I don't feel
>>> alone
> C W
> on Fri, 20 Oct 2017 16:01:06 -0400 writes:
> Subsetting using [] vs. head(), gives different results.
> R code:
>> head(train$data, 5)
> [1] 0 0 1 0 0
The above is surprising ... and points to a bug somewhere.
It is different (and correct) after you do
re
> On Oct 21, 2017, at 7:50 AM, Martin Maechler
> wrote:
>
>> C W
>>on Fri, 20 Oct 2017 15:51:16 -0400 writes:
>
>> Thank you for your responses. I guess I don't feel
>> alone. I don't find the documentation go into any detail.
>
>> I also find it surprising that,
>
>>> object.s
> C W
> on Fri, 20 Oct 2017 15:51:16 -0400 writes:
> Thank you for your responses. I guess I don't feel
> alone. I don't find the documentation go into any detail.
> I also find it surprising that,
>> object.size(train$data)
> 1730904 bytes
>> object.size(a
Subsetting using [] vs. head(), gives different results.
R code:
> head(train$data, 5)
[1] 0 0 1 0 0
> train$data[1:5, 1:5]
5 x 5 sparse Matrix of class "dgCMatrix"
cap-shape=bell cap-shape=conical cap-shape=convex
[1,] . .1
[2,] .
Thank you for your responses.
I guess I don't feel alone. I don't find the documentation go into any
detail.
I also find it surprising that,
> object.size(train$data)
1730904 bytes
> object.size(as.matrix(train$data))
6575016 bytes
the dgCMatrix actually takes less memory, though it *looks* li
> On Oct 20, 2017, at 11:11 AM, C W wrote:
>
> Dear R list,
>
> I came across dgCMatrix. I believe this class is associated with sparse
> matrix.
Yes. See:
help('dgCMatrix-class', pack=Matrix)
If Martin Maechler happens to respond to this you should listen to him rather
than anything I wri
You should not really have worry about the internal structure of such a
thing - just treat it like a matrix. E.g.,
> train$data[1:3,1:3] # dots mean 0's
3 x 3 sparse Matrix of class "dgCMatrix"
cap-shape=bell cap-shape=conical cap-shape=convex
[1,] . .
8 matches
Mail list logo