| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2025-12-16 11:35 -0500 (Tue, 16 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-10-20 r88955) -- "Unsuffered Consequences" | 4875 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4583 |
| 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 253/2332 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | 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.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2025-12-15 18:45:38 -0500 (Mon, 15 Dec 2025) |
| EndedAt: 2025-12-15 18:45:56 -0500 (Mon, 15 Dec 2025) |
| EllapsedTime: 18.2 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-11-04 r88984)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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 ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* 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 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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* 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 running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/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 Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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.121 0.044 0.174
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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] "/Users/biocbuild/bbs-3.23-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) limit (Mb) max used (Mb)
Ncells 481248 25.8 1058085 56.6 NA 633817 33.9
Vcells 891449 6.9 8388608 64.0 196608 2110969 16.2
>
>
>
>
> ##
> ## 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] "Mon Dec 15 18:45:48 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] "Mon Dec 15 18:45:49 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: 0x600000fa0120>
>
>
>
> 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] "Mon Dec 15 18:45:50 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] "Mon Dec 15 18:45:50 2025"
>
> ColMode(tmp2)
<pointer: 0x600000fa0120>
>
>
>
> ### 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,] 98.91994133 0.1177441 1.2643795 1.2790772
[2,] -0.27282080 -0.6658673 -0.5609544 -0.7516936
[3,] 0.97677742 0.0805396 1.7118473 0.6595656
[4,] 0.01751389 -0.3859825 1.3524708 0.4570120
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-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,] 98.91994133 0.1177441 1.2643795 1.2790772
[2,] 0.27282080 0.6658673 0.5609544 0.7516936
[3,] 0.97677742 0.0805396 1.7118473 0.6595656
[4,] 0.01751389 0.3859825 1.3524708 0.4570120
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-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,] 9.9458505 0.3431386 1.1244463 1.1309629
[2,] 0.5223225 0.8160070 0.7489689 0.8670027
[3,] 0.9883205 0.2837950 1.3083758 0.8121364
[4,] 0.1323401 0.6212749 1.1629578 0.6760266
>
> 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: /Users/biocbuild/bbs-3.23-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,] 223.37845 28.54913 37.50884 37.58871
[2,] 30.49605 33.82594 33.05064 34.42172
[3,] 35.85998 27.91849 39.79561 33.78093
[4,] 26.34091 31.59873 37.98205 32.21728
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000f88000>
> exp(tmp5)
<pointer: 0x600000f88000>
> log(tmp5,2)
<pointer: 0x600000f88000>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.933
> Min(tmp5)
[1] 53.61092
> mean(tmp5)
[1] 72.85925
> Sum(tmp5)
[1] 14571.85
> Var(tmp5)
[1] 850.8906
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.16538 71.07504 69.46634 70.97163 71.33112 70.87616 71.19127 71.44757
[9] 73.06890 69.99910
> rowSums(tmp5)
[1] 1783.308 1421.501 1389.327 1419.433 1426.622 1417.523 1423.825 1428.951
[9] 1461.378 1399.982
> rowVars(tmp5)
[1] 7892.14434 62.81888 93.25154 66.55286 101.57499 84.68378
[7] 95.25369 52.39060 62.49768 81.40670
> rowSd(tmp5)
[1] 88.837742 7.925836 9.656684 8.157994 10.078442 9.202379 9.759799
[8] 7.238135 7.905547 9.022566
> rowMax(tmp5)
[1] 464.93297 86.00040 88.19087 81.61902 92.28313 86.38876 86.94961
[8] 86.28140 84.28544 91.12011
> rowMin(tmp5)
[1] 54.51069 55.02832 53.61092 54.82516 57.71662 57.02147 56.72531 57.33314
[9] 58.74156 54.77775
>
> colMeans(tmp5)
[1] 106.72010 67.81270 73.19924 72.30715 78.46544 70.25694 68.22747
[8] 65.71784 75.33002 72.25492 74.80843 73.82464 70.32393 68.04818
[15] 70.75314 67.12760 69.16373 71.86431 71.45539 69.52383
> colSums(tmp5)
[1] 1067.2010 678.1270 731.9924 723.0715 784.6544 702.5694 682.2747
[8] 657.1784 753.3002 722.5492 748.0843 738.2464 703.2393 680.4818
[15] 707.5314 671.2760 691.6373 718.6431 714.5539 695.2383
> colVars(tmp5)
[1] 15872.18945 84.21798 79.39467 54.43226 42.02528 83.99810
[7] 90.55782 73.86854 41.03779 86.38935 119.58893 78.11664
[13] 100.26598 46.23797 58.85958 68.84893 100.00411 68.52234
[19] 45.08524 77.26796
> colSd(tmp5)
[1] 125.984878 9.177036 8.910368 7.377822 6.482691 9.165048
[7] 9.516187 8.594681 6.406074 9.294587 10.935672 8.838362
[13] 10.013290 6.799850 7.672000 8.297525 10.000206 8.277822
[19] 6.714554 8.790219
> colMax(tmp5)
[1] 464.93297 83.16517 82.82934 84.02449 88.58186 84.13876 86.94961
[8] 79.90600 84.74451 91.12011 92.28313 81.67988 86.28140 78.44412
[15] 80.97070 76.65066 88.19087 85.32118 82.33050 86.00040
> colMin(tmp5)
[1] 54.82516 56.82967 57.71662 57.02147 67.98952 56.10201 57.86144 54.51069
[9] 66.33502 62.10635 55.02832 57.33314 56.15059 58.53089 60.56669 53.61092
[17] 56.16883 59.76127 59.73769 56.72531
>
>
> ### 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] 89.16538 71.07504 69.46634 70.97163 71.33112 70.87616 71.19127 71.44757
[9] NA 69.99910
> rowSums(tmp5)
[1] 1783.308 1421.501 1389.327 1419.433 1426.622 1417.523 1423.825 1428.951
[9] NA 1399.982
> rowVars(tmp5)
[1] 7892.14434 62.81888 93.25154 66.55286 101.57499 84.68378
[7] 95.25369 52.39060 58.61240 81.40670
> rowSd(tmp5)
[1] 88.837742 7.925836 9.656684 8.157994 10.078442 9.202379 9.759799
[8] 7.238135 7.655874 9.022566
> rowMax(tmp5)
[1] 464.93297 86.00040 88.19087 81.61902 92.28313 86.38876 86.94961
[8] 86.28140 NA 91.12011
> rowMin(tmp5)
[1] 54.51069 55.02832 53.61092 54.82516 57.71662 57.02147 56.72531 57.33314
[9] NA 54.77775
>
> colMeans(tmp5)
[1] 106.72010 67.81270 73.19924 72.30715 NA 70.25694 68.22747
[8] 65.71784 75.33002 72.25492 74.80843 73.82464 70.32393 68.04818
[15] 70.75314 67.12760 69.16373 71.86431 71.45539 69.52383
> colSums(tmp5)
[1] 1067.2010 678.1270 731.9924 723.0715 NA 702.5694 682.2747
[8] 657.1784 753.3002 722.5492 748.0843 738.2464 703.2393 680.4818
[15] 707.5314 671.2760 691.6373 718.6431 714.5539 695.2383
> colVars(tmp5)
[1] 15872.18945 84.21798 79.39467 54.43226 NA 83.99810
[7] 90.55782 73.86854 41.03779 86.38935 119.58893 78.11664
[13] 100.26598 46.23797 58.85958 68.84893 100.00411 68.52234
[19] 45.08524 77.26796
> colSd(tmp5)
[1] 125.984878 9.177036 8.910368 7.377822 NA 9.165048
[7] 9.516187 8.594681 6.406074 9.294587 10.935672 8.838362
[13] 10.013290 6.799850 7.672000 8.297525 10.000206 8.277822
[19] 6.714554 8.790219
> colMax(tmp5)
[1] 464.93297 83.16517 82.82934 84.02449 NA 84.13876 86.94961
[8] 79.90600 84.74451 91.12011 92.28313 81.67988 86.28140 78.44412
[15] 80.97070 76.65066 88.19087 85.32118 82.33050 86.00040
> colMin(tmp5)
[1] 54.82516 56.82967 57.71662 57.02147 NA 56.10201 57.86144 54.51069
[9] 66.33502 62.10635 55.02832 57.33314 56.15059 58.53089 60.56669 53.61092
[17] 56.16883 59.76127 59.73769 56.72531
>
> Max(tmp5,na.rm=TRUE)
[1] 464.933
> Min(tmp5,na.rm=TRUE)
[1] 53.61092
> mean(tmp5,na.rm=TRUE)
[1] 72.80183
> Sum(tmp5,na.rm=TRUE)
[1] 14487.56
> Var(tmp5,na.rm=TRUE)
[1] 854.5253
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.16538 71.07504 69.46634 70.97163 71.33112 70.87616 71.19127 71.44757
[9] 72.47855 69.99910
> rowSums(tmp5,na.rm=TRUE)
[1] 1783.308 1421.501 1389.327 1419.433 1426.622 1417.523 1423.825 1428.951
[9] 1377.092 1399.982
> rowVars(tmp5,na.rm=TRUE)
[1] 7892.14434 62.81888 93.25154 66.55286 101.57499 84.68378
[7] 95.25369 52.39060 58.61240 81.40670
> rowSd(tmp5,na.rm=TRUE)
[1] 88.837742 7.925836 9.656684 8.157994 10.078442 9.202379 9.759799
[8] 7.238135 7.655874 9.022566
> rowMax(tmp5,na.rm=TRUE)
[1] 464.93297 86.00040 88.19087 81.61902 92.28313 86.38876 86.94961
[8] 86.28140 84.02449 91.12011
> rowMin(tmp5,na.rm=TRUE)
[1] 54.51069 55.02832 53.61092 54.82516 57.71662 57.02147 56.72531 57.33314
[9] 58.74156 54.77775
>
> colMeans(tmp5,na.rm=TRUE)
[1] 106.72010 67.81270 73.19924 72.30715 77.81878 70.25694 68.22747
[8] 65.71784 75.33002 72.25492 74.80843 73.82464 70.32393 68.04818
[15] 70.75314 67.12760 69.16373 71.86431 71.45539 69.52383
> colSums(tmp5,na.rm=TRUE)
[1] 1067.2010 678.1270 731.9924 723.0715 700.3690 702.5694 682.2747
[8] 657.1784 753.3002 722.5492 748.0843 738.2464 703.2393 680.4818
[15] 707.5314 671.2760 691.6373 718.6431 714.5539 695.2383
> colVars(tmp5,na.rm=TRUE)
[1] 15872.18945 84.21798 79.39467 54.43226 42.57395 83.99810
[7] 90.55782 73.86854 41.03779 86.38935 119.58893 78.11664
[13] 100.26598 46.23797 58.85958 68.84893 100.00411 68.52234
[19] 45.08524 77.26796
> colSd(tmp5,na.rm=TRUE)
[1] 125.984878 9.177036 8.910368 7.377822 6.524871 9.165048
[7] 9.516187 8.594681 6.406074 9.294587 10.935672 8.838362
[13] 10.013290 6.799850 7.672000 8.297525 10.000206 8.277822
[19] 6.714554 8.790219
> colMax(tmp5,na.rm=TRUE)
[1] 464.93297 83.16517 82.82934 84.02449 88.58186 84.13876 86.94961
[8] 79.90600 84.74451 91.12011 92.28313 81.67988 86.28140 78.44412
[15] 80.97070 76.65066 88.19087 85.32118 82.33050 86.00040
> colMin(tmp5,na.rm=TRUE)
[1] 54.82516 56.82967 57.71662 57.02147 67.98952 56.10201 57.86144 54.51069
[9] 66.33502 62.10635 55.02832 57.33314 56.15059 58.53089 60.56669 53.61092
[17] 56.16883 59.76127 59.73769 56.72531
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.16538 71.07504 69.46634 70.97163 71.33112 70.87616 71.19127 71.44757
[9] NaN 69.99910
> rowSums(tmp5,na.rm=TRUE)
[1] 1783.308 1421.501 1389.327 1419.433 1426.622 1417.523 1423.825 1428.951
[9] 0.000 1399.982
> rowVars(tmp5,na.rm=TRUE)
[1] 7892.14434 62.81888 93.25154 66.55286 101.57499 84.68378
[7] 95.25369 52.39060 NA 81.40670
> rowSd(tmp5,na.rm=TRUE)
[1] 88.837742 7.925836 9.656684 8.157994 10.078442 9.202379 9.759799
[8] 7.238135 NA 9.022566
> rowMax(tmp5,na.rm=TRUE)
[1] 464.93297 86.00040 88.19087 81.61902 92.28313 86.38876 86.94961
[8] 86.28140 NA 91.12011
> rowMin(tmp5,na.rm=TRUE)
[1] 54.51069 55.02832 53.61092 54.82516 57.71662 57.02147 56.72531 57.33314
[9] NA 54.77775
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.37401 66.10687 72.60098 71.00522 NaN 69.54541 68.86827
[8] 64.14138 76.32947 71.49800 74.59703 72.96254 70.24821 68.38656
[15] 70.72579 66.84067 68.88056 72.89246 71.17505 70.72186
> colSums(tmp5,na.rm=TRUE)
[1] 1002.3661 594.9618 653.4088 639.0470 0.0000 625.9087 619.8144
[8] 577.2724 686.9652 643.4820 671.3732 656.6629 632.2339 615.4790
[15] 636.5321 601.5661 619.9251 656.0322 640.5755 636.4967
> colVars(tmp5,na.rm=TRUE)
[1] 17612.55090 62.00936 85.29244 42.16739 NA 88.80223
[7] 97.25797 55.14322 34.93001 90.74255 134.03476 79.52016
[13] 112.73474 50.72963 66.20861 76.52887 111.60256 65.19522
[19] 49.83677 70.77959
> colSd(tmp5,na.rm=TRUE)
[1] 132.712286 7.874602 9.235390 6.493642 NA 9.423493
[7] 9.861946 7.425848 5.910162 9.525888 11.577338 8.917408
[13] 10.617661 7.122474 8.136867 8.748078 10.564211 8.074356
[19] 7.059516 8.413061
> colMax(tmp5,na.rm=TRUE)
[1] 464.93297 78.86238 82.82934 78.23597 -Inf 84.13876 86.94961
[8] 78.23955 84.74451 91.12011 92.28313 81.67988 86.28140 78.44412
[15] 80.97070 76.65066 88.19087 85.32118 82.33050 86.00040
> colMin(tmp5,na.rm=TRUE)
[1] 54.82516 56.82967 57.71662 57.02147 Inf 56.10201 57.86144 54.51069
[9] 68.88249 62.10635 55.02832 57.33314 56.15059 58.53089 60.56669 53.61092
[17] 56.16883 59.76127 59.73769 56.72531
>
>
>
>
> 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] 270.53862 207.61153 81.81097 283.88735 279.86136 169.10395 262.81461
[8] 138.90318 309.53048 289.73893
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 270.53862 207.61153 81.81097 283.88735 279.86136 169.10395 262.81461
[8] 138.90318 309.53048 289.73893
>
>
>
> 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] -1.136868e-13 -1.278977e-13 1.421085e-13 1.136868e-13 0.000000e+00
[6] -3.979039e-13 5.684342e-14 0.000000e+00 2.557954e-13 -5.684342e-14
[11] 0.000000e+00 1.136868e-13 -8.526513e-14 0.000000e+00 -5.684342e-14
[16] -9.947598e-14 -8.526513e-14 1.136868e-13 -2.842171e-14 -8.526513e-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)
+ }
2 3
6 19
5 12
10 7
1 13
1 10
2 15
3 5
9 9
7 16
10 9
5 9
9 7
2 16
7 10
5 3
4 19
5 1
5 19
2 12
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.284755
> Min(tmp)
[1] -2.390529
> mean(tmp)
[1] 0.07106613
> Sum(tmp)
[1] 7.106613
> Var(tmp)
[1] 0.838121
>
> rowMeans(tmp)
[1] 0.07106613
> rowSums(tmp)
[1] 7.106613
> rowVars(tmp)
[1] 0.838121
> rowSd(tmp)
[1] 0.9154895
> rowMax(tmp)
[1] 2.284755
> rowMin(tmp)
[1] -2.390529
>
> colMeans(tmp)
[1] 1.65127365 0.66920558 -0.09891856 -0.96809176 1.17365637 -0.72456661
[7] -0.55207013 0.23953115 0.98698380 0.45148778 0.29308835 2.28475497
[13] 0.96500722 0.20876048 -0.74393474 -0.87732987 -0.65742997 0.52523396
[19] -1.05327801 -0.55819699 0.96426573 -0.69851592 -0.47514626 -0.28500449
[25] 0.83541677 1.50042125 0.36958416 0.53638890 -0.55477220 -1.21937205
[31] -0.95380534 0.15276834 -0.45344099 -0.51948797 1.56126971 -1.32445995
[37] 0.26980543 -0.45946796 -0.22978109 -0.15661102 1.77824532 0.14221576
[43] -0.62725329 0.20144940 0.04723183 -0.18916810 -1.05733795 -0.65316005
[49] 0.73530472 -0.97242535 1.26100116 -0.19477879 0.47912277 0.33365312
[55] 0.74928190 -0.66568954 1.00396450 0.12698657 -0.76134911 1.58202594
[61] 1.72032833 0.34553196 0.06201829 1.51057625 -0.40004393 1.07120098
[67] -0.76582731 -0.67459037 -0.55957728 -0.14138484 -0.79382117 -0.92916178
[73] -0.63354999 0.29945018 0.14489092 0.63510918 -0.71669406 1.15061464
[79] 0.31862700 -0.92439023 1.60205562 0.13151288 0.86217448 -1.25938170
[85] 0.72813508 1.33800810 0.84133904 -0.83104313 -1.90325065 0.49399879
[91] 0.62056346 -1.37904575 -1.33143901 -0.21018578 1.06404833 -2.39052872
[97] 0.12149733 1.10552794 0.11891691 1.26986076
> colSums(tmp)
[1] 1.65127365 0.66920558 -0.09891856 -0.96809176 1.17365637 -0.72456661
[7] -0.55207013 0.23953115 0.98698380 0.45148778 0.29308835 2.28475497
[13] 0.96500722 0.20876048 -0.74393474 -0.87732987 -0.65742997 0.52523396
[19] -1.05327801 -0.55819699 0.96426573 -0.69851592 -0.47514626 -0.28500449
[25] 0.83541677 1.50042125 0.36958416 0.53638890 -0.55477220 -1.21937205
[31] -0.95380534 0.15276834 -0.45344099 -0.51948797 1.56126971 -1.32445995
[37] 0.26980543 -0.45946796 -0.22978109 -0.15661102 1.77824532 0.14221576
[43] -0.62725329 0.20144940 0.04723183 -0.18916810 -1.05733795 -0.65316005
[49] 0.73530472 -0.97242535 1.26100116 -0.19477879 0.47912277 0.33365312
[55] 0.74928190 -0.66568954 1.00396450 0.12698657 -0.76134911 1.58202594
[61] 1.72032833 0.34553196 0.06201829 1.51057625 -0.40004393 1.07120098
[67] -0.76582731 -0.67459037 -0.55957728 -0.14138484 -0.79382117 -0.92916178
[73] -0.63354999 0.29945018 0.14489092 0.63510918 -0.71669406 1.15061464
[79] 0.31862700 -0.92439023 1.60205562 0.13151288 0.86217448 -1.25938170
[85] 0.72813508 1.33800810 0.84133904 -0.83104313 -1.90325065 0.49399879
[91] 0.62056346 -1.37904575 -1.33143901 -0.21018578 1.06404833 -2.39052872
[97] 0.12149733 1.10552794 0.11891691 1.26986076
> 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] 1.65127365 0.66920558 -0.09891856 -0.96809176 1.17365637 -0.72456661
[7] -0.55207013 0.23953115 0.98698380 0.45148778 0.29308835 2.28475497
[13] 0.96500722 0.20876048 -0.74393474 -0.87732987 -0.65742997 0.52523396
[19] -1.05327801 -0.55819699 0.96426573 -0.69851592 -0.47514626 -0.28500449
[25] 0.83541677 1.50042125 0.36958416 0.53638890 -0.55477220 -1.21937205
[31] -0.95380534 0.15276834 -0.45344099 -0.51948797 1.56126971 -1.32445995
[37] 0.26980543 -0.45946796 -0.22978109 -0.15661102 1.77824532 0.14221576
[43] -0.62725329 0.20144940 0.04723183 -0.18916810 -1.05733795 -0.65316005
[49] 0.73530472 -0.97242535 1.26100116 -0.19477879 0.47912277 0.33365312
[55] 0.74928190 -0.66568954 1.00396450 0.12698657 -0.76134911 1.58202594
[61] 1.72032833 0.34553196 0.06201829 1.51057625 -0.40004393 1.07120098
[67] -0.76582731 -0.67459037 -0.55957728 -0.14138484 -0.79382117 -0.92916178
[73] -0.63354999 0.29945018 0.14489092 0.63510918 -0.71669406 1.15061464
[79] 0.31862700 -0.92439023 1.60205562 0.13151288 0.86217448 -1.25938170
[85] 0.72813508 1.33800810 0.84133904 -0.83104313 -1.90325065 0.49399879
[91] 0.62056346 -1.37904575 -1.33143901 -0.21018578 1.06404833 -2.39052872
[97] 0.12149733 1.10552794 0.11891691 1.26986076
> colMin(tmp)
[1] 1.65127365 0.66920558 -0.09891856 -0.96809176 1.17365637 -0.72456661
[7] -0.55207013 0.23953115 0.98698380 0.45148778 0.29308835 2.28475497
[13] 0.96500722 0.20876048 -0.74393474 -0.87732987 -0.65742997 0.52523396
[19] -1.05327801 -0.55819699 0.96426573 -0.69851592 -0.47514626 -0.28500449
[25] 0.83541677 1.50042125 0.36958416 0.53638890 -0.55477220 -1.21937205
[31] -0.95380534 0.15276834 -0.45344099 -0.51948797 1.56126971 -1.32445995
[37] 0.26980543 -0.45946796 -0.22978109 -0.15661102 1.77824532 0.14221576
[43] -0.62725329 0.20144940 0.04723183 -0.18916810 -1.05733795 -0.65316005
[49] 0.73530472 -0.97242535 1.26100116 -0.19477879 0.47912277 0.33365312
[55] 0.74928190 -0.66568954 1.00396450 0.12698657 -0.76134911 1.58202594
[61] 1.72032833 0.34553196 0.06201829 1.51057625 -0.40004393 1.07120098
[67] -0.76582731 -0.67459037 -0.55957728 -0.14138484 -0.79382117 -0.92916178
[73] -0.63354999 0.29945018 0.14489092 0.63510918 -0.71669406 1.15061464
[79] 0.31862700 -0.92439023 1.60205562 0.13151288 0.86217448 -1.25938170
[85] 0.72813508 1.33800810 0.84133904 -0.83104313 -1.90325065 0.49399879
[91] 0.62056346 -1.37904575 -1.33143901 -0.21018578 1.06404833 -2.39052872
[97] 0.12149733 1.10552794 0.11891691 1.26986076
> colMedians(tmp)
[1] 1.65127365 0.66920558 -0.09891856 -0.96809176 1.17365637 -0.72456661
[7] -0.55207013 0.23953115 0.98698380 0.45148778 0.29308835 2.28475497
[13] 0.96500722 0.20876048 -0.74393474 -0.87732987 -0.65742997 0.52523396
[19] -1.05327801 -0.55819699 0.96426573 -0.69851592 -0.47514626 -0.28500449
[25] 0.83541677 1.50042125 0.36958416 0.53638890 -0.55477220 -1.21937205
[31] -0.95380534 0.15276834 -0.45344099 -0.51948797 1.56126971 -1.32445995
[37] 0.26980543 -0.45946796 -0.22978109 -0.15661102 1.77824532 0.14221576
[43] -0.62725329 0.20144940 0.04723183 -0.18916810 -1.05733795 -0.65316005
[49] 0.73530472 -0.97242535 1.26100116 -0.19477879 0.47912277 0.33365312
[55] 0.74928190 -0.66568954 1.00396450 0.12698657 -0.76134911 1.58202594
[61] 1.72032833 0.34553196 0.06201829 1.51057625 -0.40004393 1.07120098
[67] -0.76582731 -0.67459037 -0.55957728 -0.14138484 -0.79382117 -0.92916178
[73] -0.63354999 0.29945018 0.14489092 0.63510918 -0.71669406 1.15061464
[79] 0.31862700 -0.92439023 1.60205562 0.13151288 0.86217448 -1.25938170
[85] 0.72813508 1.33800810 0.84133904 -0.83104313 -1.90325065 0.49399879
[91] 0.62056346 -1.37904575 -1.33143901 -0.21018578 1.06404833 -2.39052872
[97] 0.12149733 1.10552794 0.11891691 1.26986076
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.651274 0.6692056 -0.09891856 -0.9680918 1.173656 -0.7245666 -0.5520701
[2,] 1.651274 0.6692056 -0.09891856 -0.9680918 1.173656 -0.7245666 -0.5520701
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.2395312 0.9869838 0.4514878 0.2930883 2.284755 0.9650072 0.2087605
[2,] 0.2395312 0.9869838 0.4514878 0.2930883 2.284755 0.9650072 0.2087605
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.7439347 -0.8773299 -0.65743 0.525234 -1.053278 -0.558197 0.9642657
[2,] -0.7439347 -0.8773299 -0.65743 0.525234 -1.053278 -0.558197 0.9642657
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.6985159 -0.4751463 -0.2850045 0.8354168 1.500421 0.3695842 0.5363889
[2,] -0.6985159 -0.4751463 -0.2850045 0.8354168 1.500421 0.3695842 0.5363889
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.5547722 -1.219372 -0.9538053 0.1527683 -0.453441 -0.519488 1.56127
[2,] -0.5547722 -1.219372 -0.9538053 0.1527683 -0.453441 -0.519488 1.56127
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.32446 0.2698054 -0.459468 -0.2297811 -0.156611 1.778245 0.1422158
[2,] -1.32446 0.2698054 -0.459468 -0.2297811 -0.156611 1.778245 0.1422158
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.6272533 0.2014494 0.04723183 -0.1891681 -1.057338 -0.65316 0.7353047
[2,] -0.6272533 0.2014494 0.04723183 -0.1891681 -1.057338 -0.65316 0.7353047
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.9724254 1.261001 -0.1947788 0.4791228 0.3336531 0.7492819 -0.6656895
[2,] -0.9724254 1.261001 -0.1947788 0.4791228 0.3336531 0.7492819 -0.6656895
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.003965 0.1269866 -0.7613491 1.582026 1.720328 0.345532 0.06201829
[2,] 1.003965 0.1269866 -0.7613491 1.582026 1.720328 0.345532 0.06201829
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.510576 -0.4000439 1.071201 -0.7658273 -0.6745904 -0.5595773 -0.1413848
[2,] 1.510576 -0.4000439 1.071201 -0.7658273 -0.6745904 -0.5595773 -0.1413848
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.7938212 -0.9291618 -0.63355 0.2994502 0.1448909 0.6351092 -0.7166941
[2,] -0.7938212 -0.9291618 -0.63355 0.2994502 0.1448909 0.6351092 -0.7166941
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.150615 0.318627 -0.9243902 1.602056 0.1315129 0.8621745 -1.259382
[2,] 1.150615 0.318627 -0.9243902 1.602056 0.1315129 0.8621745 -1.259382
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.7281351 1.338008 0.841339 -0.8310431 -1.903251 0.4939988 0.6205635
[2,] 0.7281351 1.338008 0.841339 -0.8310431 -1.903251 0.4939988 0.6205635
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.379046 -1.331439 -0.2101858 1.064048 -2.390529 0.1214973 1.105528
[2,] -1.379046 -1.331439 -0.2101858 1.064048 -2.390529 0.1214973 1.105528
[,99] [,100]
[1,] 0.1189169 1.269861
[2,] 0.1189169 1.269861
>
>
> Max(tmp2)
[1] 2.057918
> Min(tmp2)
[1] -2.911611
> mean(tmp2)
[1] 0.02222763
> Sum(tmp2)
[1] 2.222763
> Var(tmp2)
[1] 0.9859808
>
> rowMeans(tmp2)
[1] -0.039300971 1.337734363 0.758516210 -1.649102635 -0.438425000
[6] 0.683726722 -0.890111564 -0.051166400 -0.927897993 0.469163856
[11] 0.042160363 1.218787515 0.423348938 -1.426318354 -0.760355181
[16] -0.024780567 0.004081497 -0.144245497 0.763542782 0.199529983
[21] 1.619102982 0.797552283 2.057917548 -0.859255084 0.680040640
[26] -0.464238207 0.020698467 -0.053794753 1.648707336 0.635362431
[31] 1.602443289 -1.103451766 1.168123944 0.377252253 0.453640280
[36] -0.046229574 0.376178876 -1.465158123 -2.065470290 -0.832410478
[41] 0.167359756 -0.080966713 -1.626085764 1.398903637 0.441393681
[46] -0.624222560 0.158310714 -0.027670459 -2.035868817 -0.356421162
[51] 1.102567279 -1.099515850 -0.549758716 0.228998252 -1.764970212
[56] -1.878595118 0.162032439 0.075989539 0.482697815 0.877508415
[61] 1.389802057 0.356803402 1.080023181 0.964308486 -0.378189083
[66] 0.228322425 1.557650394 0.179641170 0.397612518 0.638264663
[71] -0.780870498 -0.858488499 0.416891377 -1.626425703 0.104654903
[76] 0.628944013 -0.294446698 -0.874446737 -1.593338753 -0.347515494
[81] 1.475180423 -1.205769766 0.586027193 -0.992920492 -0.376664725
[86] 0.650847498 1.068073508 1.617416059 -0.380545602 0.080904745
[91] -2.911611407 2.017889201 -0.585955473 0.765517340 -0.429609111
[96] -1.031011287 0.091461233 0.390652047 0.635724631 0.420373352
> rowSums(tmp2)
[1] -0.039300971 1.337734363 0.758516210 -1.649102635 -0.438425000
[6] 0.683726722 -0.890111564 -0.051166400 -0.927897993 0.469163856
[11] 0.042160363 1.218787515 0.423348938 -1.426318354 -0.760355181
[16] -0.024780567 0.004081497 -0.144245497 0.763542782 0.199529983
[21] 1.619102982 0.797552283 2.057917548 -0.859255084 0.680040640
[26] -0.464238207 0.020698467 -0.053794753 1.648707336 0.635362431
[31] 1.602443289 -1.103451766 1.168123944 0.377252253 0.453640280
[36] -0.046229574 0.376178876 -1.465158123 -2.065470290 -0.832410478
[41] 0.167359756 -0.080966713 -1.626085764 1.398903637 0.441393681
[46] -0.624222560 0.158310714 -0.027670459 -2.035868817 -0.356421162
[51] 1.102567279 -1.099515850 -0.549758716 0.228998252 -1.764970212
[56] -1.878595118 0.162032439 0.075989539 0.482697815 0.877508415
[61] 1.389802057 0.356803402 1.080023181 0.964308486 -0.378189083
[66] 0.228322425 1.557650394 0.179641170 0.397612518 0.638264663
[71] -0.780870498 -0.858488499 0.416891377 -1.626425703 0.104654903
[76] 0.628944013 -0.294446698 -0.874446737 -1.593338753 -0.347515494
[81] 1.475180423 -1.205769766 0.586027193 -0.992920492 -0.376664725
[86] 0.650847498 1.068073508 1.617416059 -0.380545602 0.080904745
[91] -2.911611407 2.017889201 -0.585955473 0.765517340 -0.429609111
[96] -1.031011287 0.091461233 0.390652047 0.635724631 0.420373352
> 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.039300971 1.337734363 0.758516210 -1.649102635 -0.438425000
[6] 0.683726722 -0.890111564 -0.051166400 -0.927897993 0.469163856
[11] 0.042160363 1.218787515 0.423348938 -1.426318354 -0.760355181
[16] -0.024780567 0.004081497 -0.144245497 0.763542782 0.199529983
[21] 1.619102982 0.797552283 2.057917548 -0.859255084 0.680040640
[26] -0.464238207 0.020698467 -0.053794753 1.648707336 0.635362431
[31] 1.602443289 -1.103451766 1.168123944 0.377252253 0.453640280
[36] -0.046229574 0.376178876 -1.465158123 -2.065470290 -0.832410478
[41] 0.167359756 -0.080966713 -1.626085764 1.398903637 0.441393681
[46] -0.624222560 0.158310714 -0.027670459 -2.035868817 -0.356421162
[51] 1.102567279 -1.099515850 -0.549758716 0.228998252 -1.764970212
[56] -1.878595118 0.162032439 0.075989539 0.482697815 0.877508415
[61] 1.389802057 0.356803402 1.080023181 0.964308486 -0.378189083
[66] 0.228322425 1.557650394 0.179641170 0.397612518 0.638264663
[71] -0.780870498 -0.858488499 0.416891377 -1.626425703 0.104654903
[76] 0.628944013 -0.294446698 -0.874446737 -1.593338753 -0.347515494
[81] 1.475180423 -1.205769766 0.586027193 -0.992920492 -0.376664725
[86] 0.650847498 1.068073508 1.617416059 -0.380545602 0.080904745
[91] -2.911611407 2.017889201 -0.585955473 0.765517340 -0.429609111
[96] -1.031011287 0.091461233 0.390652047 0.635724631 0.420373352
> rowMin(tmp2)
[1] -0.039300971 1.337734363 0.758516210 -1.649102635 -0.438425000
[6] 0.683726722 -0.890111564 -0.051166400 -0.927897993 0.469163856
[11] 0.042160363 1.218787515 0.423348938 -1.426318354 -0.760355181
[16] -0.024780567 0.004081497 -0.144245497 0.763542782 0.199529983
[21] 1.619102982 0.797552283 2.057917548 -0.859255084 0.680040640
[26] -0.464238207 0.020698467 -0.053794753 1.648707336 0.635362431
[31] 1.602443289 -1.103451766 1.168123944 0.377252253 0.453640280
[36] -0.046229574 0.376178876 -1.465158123 -2.065470290 -0.832410478
[41] 0.167359756 -0.080966713 -1.626085764 1.398903637 0.441393681
[46] -0.624222560 0.158310714 -0.027670459 -2.035868817 -0.356421162
[51] 1.102567279 -1.099515850 -0.549758716 0.228998252 -1.764970212
[56] -1.878595118 0.162032439 0.075989539 0.482697815 0.877508415
[61] 1.389802057 0.356803402 1.080023181 0.964308486 -0.378189083
[66] 0.228322425 1.557650394 0.179641170 0.397612518 0.638264663
[71] -0.780870498 -0.858488499 0.416891377 -1.626425703 0.104654903
[76] 0.628944013 -0.294446698 -0.874446737 -1.593338753 -0.347515494
[81] 1.475180423 -1.205769766 0.586027193 -0.992920492 -0.376664725
[86] 0.650847498 1.068073508 1.617416059 -0.380545602 0.080904745
[91] -2.911611407 2.017889201 -0.585955473 0.765517340 -0.429609111
[96] -1.031011287 0.091461233 0.390652047 0.635724631 0.420373352
>
> colMeans(tmp2)
[1] 0.02222763
> colSums(tmp2)
[1] 2.222763
> colVars(tmp2)
[1] 0.9859808
> colSd(tmp2)
[1] 0.9929657
> colMax(tmp2)
[1] 2.057918
> colMin(tmp2)
[1] -2.911611
> colMedians(tmp2)
[1] 0.09805807
> colRanges(tmp2)
[,1]
[1,] -2.911611
[2,] 2.057918
>
> 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] -0.1738652 1.6193972 1.0339363 -0.4452733 -1.3939267 -4.5063049
[7] -0.3668844 -2.1834705 4.6486960 -1.8904242
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6215805
[2,] -0.8760314
[3,] 0.1481514
[4,] 0.4924888
[5,] 1.3529427
>
> rowApply(tmp,sum)
[1] 1.65326247 -1.16407630 1.13475546 -5.04309021 0.02039074 -2.68702267
[7] 1.59020316 -3.03010246 1.83619894 2.03136116
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 5 1 2 7 5 7 7 9 2
[2,] 7 2 4 7 9 6 10 4 5 6
[3,] 10 9 6 6 4 3 1 1 7 10
[4,] 2 7 3 1 5 9 6 10 8 8
[5,] 6 3 10 3 6 4 9 3 4 3
[6,] 5 1 7 4 1 8 5 8 1 5
[7,] 1 8 8 9 2 10 8 5 3 7
[8,] 4 10 9 5 10 2 2 2 2 1
[9,] 9 4 5 8 8 7 4 6 10 9
[10,] 3 6 2 10 3 1 3 9 6 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.3446041 -1.0128707 2.6875749 0.5170216 3.1870608 -2.1863450
[7] 4.0861261 -3.1550878 1.2649893 1.5559746 -0.5290757 0.1522224
[13] 0.1037430 2.5492424 -0.2685709 1.0627390 1.1773263 0.2720038
[19] 0.2813901 2.7841189
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.26115647
[2,] -0.64174969
[3,] 0.03075146
[4,] 0.20418764
[5,] 1.32336298
>
> rowApply(tmp,sum)
[1] 2.978705 4.266152 2.356199 1.249301 3.334622
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 11 4 17 13 2
[2,] 7 5 3 18 7
[3,] 20 2 16 17 10
[4,] 3 11 14 11 5
[5,] 6 18 13 6 20
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.03075146 -0.41615757 2.5457424 -0.6920945 -0.4342472 0.02973138
[2,] -0.64174969 -0.29126665 -2.1288651 0.4833474 1.3255473 -1.62631272
[3,] 1.32336298 -1.53073040 1.1980257 0.8709453 0.6299062 -0.45608021
[4,] 0.20418764 1.25924964 0.8964732 0.2033246 -0.4436571 -0.80730988
[5,] -1.26115647 -0.03396577 0.1761986 -0.3485012 2.1095117 0.67362644
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.8952251 -0.616122466 0.877805863 -1.0907958 -0.08829737 -0.684317104
[2,] 0.8579617 0.434715072 -2.508311311 0.5033365 -0.19841286 1.124547613
[3,] 2.7222176 -1.692684318 0.006631537 1.3927645 -0.65869141 0.128911273
[4,] -1.1090349 0.009075568 1.922888010 0.6309346 0.18958713 -0.002165101
[5,] 0.7197567 -1.290071701 0.965975170 0.1197348 0.22673884 -0.414754292
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.51230173 0.57403085 0.5465957 -0.3153606 0.5082910 -0.7985530
[2,] 0.04109785 1.08936618 2.0621916 1.6301064 0.3487880 1.2684811
[3,] -0.79062407 0.29818569 -2.1712453 -0.9578375 1.9659630 -0.2915407
[4,] -0.13577394 0.49990602 -1.3675773 0.2037425 -2.0044699 0.2418977
[5,] 0.47674136 0.08775368 0.6614644 0.5020881 0.3587542 -0.1482813
[,19] [,20]
[1,] 0.07416511 1.52001001
[2,] 0.58287151 -0.09128749
[3,] 1.01987306 -0.65115416
[4,] -0.71186832 1.56989057
[5,] -0.68365126 0.43665993
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-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: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 655 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-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: /Users/biocbuild/bbs-3.23-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.4396867 -0.6334816 0.5442543 -0.3056147 0.8261813 -1.101633 -0.1405702
col8 col9 col10 col11 col12 col13 col14
row1 -0.1021141 -2.133576 -0.7957593 1.006194 1.562964 -0.547771 -1.413526
col15 col16 col17 col18 col19 col20
row1 -0.3022122 0.006242743 -0.5810089 -0.9220323 -0.2277869 0.5916251
> tmp[,"col10"]
col10
row1 -0.7957593
row2 0.3298240
row3 -2.3136011
row4 -0.2426223
row5 1.0971255
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.4396867 -0.6334816 0.5442543 -0.3056147 0.8261813 -1.1016333
row5 -0.8351690 -0.0984092 -0.3612421 0.6505170 -1.1431625 -0.1058705
col7 col8 col9 col10 col11 col12 col13
row1 -0.1405702 -0.10211405 -2.133576 -0.7957593 1.006194 1.5629643 -0.5477710
row5 0.3449827 0.06090072 -0.554012 1.0971255 -1.342579 0.7093631 -0.9152945
col14 col15 col16 col17 col18 col19
row1 -1.413526 -0.3022122 0.006242743 -0.5810089 -0.9220323 -0.22778686
row5 1.660211 0.2031985 -1.157641092 -1.0185812 0.4010959 -0.04546746
col20
row1 0.5916251
row5 -1.6117351
> tmp[,c("col6","col20")]
col6 col20
row1 -1.1016333 0.5916251
row2 0.3044820 2.2345052
row3 0.2870313 -1.0479789
row4 -0.2190621 -0.4385037
row5 -0.1058705 -1.6117351
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.1016333 0.5916251
row5 -0.1058705 -1.6117351
>
>
>
>
> 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 48.68933 50.36122 48.63424 50.90305 49.86624 104.5556 48.90782 48.93968
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.77755 52.29313 50.29013 52.11822 49.45254 50.35397 50.72593 47.58759
col17 col18 col19 col20
row1 51.62481 50.24401 50.52724 104.6621
> tmp[,"col10"]
col10
row1 52.29313
row2 30.90318
row3 30.20687
row4 32.51891
row5 49.88608
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.68933 50.36122 48.63424 50.90305 49.86624 104.5556 48.90782 48.93968
row5 50.77955 51.22069 48.71377 49.20712 50.55914 104.4356 50.54301 49.60506
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.77755 52.29313 50.29013 52.11822 49.45254 50.35397 50.72593 47.58759
row5 49.87828 49.88608 48.58165 51.03014 49.55791 50.89118 49.87137 50.62120
col17 col18 col19 col20
row1 51.62481 50.24401 50.52724 104.6621
row5 48.04756 50.23001 48.82950 106.5378
> tmp[,c("col6","col20")]
col6 col20
row1 104.55557 104.66215
row2 75.54207 74.02474
row3 74.01863 75.16405
row4 76.86138 76.17203
row5 104.43565 106.53776
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.5556 104.6621
row5 104.4356 106.5378
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.5556 104.6621
row5 104.4356 106.5378
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.5217269
[2,] -0.3705631
[3,] -2.0110476
[4,] -0.4517627
[5,] 1.1947256
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.6484400 -0.39847170
[2,] -0.6205265 0.62796406
[3,] -1.9910607 0.64588785
[4,] 1.3564655 0.54730475
[5,] 1.1913770 -0.08790649
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.94894460 0.09340308
[2,] -0.60812375 -1.96036761
[3,] 0.24201180 1.49987581
[4,] 0.03139117 -0.46090010
[5,] 0.44602500 0.46988079
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.9489446
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.9489446
[2,] -0.6081237
>
>
>
> 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 -2.1739421 -0.06094267 -0.6184496 0.08860566 1.380160 -0.20008926
row1 -0.1440813 -0.30679479 -0.1840360 -1.05037254 0.990677 -0.01304949
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.4604511 -2.3841442 -0.03610002 0.5235641 -0.3619969 -0.9399345
row1 0.2973518 -0.4627626 -0.32098177 0.4716530 -1.2260381 1.8712810
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 1.5771686 0.5545115 -1.512855 0.5174879 0.3371799 0.09017572 -1.2796042
row1 0.6831328 -1.0840706 1.221570 0.4123503 -0.5698423 0.83457444 -0.5728561
[,20]
row3 -1.650265
row1 -2.112720
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.7264104 0.8019302 -0.3281106 -0.03701677 -0.3227671 0.7161459 0.3563201
[,8] [,9] [,10]
row2 -0.8556525 1.902905 0.2280833
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.4701301 -0.4687381 -0.1886642 -1.393957 1.245418 -0.6207133 0.4230025
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.124564 -0.5671629 1.452807 0.2701724 0.7061932 -1.727738 -0.3309364
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.340486 -0.1410458 -0.4686301 0.4208717 0.6357218 0.779453
>
>
> 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: 0x600000fac600>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM115482bd5969"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM115485d38fde6"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154848a536da"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154856b44778"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154855c043c0"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154841a01e3b"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM115487720d525"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM11548c89ad3d"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154822cc8639"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154821801a08"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM11548612d1466"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1154856966661"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM115482c1b96b0"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM115484742136f"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM11548430a00f5"
>
>
> ### 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: 0x600000f801e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000f801e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600000f801e0>
> rowMedians(tmp)
[1] -0.5088296736 -0.1408432461 0.1435136936 0.5373223857 -0.0363289308
[6] -0.1157678639 0.5972072968 0.2206855017 0.0484022555 -0.2339973353
[11] -0.1639693821 0.1891573876 0.2192914059 -0.2094801146 -0.2778284517
[16] 0.2913148186 -0.6083033571 -0.3850582230 0.3867879657 0.0617927139
[21] -0.5061842065 -0.2099632649 0.5227740255 0.1609412794 0.3973578697
[26] -0.0256855857 -0.0767935614 0.3637984628 -0.0647948706 0.0171758822
[31] 0.4956871546 0.3318617238 0.5133094698 0.2226071397 0.0921101185
[36] 0.0607223101 0.1852444607 0.0806872643 -0.0682398588 0.0363663584
[41] -0.1688130543 0.0071018134 0.2693538252 -0.2563012561 0.0389594371
[46] -0.3672470591 -0.0312152366 -0.2549879578 0.1582779491 0.1317852614
[51] 0.1307277923 0.1791257501 -0.1956785490 -0.1746175928 0.3812535796
[56] -0.4551795470 -0.3827658103 -0.3428901823 -0.2216237841 0.2480888374
[61] -0.1192937836 0.0180757146 0.7593161614 0.0248394635 -0.2294868708
[66] -0.0440401650 -0.3549185574 -0.3442235457 -0.2645728068 0.3945657591
[71] -0.3690427535 0.3526512879 -0.0493292958 0.1360861377 -0.0145353429
[76] -0.0425208519 0.1756935244 -0.0261933714 -0.0838079954 -0.0243456509
[81] -0.3440071239 0.2840341030 0.1165586407 -0.2756156391 -0.1924096423
[86] -0.3350307427 -0.3217979468 -0.7854455126 -0.3367489696 -0.0058445570
[91] 0.1526972676 0.0604135542 -0.3262237415 -0.7003049220 0.0065957550
[96] -0.1232743292 -0.2118444787 0.2470172900 -0.2522903951 -0.1534366892
[101] -0.0069331722 0.4438507369 0.0176024470 -0.1990668664 0.1390542567
[106] 0.0970268353 0.0447012691 0.0295827575 -0.5522107364 0.2403045791
[111] -0.6703020597 0.1255429337 -0.0253390832 -0.1573523336 0.5897240265
[116] 0.1407142389 0.0350303399 0.0503355900 -0.1707493803 0.2649373997
[121] 0.1713152403 -0.4031842640 0.2114997130 -0.2990334411 -0.4021669238
[126] 0.6209760620 0.1738937187 -0.2147120060 0.1740407151 0.4268995154
[131] 0.0637676512 -0.0875141395 0.4347670570 -0.2657780033 -0.1986188601
[136] 0.3516448616 0.3752532663 -0.0070495068 -0.4598923613 0.0981328086
[141] 0.2071924356 0.4701172679 -0.0767633939 -0.1967394201 0.3258686340
[146] -0.2005795265 -0.1860538745 0.8941468513 0.1810858737 0.0062078034
[151] 0.1372770937 0.1353113664 -0.0191142541 0.1244613753 0.0099494914
[156] 0.0195161013 -0.4702662258 -0.0820447285 -0.1787727706 0.2094791077
[161] 0.4521800929 -0.4498451662 0.1399310084 0.6108111304 0.0695102937
[166] 0.1737769581 -0.1518812277 0.5232587621 0.2601622305 -0.0495102722
[171] 0.3235587229 -0.1398830638 -0.0933706943 -0.2381325200 0.1264898101
[176] 0.7051175805 -0.5171232866 0.2774464911 -0.1517673293 -0.8628401649
[181] 0.5779207509 0.2683723636 -0.3121641330 0.1383855243 -0.0038950468
[186] -0.1418472609 0.0454367703 0.0066549161 0.3217596872 -0.0117698031
[191] -0.2393863895 -0.2378504967 -0.2966621527 -0.1715129937 0.6150928128
[196] 0.1521328903 0.1350845249 0.0531243727 0.0007984524 0.6171040008
[201] 0.2611827658 -0.8848487825 -0.0722007611 0.3550112946 0.4388647044
[206] -0.0253564537 0.1488355659 0.1573273508 0.1446083292 0.3261112857
[211] -0.0026340638 -0.3988186984 -0.3808914888 -0.8690930863 -0.1663307435
[216] 0.3542394597 -0.0845216808 0.4666043330 -0.4279640676 -0.4580417338
[221] -0.0109384192 -0.3144357791 0.1392778406 0.2803992413 -0.2983793322
[226] -0.4770004436 -1.0455902875 0.3338942684 -0.7789078320 0.6923131967
>
> proc.time()
user system elapsed
0.703 3.526 4.617
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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: 0x600000f3c0c0>
> .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: 0x600000f3c0c0>
> .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: 0x600000f3c0c0>
> .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: 0x600000f3c0c0>
> 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: 0x600000f24120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f24120>
> .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: 0x600000f24120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f24120>
> .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: 0x600000f24120>
> 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: 0x600000f20360>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f20360>
> .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: 0x600000f20360>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000f20360>
> .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: 0x600000f20360>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600000f20360>
> .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: 0x600000f20360>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600000f20360>
> .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: 0x600000f20360>
> 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: 0x600000f20540>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000f20540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f20540>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f20540>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1199e4888d127" "BufferedMatrixFile1199ee5b7ca5"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1199e4888d127" "BufferedMatrixFile1199ee5b7ca5"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f207e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f207e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000f207e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000f207e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000f207e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000f207e0>
> .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: 0x600000f209c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f209c0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000f209c0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000f209c0>
> 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: 0x600000f20ba0>
> .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: 0x600000f20ba0>
> rm(P)
>
> proc.time()
user system elapsed
0.118 0.042 0.157
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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.127 0.034 0.158