| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-20 12:03 -0500 (Thu, 20 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4615 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4610 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4598 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4668 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.74.0 |
| Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz |
| StartedAt: 2025-11-18 01:15:15 -0500 (Tue, 18 Nov 2025) |
| EndedAt: 2025-11-18 01:17:04 -0500 (Tue, 18 Nov 2025) |
| EllapsedTime: 109.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.236 0.045 0.268
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Tue Nov 18 01:16:55 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Tue Nov 18 01:16:55 2025"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x55615889f3f0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Tue Nov 18 01:16:55 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Tue Nov 18 01:16:55 2025"
>
> ColMode(tmp2)
<pointer: 0x55615889f3f0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.7971623 0.5579055 -0.3800361 -0.1014494
[2,] 0.5636744 -1.2609478 -0.7567327 0.5024675
[3,] -1.3742408 -0.7570282 -0.6752223 1.0280168
[4,] 0.3326506 -0.7868449 -0.3872681 0.2025932
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.7971623 0.5579055 0.3800361 0.1014494
[2,] 0.5636744 1.2609478 0.7567327 0.5024675
[3,] 1.3742408 0.7570282 0.6752223 1.0280168
[4,] 0.3326506 0.7868449 0.3872681 0.2025932
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0397790 0.7469307 0.6164707 0.3185113
[2,] 0.7507825 1.1229193 0.8699038 0.7088494
[3,] 1.1722802 0.8700737 0.8217191 1.0139116
[4,] 0.5767587 0.8870428 0.6223087 0.4501036
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.19495 33.02721 31.54474 28.28656
[2,] 33.07150 37.49014 34.45577 32.59096
[3,] 38.09704 34.45776 33.89241 36.16713
[4,] 31.10024 34.65727 31.61036 29.70363
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x55615989ba30>
> exp(tmp5)
<pointer: 0x55615989ba30>
> log(tmp5,2)
<pointer: 0x55615989ba30>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.7952
> Min(tmp5)
[1] 53.67936
> mean(tmp5)
[1] 73.93406
> Sum(tmp5)
[1] 14786.81
> Var(tmp5)
[1] 872.2007
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.87958 74.10536 71.18187 70.82509 71.45102 71.98676 73.16500 72.72709
[9] 71.89779 71.12104
> rowSums(tmp5)
[1] 1817.592 1482.107 1423.637 1416.502 1429.020 1439.735 1463.300 1454.542
[9] 1437.956 1422.421
> rowVars(tmp5)
[1] 8045.06089 75.12446 31.71008 130.26282 70.51052 112.84914
[7] 84.99072 63.84156 66.49555 108.53519
> rowSd(tmp5)
[1] 89.694263 8.667437 5.631171 11.413274 8.397054 10.623048 9.219041
[8] 7.990092 8.154480 10.418022
> rowMax(tmp5)
[1] 470.79516 89.05971 81.62965 95.93829 86.98093 87.13021 92.52871
[8] 88.30272 88.80082 88.98785
> rowMin(tmp5)
[1] 58.87477 55.26205 61.07870 56.50770 53.67936 54.82863 58.48574 57.01395
[9] 55.06197 55.31700
>
> colMeans(tmp5)
[1] 112.70957 70.47900 71.28043 70.52622 78.57906 66.19867 75.81740
[8] 74.80264 71.27030 73.63579 68.98955 71.37848 72.21904 68.46673
[15] 77.65937 65.68401 69.75827 71.20016 75.35662 72.66991
> colSums(tmp5)
[1] 1127.0957 704.7900 712.8043 705.2622 785.7906 661.9867 758.1740
[8] 748.0264 712.7030 736.3579 689.8955 713.7848 722.1904 684.6673
[15] 776.5937 656.8401 697.5827 712.0016 753.5662 726.6991
> colVars(tmp5)
[1] 15872.18025 51.62507 48.23568 79.99657 52.68131 73.29096
[7] 46.69445 23.89721 123.68572 32.81554 101.56549 64.95024
[13] 70.29893 103.91126 125.03962 71.64847 89.46230 84.51072
[19] 127.60317 39.77069
> colSd(tmp5)
[1] 125.984841 7.185059 6.945191 8.944080 7.258189 8.561014
[7] 6.833334 4.888477 11.121408 5.728485 10.077970 8.059171
[13] 8.384446 10.193687 11.182112 8.464542 9.458451 9.192971
[19] 11.296157 6.306401
> colMax(tmp5)
[1] 470.79516 80.02390 82.83195 84.73939 91.81226 79.07437 85.16163
[8] 81.83187 88.98785 85.66414 84.49148 89.05971 85.01682 83.86190
[15] 92.52871 84.50287 86.17004 88.30272 95.93829 81.66023
> colMin(tmp5)
[1] 64.73107 56.57974 59.33375 58.87477 70.06498 54.82863 61.87092 68.17858
[9] 55.26205 66.37015 57.09079 59.20892 55.06197 53.67936 56.50770 55.31700
[17] 55.39143 61.12926 56.63823 64.97673
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 90.87958 74.10536 NA 70.82509 71.45102 71.98676 73.16500 72.72709
[9] 71.89779 71.12104
> rowSums(tmp5)
[1] 1817.592 1482.107 NA 1416.502 1429.020 1439.735 1463.300 1454.542
[9] 1437.956 1422.421
> rowVars(tmp5)
[1] 8045.06089 75.12446 27.56211 130.26282 70.51052 112.84914
[7] 84.99072 63.84156 66.49555 108.53519
> rowSd(tmp5)
[1] 89.694263 8.667437 5.249963 11.413274 8.397054 10.623048 9.219041
[8] 7.990092 8.154480 10.418022
> rowMax(tmp5)
[1] 470.79516 89.05971 NA 95.93829 86.98093 87.13021 92.52871
[8] 88.30272 88.80082 88.98785
> rowMin(tmp5)
[1] 58.87477 55.26205 NA 56.50770 53.67936 54.82863 58.48574 57.01395
[9] 55.06197 55.31700
>
> colMeans(tmp5)
[1] 112.70957 70.47900 71.28043 70.52622 78.57906 66.19867 75.81740
[8] 74.80264 71.27030 73.63579 68.98955 71.37848 72.21904 68.46673
[15] 77.65937 65.68401 69.75827 NA 75.35662 72.66991
> colSums(tmp5)
[1] 1127.0957 704.7900 712.8043 705.2622 785.7906 661.9867 758.1740
[8] 748.0264 712.7030 736.3579 689.8955 713.7848 722.1904 684.6673
[15] 776.5937 656.8401 697.5827 NA 753.5662 726.6991
> colVars(tmp5)
[1] 15872.18025 51.62507 48.23568 79.99657 52.68131 73.29096
[7] 46.69445 23.89721 123.68572 32.81554 101.56549 64.95024
[13] 70.29893 103.91126 125.03962 71.64847 89.46230 NA
[19] 127.60317 39.77069
> colSd(tmp5)
[1] 125.984841 7.185059 6.945191 8.944080 7.258189 8.561014
[7] 6.833334 4.888477 11.121408 5.728485 10.077970 8.059171
[13] 8.384446 10.193687 11.182112 8.464542 9.458451 NA
[19] 11.296157 6.306401
> colMax(tmp5)
[1] 470.79516 80.02390 82.83195 84.73939 91.81226 79.07437 85.16163
[8] 81.83187 88.98785 85.66414 84.49148 89.05971 85.01682 83.86190
[15] 92.52871 84.50287 86.17004 NA 95.93829 81.66023
> colMin(tmp5)
[1] 64.73107 56.57974 59.33375 58.87477 70.06498 54.82863 61.87092 68.17858
[9] 55.26205 66.37015 57.09079 59.20892 55.06197 53.67936 56.50770 55.31700
[17] 55.39143 NA 56.63823 64.97673
>
> Max(tmp5,na.rm=TRUE)
[1] 470.7952
> Min(tmp5,na.rm=TRUE)
[1] 53.67936
> mean(tmp5,na.rm=TRUE)
[1] 73.99841
> Sum(tmp5,na.rm=TRUE)
[1] 14725.68
> Var(tmp5,na.rm=TRUE)
[1] 875.7735
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.87958 74.10536 71.71095 70.82509 71.45102 71.98676 73.16500 72.72709
[9] 71.89779 71.12104
> rowSums(tmp5,na.rm=TRUE)
[1] 1817.592 1482.107 1362.508 1416.502 1429.020 1439.735 1463.300 1454.542
[9] 1437.956 1422.421
> rowVars(tmp5,na.rm=TRUE)
[1] 8045.06089 75.12446 27.56211 130.26282 70.51052 112.84914
[7] 84.99072 63.84156 66.49555 108.53519
> rowSd(tmp5,na.rm=TRUE)
[1] 89.694263 8.667437 5.249963 11.413274 8.397054 10.623048 9.219041
[8] 7.990092 8.154480 10.418022
> rowMax(tmp5,na.rm=TRUE)
[1] 470.79516 89.05971 81.62965 95.93829 86.98093 87.13021 92.52871
[8] 88.30272 88.80082 88.98785
> rowMin(tmp5,na.rm=TRUE)
[1] 58.87477 55.26205 61.07870 56.50770 53.67936 54.82863 58.48574 57.01395
[9] 55.06197 55.31700
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.70957 70.47900 71.28043 70.52622 78.57906 66.19867 75.81740
[8] 74.80264 71.27030 73.63579 68.98955 71.37848 72.21904 68.46673
[15] 77.65937 65.68401 69.75827 72.31915 75.35662 72.66991
> colSums(tmp5,na.rm=TRUE)
[1] 1127.0957 704.7900 712.8043 705.2622 785.7906 661.9867 758.1740
[8] 748.0264 712.7030 736.3579 689.8955 713.7848 722.1904 684.6673
[15] 776.5937 656.8401 697.5827 650.8723 753.5662 726.6991
> colVars(tmp5,na.rm=TRUE)
[1] 15872.18025 51.62507 48.23568 79.99657 52.68131 73.29096
[7] 46.69445 23.89721 123.68572 32.81554 101.56549 64.95024
[13] 70.29893 103.91126 125.03962 71.64847 89.46230 80.98801
[19] 127.60317 39.77069
> colSd(tmp5,na.rm=TRUE)
[1] 125.984841 7.185059 6.945191 8.944080 7.258189 8.561014
[7] 6.833334 4.888477 11.121408 5.728485 10.077970 8.059171
[13] 8.384446 10.193687 11.182112 8.464542 9.458451 8.999334
[19] 11.296157 6.306401
> colMax(tmp5,na.rm=TRUE)
[1] 470.79516 80.02390 82.83195 84.73939 91.81226 79.07437 85.16163
[8] 81.83187 88.98785 85.66414 84.49148 89.05971 85.01682 83.86190
[15] 92.52871 84.50287 86.17004 88.30272 95.93829 81.66023
> colMin(tmp5,na.rm=TRUE)
[1] 64.73107 56.57974 59.33375 58.87477 70.06498 54.82863 61.87092 68.17858
[9] 55.26205 66.37015 57.09079 59.20892 55.06197 53.67936 56.50770 55.31700
[17] 55.39143 62.17302 56.63823 64.97673
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.87958 74.10536 NaN 70.82509 71.45102 71.98676 73.16500 72.72709
[9] 71.89779 71.12104
> rowSums(tmp5,na.rm=TRUE)
[1] 1817.592 1482.107 0.000 1416.502 1429.020 1439.735 1463.300 1454.542
[9] 1437.956 1422.421
> rowVars(tmp5,na.rm=TRUE)
[1] 8045.06089 75.12446 NA 130.26282 70.51052 112.84914
[7] 84.99072 63.84156 66.49555 108.53519
> rowSd(tmp5,na.rm=TRUE)
[1] 89.694263 8.667437 NA 11.413274 8.397054 10.623048 9.219041
[8] 7.990092 8.154480 10.418022
> rowMax(tmp5,na.rm=TRUE)
[1] 470.79516 89.05971 NA 95.93829 86.98093 87.13021 92.52871
[8] 88.30272 88.80082 88.98785
> rowMin(tmp5,na.rm=TRUE)
[1] 58.87477 55.26205 NA 56.50770 53.67936 54.82863 58.48574 57.01395
[9] 55.06197 55.31700
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.42241 70.34119 71.36241 69.99834 79.52507 66.76755 76.44166
[8] 74.04408 71.96477 73.65185 68.43937 71.23195 71.70633 68.64227
[15] 78.49737 65.18895 68.74868 NaN 75.98333 73.52048
> colSums(tmp5,na.rm=TRUE)
[1] 1047.8017 633.0707 642.2617 629.9851 715.7256 600.9080 687.9749
[8] 666.3967 647.6829 662.8667 615.9543 641.0876 645.3570 617.7804
[15] 706.4763 586.7005 618.7382 0.0000 683.8499 661.6843
> colVars(tmp5,na.rm=TRUE)
[1] 17701.11944 57.86454 54.18953 86.86124 49.19848 78.81149
[7] 48.14715 20.41101 133.72067 36.91458 110.85581 72.82748
[13] 76.12891 116.55350 132.76934 77.84729 89.17828 NA
[19] 139.13493 36.60295
> colSd(tmp5,na.rm=TRUE)
[1] 133.045554 7.606874 7.361354 9.319938 7.014163 8.877583
[7] 6.938815 4.517855 11.563765 6.075737 10.528809 8.533902
[13] 8.725188 10.795994 11.522558 8.823111 9.443425 NA
[19] 11.795547 6.050038
> colMax(tmp5,na.rm=TRUE)
[1] 470.79516 80.02390 82.83195 84.73939 91.81226 79.07437 85.16163
[8] 81.83187 88.98785 85.66414 84.49148 89.05971 85.01682 83.86190
[15] 92.52871 84.50287 86.17004 -Inf 95.93829 81.66023
> colMin(tmp5,na.rm=TRUE)
[1] 64.73107 56.57974 59.33375 58.87477 72.40528 54.82863 61.87092 68.17858
[9] 55.26205 66.37015 57.09079 59.20892 55.06197 53.67936 56.50770 55.31700
[17] 55.39143 Inf 56.63823 64.97673
>
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col <- 1
> cat(which.row," ",which.col,"\n")
3 1
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> rowVars(tmp5,na.rm=TRUE)
[1] 229.3031 109.9601 230.7711 176.9312 115.3924 189.8273 328.6498 301.2590
[9] 430.5982 142.5809
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 229.3031 109.9601 230.7711 176.9312 115.3924 189.8273 328.6498 301.2590
[9] 430.5982 142.5809
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 4.263256e-14 -2.842171e-14 4.263256e-14 2.273737e-13 0.000000e+00
[6] 5.684342e-14 0.000000e+00 0.000000e+00 1.421085e-13 5.684342e-14
[11] -5.684342e-14 -2.842171e-14 5.684342e-14 -2.415845e-13 5.684342e-14
[16] 5.684342e-14 5.684342e-14 1.207923e-13 -8.526513e-14 -5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
7 1
2 19
10 11
7 6
3 10
1 6
8 4
8 10
10 7
10 19
2 11
10 19
3 12
1 10
3 15
8 1
1 12
10 12
7 10
3 7
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.583996
> Min(tmp)
[1] -2.442951
> mean(tmp)
[1] -0.1151953
> Sum(tmp)
[1] -11.51953
> Var(tmp)
[1] 0.9527939
>
> rowMeans(tmp)
[1] -0.1151953
> rowSums(tmp)
[1] -11.51953
> rowVars(tmp)
[1] 0.9527939
> rowSd(tmp)
[1] 0.9761116
> rowMax(tmp)
[1] 2.583996
> rowMin(tmp)
[1] -2.442951
>
> colMeans(tmp)
[1] 0.39741187 0.27779283 -1.69663506 -0.13433156 -0.48789352 0.54724045
[7] 0.85458292 0.64611140 0.75892545 0.19736775 -0.39996141 -0.79619392
[13] 1.91567920 -0.42677074 0.08314980 0.26368058 -1.99010020 -0.22686416
[19] -0.95620904 0.60850509 -1.51803749 1.22887234 -0.04864266 -1.40591081
[25] 1.25456924 -0.53840605 -0.82570461 0.34675124 -0.26236716 -1.34556604
[31] -1.16068057 -0.88602523 1.41272341 -0.15913881 0.73906778 0.86844815
[37] 0.56008609 0.83983615 -0.45480407 1.06680010 0.75427231 -0.64369390
[43] -0.30947495 -1.22612774 0.93837541 0.90009146 0.11910879 0.87333547
[49] 0.31181417 0.91760627 -0.52548800 -2.02109947 -0.85470272 -1.57866919
[55] 0.03048474 0.35438468 -1.71817003 -1.18466649 -0.08398018 0.31817265
[61] -0.76800258 -0.41646709 0.06908282 0.29619804 0.22641430 1.42449155
[67] -1.08138490 -0.32921273 -1.55689824 1.15074663 -0.32476017 0.63840516
[73] -0.46921964 1.56471203 -0.67817475 0.34598218 -0.26893685 -0.19142564
[79] 0.34148205 -0.99396669 -0.92000900 0.75730420 -0.46579669 2.58399611
[85] 0.43406022 -0.52978990 -0.82271441 -1.61732889 -1.66054901 0.58267540
[91] -2.44295064 0.84438767 -0.03993450 -0.17297968 -1.67578407 0.90250303
[97] -0.64452595 0.52996913 -1.83406253 1.17400524
> colSums(tmp)
[1] 0.39741187 0.27779283 -1.69663506 -0.13433156 -0.48789352 0.54724045
[7] 0.85458292 0.64611140 0.75892545 0.19736775 -0.39996141 -0.79619392
[13] 1.91567920 -0.42677074 0.08314980 0.26368058 -1.99010020 -0.22686416
[19] -0.95620904 0.60850509 -1.51803749 1.22887234 -0.04864266 -1.40591081
[25] 1.25456924 -0.53840605 -0.82570461 0.34675124 -0.26236716 -1.34556604
[31] -1.16068057 -0.88602523 1.41272341 -0.15913881 0.73906778 0.86844815
[37] 0.56008609 0.83983615 -0.45480407 1.06680010 0.75427231 -0.64369390
[43] -0.30947495 -1.22612774 0.93837541 0.90009146 0.11910879 0.87333547
[49] 0.31181417 0.91760627 -0.52548800 -2.02109947 -0.85470272 -1.57866919
[55] 0.03048474 0.35438468 -1.71817003 -1.18466649 -0.08398018 0.31817265
[61] -0.76800258 -0.41646709 0.06908282 0.29619804 0.22641430 1.42449155
[67] -1.08138490 -0.32921273 -1.55689824 1.15074663 -0.32476017 0.63840516
[73] -0.46921964 1.56471203 -0.67817475 0.34598218 -0.26893685 -0.19142564
[79] 0.34148205 -0.99396669 -0.92000900 0.75730420 -0.46579669 2.58399611
[85] 0.43406022 -0.52978990 -0.82271441 -1.61732889 -1.66054901 0.58267540
[91] -2.44295064 0.84438767 -0.03993450 -0.17297968 -1.67578407 0.90250303
[97] -0.64452595 0.52996913 -1.83406253 1.17400524
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] 0.39741187 0.27779283 -1.69663506 -0.13433156 -0.48789352 0.54724045
[7] 0.85458292 0.64611140 0.75892545 0.19736775 -0.39996141 -0.79619392
[13] 1.91567920 -0.42677074 0.08314980 0.26368058 -1.99010020 -0.22686416
[19] -0.95620904 0.60850509 -1.51803749 1.22887234 -0.04864266 -1.40591081
[25] 1.25456924 -0.53840605 -0.82570461 0.34675124 -0.26236716 -1.34556604
[31] -1.16068057 -0.88602523 1.41272341 -0.15913881 0.73906778 0.86844815
[37] 0.56008609 0.83983615 -0.45480407 1.06680010 0.75427231 -0.64369390
[43] -0.30947495 -1.22612774 0.93837541 0.90009146 0.11910879 0.87333547
[49] 0.31181417 0.91760627 -0.52548800 -2.02109947 -0.85470272 -1.57866919
[55] 0.03048474 0.35438468 -1.71817003 -1.18466649 -0.08398018 0.31817265
[61] -0.76800258 -0.41646709 0.06908282 0.29619804 0.22641430 1.42449155
[67] -1.08138490 -0.32921273 -1.55689824 1.15074663 -0.32476017 0.63840516
[73] -0.46921964 1.56471203 -0.67817475 0.34598218 -0.26893685 -0.19142564
[79] 0.34148205 -0.99396669 -0.92000900 0.75730420 -0.46579669 2.58399611
[85] 0.43406022 -0.52978990 -0.82271441 -1.61732889 -1.66054901 0.58267540
[91] -2.44295064 0.84438767 -0.03993450 -0.17297968 -1.67578407 0.90250303
[97] -0.64452595 0.52996913 -1.83406253 1.17400524
> colMin(tmp)
[1] 0.39741187 0.27779283 -1.69663506 -0.13433156 -0.48789352 0.54724045
[7] 0.85458292 0.64611140 0.75892545 0.19736775 -0.39996141 -0.79619392
[13] 1.91567920 -0.42677074 0.08314980 0.26368058 -1.99010020 -0.22686416
[19] -0.95620904 0.60850509 -1.51803749 1.22887234 -0.04864266 -1.40591081
[25] 1.25456924 -0.53840605 -0.82570461 0.34675124 -0.26236716 -1.34556604
[31] -1.16068057 -0.88602523 1.41272341 -0.15913881 0.73906778 0.86844815
[37] 0.56008609 0.83983615 -0.45480407 1.06680010 0.75427231 -0.64369390
[43] -0.30947495 -1.22612774 0.93837541 0.90009146 0.11910879 0.87333547
[49] 0.31181417 0.91760627 -0.52548800 -2.02109947 -0.85470272 -1.57866919
[55] 0.03048474 0.35438468 -1.71817003 -1.18466649 -0.08398018 0.31817265
[61] -0.76800258 -0.41646709 0.06908282 0.29619804 0.22641430 1.42449155
[67] -1.08138490 -0.32921273 -1.55689824 1.15074663 -0.32476017 0.63840516
[73] -0.46921964 1.56471203 -0.67817475 0.34598218 -0.26893685 -0.19142564
[79] 0.34148205 -0.99396669 -0.92000900 0.75730420 -0.46579669 2.58399611
[85] 0.43406022 -0.52978990 -0.82271441 -1.61732889 -1.66054901 0.58267540
[91] -2.44295064 0.84438767 -0.03993450 -0.17297968 -1.67578407 0.90250303
[97] -0.64452595 0.52996913 -1.83406253 1.17400524
> colMedians(tmp)
[1] 0.39741187 0.27779283 -1.69663506 -0.13433156 -0.48789352 0.54724045
[7] 0.85458292 0.64611140 0.75892545 0.19736775 -0.39996141 -0.79619392
[13] 1.91567920 -0.42677074 0.08314980 0.26368058 -1.99010020 -0.22686416
[19] -0.95620904 0.60850509 -1.51803749 1.22887234 -0.04864266 -1.40591081
[25] 1.25456924 -0.53840605 -0.82570461 0.34675124 -0.26236716 -1.34556604
[31] -1.16068057 -0.88602523 1.41272341 -0.15913881 0.73906778 0.86844815
[37] 0.56008609 0.83983615 -0.45480407 1.06680010 0.75427231 -0.64369390
[43] -0.30947495 -1.22612774 0.93837541 0.90009146 0.11910879 0.87333547
[49] 0.31181417 0.91760627 -0.52548800 -2.02109947 -0.85470272 -1.57866919
[55] 0.03048474 0.35438468 -1.71817003 -1.18466649 -0.08398018 0.31817265
[61] -0.76800258 -0.41646709 0.06908282 0.29619804 0.22641430 1.42449155
[67] -1.08138490 -0.32921273 -1.55689824 1.15074663 -0.32476017 0.63840516
[73] -0.46921964 1.56471203 -0.67817475 0.34598218 -0.26893685 -0.19142564
[79] 0.34148205 -0.99396669 -0.92000900 0.75730420 -0.46579669 2.58399611
[85] 0.43406022 -0.52978990 -0.82271441 -1.61732889 -1.66054901 0.58267540
[91] -2.44295064 0.84438767 -0.03993450 -0.17297968 -1.67578407 0.90250303
[97] -0.64452595 0.52996913 -1.83406253 1.17400524
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.3974119 0.2777928 -1.696635 -0.1343316 -0.4878935 0.5472404 0.8545829
[2,] 0.3974119 0.2777928 -1.696635 -0.1343316 -0.4878935 0.5472404 0.8545829
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.6461114 0.7589254 0.1973677 -0.3999614 -0.7961939 1.915679 -0.4267707
[2,] 0.6461114 0.7589254 0.1973677 -0.3999614 -0.7961939 1.915679 -0.4267707
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.0831498 0.2636806 -1.9901 -0.2268642 -0.956209 0.6085051 -1.518037
[2,] 0.0831498 0.2636806 -1.9901 -0.2268642 -0.956209 0.6085051 -1.518037
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.228872 -0.04864266 -1.405911 1.254569 -0.5384061 -0.8257046 0.3467512
[2,] 1.228872 -0.04864266 -1.405911 1.254569 -0.5384061 -0.8257046 0.3467512
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.2623672 -1.345566 -1.160681 -0.8860252 1.412723 -0.1591388 0.7390678
[2,] -0.2623672 -1.345566 -1.160681 -0.8860252 1.412723 -0.1591388 0.7390678
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.8684482 0.5600861 0.8398361 -0.4548041 1.0668 0.7542723 -0.6436939
[2,] 0.8684482 0.5600861 0.8398361 -0.4548041 1.0668 0.7542723 -0.6436939
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.309475 -1.226128 0.9383754 0.9000915 0.1191088 0.8733355 0.3118142
[2,] -0.309475 -1.226128 0.9383754 0.9000915 0.1191088 0.8733355 0.3118142
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.9176063 -0.525488 -2.021099 -0.8547027 -1.578669 0.03048474 0.3543847
[2,] 0.9176063 -0.525488 -2.021099 -0.8547027 -1.578669 0.03048474 0.3543847
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.71817 -1.184666 -0.08398018 0.3181726 -0.7680026 -0.4164671 0.06908282
[2,] -1.71817 -1.184666 -0.08398018 0.3181726 -0.7680026 -0.4164671 0.06908282
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.296198 0.2264143 1.424492 -1.081385 -0.3292127 -1.556898 1.150747
[2,] 0.296198 0.2264143 1.424492 -1.081385 -0.3292127 -1.556898 1.150747
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.3247602 0.6384052 -0.4692196 1.564712 -0.6781748 0.3459822 -0.2689369
[2,] -0.3247602 0.6384052 -0.4692196 1.564712 -0.6781748 0.3459822 -0.2689369
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.1914256 0.341482 -0.9939667 -0.920009 0.7573042 -0.4657967 2.583996
[2,] -0.1914256 0.341482 -0.9939667 -0.920009 0.7573042 -0.4657967 2.583996
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.4340602 -0.5297899 -0.8227144 -1.617329 -1.660549 0.5826754 -2.442951
[2,] 0.4340602 -0.5297899 -0.8227144 -1.617329 -1.660549 0.5826754 -2.442951
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.8443877 -0.0399345 -0.1729797 -1.675784 0.902503 -0.6445259 0.5299691
[2,] 0.8443877 -0.0399345 -0.1729797 -1.675784 0.902503 -0.6445259 0.5299691
[,99] [,100]
[1,] -1.834063 1.174005
[2,] -1.834063 1.174005
>
>
> Max(tmp2)
[1] 2.034194
> Min(tmp2)
[1] -2.383303
> mean(tmp2)
[1] -0.01606876
> Sum(tmp2)
[1] -1.606876
> Var(tmp2)
[1] 0.9895767
>
> rowMeans(tmp2)
[1] -0.06011618 0.58384090 1.30850074 -0.02379362 0.41823873 -0.41331563
[7] -0.56285620 0.30550157 0.64481261 -0.36126406 2.01547241 0.21817769
[13] -0.78082899 -0.53396150 0.30428190 -0.51616289 -1.13124482 1.01190537
[19] 0.72224346 -0.05766578 -1.29483128 -1.32026969 0.27203704 0.65259693
[25] -1.45116994 -2.04072120 0.18418659 -0.21657007 0.60644373 -2.09433966
[31] -0.14985928 -1.81935027 -0.56609468 -1.67768882 -0.42249212 0.91196654
[37] 0.38856560 -0.62475477 -1.51937778 1.21535027 -0.35395888 0.57530269
[43] -0.91838011 -0.32794146 1.81749956 -1.52199806 -0.25325232 -0.21823755
[49] 1.78923811 0.16513607 1.50302996 -0.23315270 0.75886990 1.30817372
[55] 1.62612784 -0.18404604 -0.39403873 -0.90230489 -0.18000688 1.90798308
[61] -0.19620394 -1.20668299 0.88694299 0.49448814 -0.05874950 0.03172045
[67] -0.46938581 -0.52027048 0.01330780 -0.46965424 1.94244377 -0.53342976
[73] 0.22925799 0.74498437 -1.79386654 1.83263226 1.40069487 -0.15240662
[79] -0.19148857 -0.60128384 -0.99174797 -0.01087739 1.24554161 0.71925233
[85] 2.03419442 -1.14605765 -0.64890253 1.07691200 -0.17784812 -0.49219514
[91] 0.14805437 -0.76388928 1.30046747 -2.38330349 -0.60595975 -0.08659854
[97] -0.86477113 0.08674784 -0.42099028 0.90260826
> rowSums(tmp2)
[1] -0.06011618 0.58384090 1.30850074 -0.02379362 0.41823873 -0.41331563
[7] -0.56285620 0.30550157 0.64481261 -0.36126406 2.01547241 0.21817769
[13] -0.78082899 -0.53396150 0.30428190 -0.51616289 -1.13124482 1.01190537
[19] 0.72224346 -0.05766578 -1.29483128 -1.32026969 0.27203704 0.65259693
[25] -1.45116994 -2.04072120 0.18418659 -0.21657007 0.60644373 -2.09433966
[31] -0.14985928 -1.81935027 -0.56609468 -1.67768882 -0.42249212 0.91196654
[37] 0.38856560 -0.62475477 -1.51937778 1.21535027 -0.35395888 0.57530269
[43] -0.91838011 -0.32794146 1.81749956 -1.52199806 -0.25325232 -0.21823755
[49] 1.78923811 0.16513607 1.50302996 -0.23315270 0.75886990 1.30817372
[55] 1.62612784 -0.18404604 -0.39403873 -0.90230489 -0.18000688 1.90798308
[61] -0.19620394 -1.20668299 0.88694299 0.49448814 -0.05874950 0.03172045
[67] -0.46938581 -0.52027048 0.01330780 -0.46965424 1.94244377 -0.53342976
[73] 0.22925799 0.74498437 -1.79386654 1.83263226 1.40069487 -0.15240662
[79] -0.19148857 -0.60128384 -0.99174797 -0.01087739 1.24554161 0.71925233
[85] 2.03419442 -1.14605765 -0.64890253 1.07691200 -0.17784812 -0.49219514
[91] 0.14805437 -0.76388928 1.30046747 -2.38330349 -0.60595975 -0.08659854
[97] -0.86477113 0.08674784 -0.42099028 0.90260826
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -0.06011618 0.58384090 1.30850074 -0.02379362 0.41823873 -0.41331563
[7] -0.56285620 0.30550157 0.64481261 -0.36126406 2.01547241 0.21817769
[13] -0.78082899 -0.53396150 0.30428190 -0.51616289 -1.13124482 1.01190537
[19] 0.72224346 -0.05766578 -1.29483128 -1.32026969 0.27203704 0.65259693
[25] -1.45116994 -2.04072120 0.18418659 -0.21657007 0.60644373 -2.09433966
[31] -0.14985928 -1.81935027 -0.56609468 -1.67768882 -0.42249212 0.91196654
[37] 0.38856560 -0.62475477 -1.51937778 1.21535027 -0.35395888 0.57530269
[43] -0.91838011 -0.32794146 1.81749956 -1.52199806 -0.25325232 -0.21823755
[49] 1.78923811 0.16513607 1.50302996 -0.23315270 0.75886990 1.30817372
[55] 1.62612784 -0.18404604 -0.39403873 -0.90230489 -0.18000688 1.90798308
[61] -0.19620394 -1.20668299 0.88694299 0.49448814 -0.05874950 0.03172045
[67] -0.46938581 -0.52027048 0.01330780 -0.46965424 1.94244377 -0.53342976
[73] 0.22925799 0.74498437 -1.79386654 1.83263226 1.40069487 -0.15240662
[79] -0.19148857 -0.60128384 -0.99174797 -0.01087739 1.24554161 0.71925233
[85] 2.03419442 -1.14605765 -0.64890253 1.07691200 -0.17784812 -0.49219514
[91] 0.14805437 -0.76388928 1.30046747 -2.38330349 -0.60595975 -0.08659854
[97] -0.86477113 0.08674784 -0.42099028 0.90260826
> rowMin(tmp2)
[1] -0.06011618 0.58384090 1.30850074 -0.02379362 0.41823873 -0.41331563
[7] -0.56285620 0.30550157 0.64481261 -0.36126406 2.01547241 0.21817769
[13] -0.78082899 -0.53396150 0.30428190 -0.51616289 -1.13124482 1.01190537
[19] 0.72224346 -0.05766578 -1.29483128 -1.32026969 0.27203704 0.65259693
[25] -1.45116994 -2.04072120 0.18418659 -0.21657007 0.60644373 -2.09433966
[31] -0.14985928 -1.81935027 -0.56609468 -1.67768882 -0.42249212 0.91196654
[37] 0.38856560 -0.62475477 -1.51937778 1.21535027 -0.35395888 0.57530269
[43] -0.91838011 -0.32794146 1.81749956 -1.52199806 -0.25325232 -0.21823755
[49] 1.78923811 0.16513607 1.50302996 -0.23315270 0.75886990 1.30817372
[55] 1.62612784 -0.18404604 -0.39403873 -0.90230489 -0.18000688 1.90798308
[61] -0.19620394 -1.20668299 0.88694299 0.49448814 -0.05874950 0.03172045
[67] -0.46938581 -0.52027048 0.01330780 -0.46965424 1.94244377 -0.53342976
[73] 0.22925799 0.74498437 -1.79386654 1.83263226 1.40069487 -0.15240662
[79] -0.19148857 -0.60128384 -0.99174797 -0.01087739 1.24554161 0.71925233
[85] 2.03419442 -1.14605765 -0.64890253 1.07691200 -0.17784812 -0.49219514
[91] 0.14805437 -0.76388928 1.30046747 -2.38330349 -0.60595975 -0.08659854
[97] -0.86477113 0.08674784 -0.42099028 0.90260826
>
> colMeans(tmp2)
[1] -0.01606876
> colSums(tmp2)
[1] -1.606876
> colVars(tmp2)
[1] 0.9895767
> colSd(tmp2)
[1] 0.9947747
> colMax(tmp2)
[1] 2.034194
> colMin(tmp2)
[1] -2.383303
> colMedians(tmp2)
[1] -0.1511329
> colRanges(tmp2)
[,1]
[1,] -2.383303
[2,] 2.034194
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.631591 -3.078515 -7.748142 2.144673 1.945330 1.444812 3.979044
[8] 2.849708 9.116490 2.871171
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.4341577
[2,] -0.3885743
[3,] 0.4288390
[4,] 1.1426611
[5,] 2.0587325
>
> rowApply(tmp,sum)
[1] 8.7519235 1.1901968 -0.4609681 2.8918374 4.8978886 -3.4676233
[7] -0.1464192 -4.7338915 1.1941081 6.0391095
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 10 8 2 9 1 5 8 3 9
[2,] 5 1 10 1 5 5 3 7 6 2
[3,] 2 7 6 6 1 2 8 1 2 1
[4,] 3 6 9 4 7 4 1 4 9 10
[5,] 7 9 5 10 2 6 7 3 4 8
[6,] 8 8 1 5 8 10 2 6 1 3
[7,] 4 3 3 9 6 3 4 5 10 6
[8,] 9 2 2 8 4 8 9 2 7 5
[9,] 10 5 7 7 3 9 6 10 8 4
[10,] 1 4 4 3 10 7 10 9 5 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.28576666 1.94970622 1.17764592 0.24001827 -1.03941706 1.14265778
[7] -0.71820538 -3.52043951 1.10116805 1.08756816 3.39085364 0.42218035
[13] 1.99652908 3.34185822 1.14345986 -0.64558398 -4.39794491 1.00179234
[19] 3.01009010 -0.03144827
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1008093
[2,] -0.4080146
[3,] -0.1309026
[4,] -0.1283421
[5,] 0.4823020
>
> rowApply(tmp,sum)
[1] 2.917672 1.483082 3.664298 -2.937020 4.238690
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 8 15 4 4 6
[2,] 18 14 14 11 10
[3,] 16 2 5 17 14
[4,] 2 17 6 10 16
[5,] 3 9 7 5 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.1283421 1.15086391 0.9351360 -1.45526826 -0.5767592 0.8910855
[2,] 0.4823020 0.19812477 -0.9072460 1.17194032 -0.3493767 -0.4594959
[3,] -0.4080146 0.44364493 -0.4006522 -0.33160401 -0.3105971 0.4644302
[4,] -1.1008093 0.05136818 0.7835636 -0.08211027 -0.9583671 -0.5904899
[5,] -0.1309026 0.10570443 0.7668445 0.93706048 1.1556830 0.8371279
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.51629291 -0.1112663 0.65123069 -1.9907606 1.3207289 0.33565831
[2,] -0.43121941 -0.1891545 0.08367385 -0.4389724 0.6214885 -0.26436130
[3,] -0.42175786 -0.2318041 1.52392596 1.3465107 -0.2420211 -0.07683982
[4,] 0.58185837 -0.9412300 -0.85019523 1.5713004 1.0350565 0.24130047
[5,] 0.06920643 -2.0469845 -0.30746723 0.5994901 0.6556008 0.18642268
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.1821023 1.1236012 -0.1972912 1.18599618 -0.3271527 0.75384554
[2,] 1.4149865 1.9048508 -0.9508193 -0.78368405 -0.4606756 1.77499448
[3,] 0.5376447 0.2553129 -0.1426743 0.38622082 -0.7334822 -0.69265582
[4,] -1.1133659 0.3500156 0.8993424 -1.37650918 -1.7599398 -0.78409171
[5,] 0.9751615 -0.2919223 1.5349023 -0.05760775 -1.1166947 -0.05030015
[,19] [,20]
[1,] -0.09320033 -0.2162425
[2,] -0.17622811 -0.7580463
[3,] 1.49151971 1.2071913
[4,] 0.46682883 0.6394537
[5,] 1.32117000 -0.9038045
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.6706024 0.8799445 0.2679055 -0.2015006 0.3226865 0.7781795 -0.582054
col8 col9 col10 col11 col12 col13 col14
row1 1.055702 0.943605 -0.3063009 1.464411 -0.3675115 1.408168 -0.7933276
col15 col16 col17 col18 col19 col20
row1 -0.9062131 -0.06121407 0.9644609 0.8026592 -0.2479186 -0.02847755
> tmp[,"col10"]
col10
row1 -0.30630086
row2 -0.94989964
row3 0.08139081
row4 0.55280248
row5 0.31772362
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.6706024 0.8799445 0.2679055 -0.2015006 0.3226865 0.7781795 -0.5820540
row5 1.0999122 -1.1489662 0.3680165 0.1393130 1.9178335 -0.4014055 0.5651777
col8 col9 col10 col11 col12 col13
row1 1.0557024 0.9436050 -0.3063009 1.4644113 -0.3675115 1.4081676
row5 -0.2482092 0.4042413 0.3177236 -0.3168515 -0.1181606 -0.5639411
col14 col15 col16 col17 col18 col19
row1 -0.7933276 -0.9062131 -0.06121407 0.9644609 0.8026592 -0.2479186
row5 -2.7209887 -1.3996709 0.49641915 0.6190513 0.5612380 0.3418519
col20
row1 -0.02847755
row5 0.29681568
> tmp[,c("col6","col20")]
col6 col20
row1 0.7781795 -0.02847755
row2 0.2182876 -0.13721087
row3 0.4399381 0.32669105
row4 2.0002795 -0.75002281
row5 -0.4014055 0.29681568
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.7781795 -0.02847755
row5 -0.4014055 0.29681568
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.45031 49.72838 49.57374 48.05593 50.06329 106.2231 50.90134 50.83731
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.57942 50.53611 50.1077 52.07022 50.66516 49.62915 48.52289 50.14335
col17 col18 col19 col20
row1 50.43335 50.55478 48.79383 106.0149
> tmp[,"col10"]
col10
row1 50.53611
row2 29.84385
row3 29.48501
row4 30.13313
row5 49.51718
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.45031 49.72838 49.57374 48.05593 50.06329 106.2231 50.90134 50.83731
row5 50.24959 50.68443 50.08099 49.22981 50.96257 105.9988 50.72629 47.65773
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.57942 50.53611 50.10770 52.07022 50.66516 49.62915 48.52289 50.14335
row5 50.20520 49.51718 50.12492 48.64056 50.92375 50.44277 48.65726 49.22440
col17 col18 col19 col20
row1 50.43335 50.55478 48.79383 106.0149
row5 48.87575 49.74988 49.85634 105.7877
> tmp[,c("col6","col20")]
col6 col20
row1 106.22311 106.01486
row2 75.77212 75.49171
row3 74.60594 76.55157
row4 74.66165 74.49692
row5 105.99882 105.78772
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.2231 106.0149
row5 105.9988 105.7877
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.2231 106.0149
row5 105.9988 105.7877
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.6057440
[2,] -0.1335570
[3,] -0.1132343
[4,] -3.0388801
[5,] 0.1440815
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.0319147 0.7749186
[2,] -1.8346184 -1.8958813
[3,] 1.3347196 -0.2073231
[4,] -1.2790282 1.0232118
[5,] -0.0903877 0.8801258
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.1856411 0.1516105
[2,] 2.1344207 -0.9168488
[3,] -0.2874029 0.2741209
[4,] -0.4039425 0.3939893
[5,] -1.8592456 0.2068771
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.185641
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.185641
[2,] 2.134421
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -0.4686598 -0.3361899 -1.362214 -0.0564981 -1.001028 1.58453606
row1 0.5127644 0.1931390 -1.796643 2.1856356 0.162588 -0.01291307
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -1.4930852 0.6827584 -0.3272146 0.3819455 1.3389217 0.02966763 0.9423431
row1 0.2760979 0.5008358 0.8307544 1.3401337 -0.3313249 -1.26943702 0.1714986
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.2226586 -0.8413117 -0.7933564 -0.1200286 1.1166886 0.6118625
row1 -0.6789117 -0.4357058 0.8090978 -2.1938904 0.9623812 0.3247942
[,20]
row3 -0.04006997
row1 0.06677755
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.03593904 -0.2777043 0.3713035 0.7782326 -0.04590529 -1.915099 0.1190798
[,8] [,9] [,10]
row2 0.3656521 -0.1769617 -0.3659186
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.9631919 1.783111 -0.2656045 1.178867 -1.753545 1.225989 -0.1749841
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -1.211778 -0.1957116 -1.65003 0.1802913 -0.6126701 -1.161774 -1.046182
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.459927 -0.505529 -0.4481378 0.2111615 0.1479994 -1.442434
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> colnames(tmp) <- NULL
> rownames(tmp) <- NULL
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
> dimnames(tmp) <- NULL
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
> dimnames(tmp) <- NULL
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"
[[2]]
NULL
>
> dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE)))
> dimnames(tmp)
[[1]]
NULL
[[2]]
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
>
>
>
> ###
> ### Testing logical indexing
> ###
> ###
>
> tmp <- createBufferedMatrix(230,15)
> tmp[1:230,1:15] <- rnorm(230*15)
> x <-tmp[1:230,1:15]
>
> for (rep in 1:10){
+ which.cols <- sample(c(TRUE,FALSE),15,replace=T)
+ which.rows <- sample(c(TRUE,FALSE),230,replace=T)
+
+ if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){
+ stop("No agreement when logical indexing\n")
+ }
+
+ if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] == x[,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix cols\n")
+ }
+ if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] == x[which.rows,])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows\n")
+ }
+
+
+ if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]== x[which.rows,which.cols])){
+ stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n")
+ }
+ }
>
>
> ##
> ## Test the ReadOnlyMode
> ##
>
> ReadOnlyMode(tmp)
<pointer: 0x5561594aa7b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM182567763c0281"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM18256775ebebb6"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825676fe4aa60"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM18256743ddefd0"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825676ae7a7af"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825676ad960d"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825675c2ad49b"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM182567584e83ec"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM18256742e9916a"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825673d2332c0"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM182567143fba2c"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM18256765cb2079"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825675cbba701"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM18256713c9f228"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1825674bd607b2"
>
>
> ### testing coercion functions
> ###
>
> tmp <- as(tmp,"matrix")
> tmp <- as(tmp,"BufferedMatrix")
>
>
>
> ### testing whether can move storage from one location to another
>
> MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE)
<pointer: 0x556159822080>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x556159822080>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x556159822080>
> rowMedians(tmp)
[1] -0.064347592 0.015174643 0.442343397 -0.458324886 -0.180797189
[6] -0.214078097 -0.394273457 -0.036420351 -0.663274228 0.407243724
[11] -0.516803438 0.402914545 0.147230311 -0.402156452 0.239572953
[16] 0.094022747 -0.436756019 -0.264576136 -0.718304891 0.319544361
[21] -0.170439463 -0.141827542 0.187353245 0.084867968 -0.428614736
[26] -0.625736864 -0.283488188 -0.112672127 -0.401499224 -0.261935596
[31] -0.347483447 0.190702357 -0.174745312 -0.404364752 -0.297058024
[36] 0.151599717 -0.348964804 -0.063117933 -0.284242211 -0.197238158
[41] 0.234455671 -0.152311032 -0.416369565 0.003375912 0.746849023
[46] 0.350986541 0.277625325 -0.368818461 0.214141665 0.207294731
[51] -0.702642331 0.134150998 0.274253508 0.399545621 -0.395564063
[56] -0.007745507 -0.338163883 -0.373497743 0.156250065 0.014004018
[61] -0.552593150 0.120594497 -0.050275141 -0.330211546 0.354345792
[66] 0.163247761 -0.214093626 0.125250637 -0.076483642 -0.391054713
[71] -0.435049264 0.382526639 -0.051601361 0.064981951 0.364131306
[76] -0.001894918 -0.179682263 0.172589851 -0.189673452 0.304239652
[81] -0.219322131 -0.620125432 0.031371023 0.250036379 -0.456629230
[86] -0.658645290 0.312799349 -0.094657210 -0.451589258 0.278088533
[91] 0.216407454 -0.517046397 0.203065861 0.649306761 0.412022637
[96] -0.062366747 -0.426884500 0.141251443 0.377781830 -0.310011114
[101] 0.016061232 0.253288768 0.397864887 0.024676957 -0.090101584
[106] 0.797736644 0.379407839 0.324851479 0.350919324 -0.012157988
[111] 0.132736845 0.257814948 -0.346115291 0.172393405 0.634030423
[116] -0.503661978 -0.114675359 -0.093921927 0.240891348 0.153113703
[121] -0.149405544 -0.099294000 -0.158258950 0.400934495 -0.029376760
[126] 0.013278461 -0.079668321 -0.048438573 -0.102544544 -0.157427674
[131] -0.360448093 0.756151349 0.342879022 -0.415258914 -0.534262584
[136] -0.649642583 -0.241786669 -0.217118949 0.562688853 -0.055675263
[141] 0.369966372 0.119660688 0.254599836 -0.295508473 -0.289623408
[146] -0.187715125 -0.482780660 -0.137810435 -0.066183003 0.447042695
[151] 0.439382196 -0.237115844 0.028790393 -0.108132143 0.101706435
[156] 0.269325230 -0.270939418 0.343727535 0.058597340 0.053309800
[161] 0.351754510 -0.384932934 -0.081806836 0.237537484 0.152527443
[166] 0.271547354 -0.180202414 -0.581074845 -0.052314061 0.105619828
[171] 0.184907076 -0.285037619 -0.108677169 -0.526898754 -0.114222118
[176] -0.009758811 -0.026190921 -0.134927938 0.458204448 0.175506504
[181] 0.239641338 -0.645014802 -0.601243050 0.033885301 -0.144273732
[186] 0.312053382 0.233346853 0.385183093 -0.367658582 0.139786288
[191] -0.358178633 0.109314979 0.007936722 0.137029118 0.373719343
[196] -0.805483355 0.186613463 -0.191632293 0.016530870 0.042572575
[201] -0.266569687 0.146632251 -0.183099906 0.200692918 0.365249833
[206] -0.279253890 0.351894814 0.769079162 -0.137670313 -0.389729873
[211] 0.026462286 0.557927144 0.156326476 -0.461406949 0.087865659
[216] -0.008936205 -0.165151504 -0.250460487 0.111817059 0.232704282
[221] -0.265628949 0.054064263 0.091129295 -0.002910757 0.048530545
[226] 0.327277767 -0.257240351 -0.194185697 -0.261276286 0.035546295
>
> proc.time()
user system elapsed
1.176 0.681 1.847
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x5b8dbf7333f0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x5b8dbf7333f0>
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x5b8dbf7333f0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000
<pointer: 0x5b8dbf7333f0>
> rm(P)
>
> #P <- .Call("R_bm_Destroy",P)
> #.Call("R_bm_Destroy",P)
> #.Call("R_bm_Test_C",P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 0
Buffer Rows: 1
Buffer Cols: 1
Printing Values
<pointer: 0x5b8dbf71b240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbf71b240>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 1
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000
0.000000
0.000000
0.000000
0.000000
<pointer: 0x5b8dbf71b240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbf71b240>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x5b8dbf71b240>
> rm(P)
>
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbf9fe1a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbf9fe1a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x5b8dbf9fe1a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b8dbf9fe1a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x5b8dbf9fe1a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5b8dbf9fe1a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x5b8dbf9fe1a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5b8dbf9fe1a0>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5
Printing Values
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
<pointer: 0x5b8dbf9fe1a0>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbe74e410>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b8dbe74e410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbe74e410>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbe74e410>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1825d137d6d913" "BufferedMatrixFile1825d14c069071"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1825d137d6d913" "BufferedMatrixFile1825d14c069071"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbe6453d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dbe6453d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b8dbe6453d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b8dbe6453d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b8dbe6453d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b8dbe6453d0>
> .Call("R_bm_isRowMode",P)
[1] FALSE
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dc017b020>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b8dc017b020>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b8dc017b020>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b8dc017b020>
> rm(P)
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x5b8dbe953070>
> .Call("R_bm_getValue",P,3,3)
[1] 6
>
> .Call("R_bm_getValue",P,100000,10000)
[1] NA
> .Call("R_bm_setValue",P,3,3,12345.0)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 12345.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x5b8dbe953070>
> rm(P)
>
> proc.time()
user system elapsed
0.232 0.045 0.266
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.228 0.047 0.262