Displaying 1 result from an estimated 1 matches for "makea_warc".
2024 Nov 11
0
Matrix - querying dsCMatrix how to save it
...t;U"
..@ factors : list()
> nnzero(Awarcol)
[1] 326214
> object.size(Awarcol)
2235112 bytes
> object.size(as.matrix(Awarcol))
32256488 bytes
>
------------------------------------------------
Now, save it (as file to current working directory) via
saveRDS(Awarcol, file = "makeA_warc.rds")
## and that is *only* 110 Kbytes :
> file.size("makeA_warc.rds")
[1] 115288
Or restore it in a later R session
Amat.warcol <- readRDS("makeA_warc.rds")
> str(Awarc)
Loading required package: Matrix
Formal class 'dsCMatrix' [package "Matrix&q...