Back to Multiple platform build/check report for BioC 3.20: simplified long |
|
This page was generated on 2024-06-11 15:40 -0400 (Tue, 11 Jun 2024).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo2 | Linux (Ubuntu 22.04.3 LTS) | x86_64 | 4.4.0 RC (2024-04-16 r86468) -- "Puppy Cup" | 4679 |
palomino4 | Windows Server 2022 Datacenter | x64 | 4.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" | 4414 |
merida1 | macOS 12.7.4 Monterey | x86_64 | 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" | 4441 |
kjohnson1 | macOS 13.6.6 Ventura | arm64 | 4.4.0 Patched (2024-04-24 r86482) -- "Puppy Cup" | 4394 |
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 245/2239 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.69.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 22.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
palomino4 | Windows Server 2022 Datacenter / x64 | OK | OK | OK | OK | |||||||||
merida1 | macOS 12.7.4 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
kjohnson1 | macOS 13.6.6 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.69.0 |
Command: F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz |
StartedAt: 2024-06-10 00:31:08 -0400 (Mon, 10 Jun 2024) |
EndedAt: 2024-06-10 00:32:42 -0400 (Mon, 10 Jun 2024) |
EllapsedTime: 94.0 seconds |
RetCode: 0 |
Status: OK |
CheckDir: BufferedMatrix.Rcheck |
Warnings: 0 |
############################################################################## ############################################################################## ### ### Running command: ### ### F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD check --no-multiarch --install=check:BufferedMatrix.install-out.txt --library=F:\biocbuild\bbs-3.20-bioc\R\library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz ### ############################################################################## ############################################################################## * using log directory 'F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck' * using R version 4.4.0 RC (2024-04-16 r86468 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.2.0 GNU Fortran (GCC) 13.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * using option '--no-vignettes' * checking for file 'BufferedMatrix/DESCRIPTION' ... OK * this is package 'BufferedMatrix' version '1.69.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 whether package 'BufferedMatrix' can be installed ... OK * used C compiler: 'gcc.exe (GCC) 13.2.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 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 for x64 is not available File 'F:/biocbuild/bbs-3.20-bioc/R/library/BufferedMatrix/libs/x64/BufferedMatrix.dll': Found '_exit', possibly from '_exit' (C) Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran) Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead of to the console, nor use Fortran I/O nor system RNGs nor [v]sprintf. The detected symbols are linked into the code but might come from libraries and not actually be called. See 'Writing portable packages' in the 'Writing R Extensions' manual. * 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: 2 NOTEs See 'F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00check.log' for details.
BufferedMatrix.Rcheck/00install.out
############################################################################## ############################################################################## ### ### Running command: ### ### F:\biocbuild\bbs-3.20-bioc\R\bin\R.exe CMD INSTALL BufferedMatrix ### ############################################################################## ############################################################################## * installing to library 'F:/biocbuild/bbs-3.20-bioc/R/library' * installing *source* package 'BufferedMatrix' ... ** using staged installation ** libs using C compiler: 'gcc.exe (GCC) 13.2.0' gcc -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c RBufferedMatrix.c -o RBufferedMatrix.o gcc -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -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 -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o gcc -I"F:/biocbuild/bbs-3.20-bioc/R/include" -DNDEBUG -I"C:/rtools44/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c init_package.c -o init_package.o gcc -shared -s -static-libgcc -o BufferedMatrix.dll tmp.def RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools44/x86_64-w64-mingw32.static.posix/lib -LF:/biocbuild/bbs-3.20-bioc/R/bin/x64 -lR installing to F:/biocbuild/bbs-3.20-bioc/R/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs/x64 ** 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 ** 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.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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.26 0.31 0.70
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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] "F:/biocbuild/bbs-3.20-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 468464 25.1 1021761 54.6 633414 33.9 Vcells 853870 6.6 8388608 64.0 2003120 15.3 > > > > > ## > ## 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 Jun 10 00:31:43 2024" > 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 Jun 10 00:31:44 2024" > > > 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: 0x0000021aaacfaa70> > > > > 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 Jun 10 00:31:55 2024" > 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 Jun 10 00:31:59 2024" > > ColMode(tmp2) <pointer: 0x0000021aaacfaa70> > > > > ### 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.4747889 0.5174965 -1.6504765 -0.1620194 [2,] 0.5260570 -1.0233505 0.7675330 0.4646630 [3,] -0.9966778 1.3639993 -2.3194772 -2.5940864 [4,] -0.3530156 -0.4945604 0.0920837 -1.0252564 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 100.4747889 0.5174965 1.6504765 0.1620194 [2,] 0.5260570 1.0233505 0.7675330 0.4646630 [3,] 0.9966778 1.3639993 2.3194772 2.5940864 [4,] 0.3530156 0.4945604 0.0920837 1.0252564 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 10.0237113 0.7193723 1.2847087 0.4025164 [2,] 0.7252978 1.0116079 0.8760896 0.6816619 [3,] 0.9983375 1.1679038 1.5229830 1.6106168 [4,] 0.5941511 0.7032499 0.3034530 1.0125495 > > 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: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 225.71190 32.71122 39.49756 29.18718 [2,] 32.77904 36.13943 34.52843 32.28128 [3,] 35.98005 38.04304 42.54931 43.70025 [4,] 31.29453 32.52706 28.12661 36.15075 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x0000021aaacfab30> > exp(tmp5) <pointer: 0x0000021aaacfab30> > log(tmp5,2) <pointer: 0x0000021aaacfab30> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 469.7898 > Min(tmp5) [1] 53.6092 > mean(tmp5) [1] 73.41395 > Sum(tmp5) [1] 14682.79 > Var(tmp5) [1] 877.6586 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 90.70984 75.45830 72.63112 70.79666 68.76589 75.14889 68.23831 69.77068 [9] 72.24916 70.37060 > rowSums(tmp5) [1] 1814.197 1509.166 1452.622 1415.933 1375.318 1502.978 1364.766 1395.414 [9] 1444.983 1407.412 > rowVars(tmp5) [1] 8064.03895 63.07128 104.39078 51.41221 68.55816 80.53352 [7] 44.18319 65.16276 139.36518 105.19916 > rowSd(tmp5) [1] 89.799994 7.941743 10.217180 7.170231 8.279985 8.974047 6.647044 [8] 8.072345 11.805303 10.256664 > rowMax(tmp5) [1] 469.78975 92.26895 90.95635 85.12655 83.23208 90.10254 78.75684 [8] 83.33762 94.89222 90.92910 > rowMin(tmp5) [1] 55.63239 62.77771 58.86227 58.54186 54.70545 56.49165 55.85604 55.13045 [9] 56.86045 53.60920 > > colMeans(tmp5) [1] 113.59396 69.27874 73.89211 72.17318 66.34987 68.81596 70.62843 [8] 65.58215 68.87080 74.15197 73.03731 74.54756 72.81263 72.98626 [15] 72.95647 70.44073 71.63197 75.69035 70.29450 70.54396 > colSums(tmp5) [1] 1135.9396 692.7874 738.9211 721.7318 663.4987 688.1596 706.2843 [8] 655.8215 688.7080 741.5197 730.3731 745.4756 728.1263 729.8626 [15] 729.5647 704.4073 716.3197 756.9035 702.9450 705.4396 > colVars(tmp5) [1] 15730.73016 56.72237 95.77405 70.42017 67.62661 68.91766 [7] 142.56223 40.91958 93.31459 83.74764 92.84635 155.21916 [13] 88.69389 94.41949 120.50763 99.42267 44.57312 83.74182 [19] 55.13791 85.18676 > colSd(tmp5) [1] 125.422208 7.531426 9.786421 8.391672 8.223540 8.301666 [7] 11.939943 6.396841 9.659948 9.151374 9.635681 12.458698 [13] 9.417744 9.716969 10.977597 9.971092 6.676310 9.151056 [19] 7.425490 9.229667 > colMax(tmp5) [1] 469.78975 79.18160 88.56081 90.95635 80.63204 85.12655 89.84028 [8] 77.68512 81.09047 90.80227 92.26895 90.71329 86.55534 87.32907 [15] 94.89222 90.10254 85.13867 90.92910 83.09272 84.50712 > colMin(tmp5) [1] 62.55166 56.78278 58.54186 60.74930 56.58667 56.86045 54.70545 57.26747 [9] 53.60920 60.06975 59.93649 56.49165 55.85604 58.86227 55.13045 56.74934 [17] 59.68359 62.45420 59.27849 61.86875 > > > ### 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.70984 75.45830 NA 70.79666 68.76589 75.14889 68.23831 69.77068 [9] 72.24916 70.37060 > rowSums(tmp5) [1] 1814.197 1509.166 NA 1415.933 1375.318 1502.978 1364.766 1395.414 [9] 1444.983 1407.412 > rowVars(tmp5) [1] 8064.03895 63.07128 95.35079 51.41221 68.55816 80.53352 [7] 44.18319 65.16276 139.36518 105.19916 > rowSd(tmp5) [1] 89.799994 7.941743 9.764773 7.170231 8.279985 8.974047 6.647044 [8] 8.072345 11.805303 10.256664 > rowMax(tmp5) [1] 469.78975 92.26895 NA 85.12655 83.23208 90.10254 78.75684 [8] 83.33762 94.89222 90.92910 > rowMin(tmp5) [1] 55.63239 62.77771 NA 58.54186 54.70545 56.49165 55.85604 55.13045 [9] 56.86045 53.60920 > > colMeans(tmp5) [1] 113.59396 69.27874 NA 72.17318 66.34987 68.81596 70.62843 [8] 65.58215 68.87080 74.15197 73.03731 74.54756 72.81263 72.98626 [15] 72.95647 70.44073 71.63197 75.69035 70.29450 70.54396 > colSums(tmp5) [1] 1135.9396 692.7874 NA 721.7318 663.4987 688.1596 706.2843 [8] 655.8215 688.7080 741.5197 730.3731 745.4756 728.1263 729.8626 [15] 729.5647 704.4073 716.3197 756.9035 702.9450 705.4396 > colVars(tmp5) [1] 15730.73016 56.72237 NA 70.42017 67.62661 68.91766 [7] 142.56223 40.91958 93.31459 83.74764 92.84635 155.21916 [13] 88.69389 94.41949 120.50763 99.42267 44.57312 83.74182 [19] 55.13791 85.18676 > colSd(tmp5) [1] 125.422208 7.531426 NA 8.391672 8.223540 8.301666 [7] 11.939943 6.396841 9.659948 9.151374 9.635681 12.458698 [13] 9.417744 9.716969 10.977597 9.971092 6.676310 9.151056 [19] 7.425490 9.229667 > colMax(tmp5) [1] 469.78975 79.18160 NA 90.95635 80.63204 85.12655 89.84028 [8] 77.68512 81.09047 90.80227 92.26895 90.71329 86.55534 87.32907 [15] 94.89222 90.10254 85.13867 90.92910 83.09272 84.50712 > colMin(tmp5) [1] 62.55166 56.78278 NA 60.74930 56.58667 56.86045 54.70545 57.26747 [9] 53.60920 60.06975 59.93649 56.49165 55.85604 58.86227 55.13045 56.74934 [17] 59.68359 62.45420 59.27849 61.86875 > > Max(tmp5,na.rm=TRUE) [1] 469.7898 > Min(tmp5,na.rm=TRUE) [1] 53.6092 > mean(tmp5,na.rm=TRUE) [1] 73.33783 > Sum(tmp5,na.rm=TRUE) [1] 14594.23 > Var(tmp5,na.rm=TRUE) [1] 880.9267 > > rowMeans(tmp5,na.rm=TRUE) [1] 90.70984 75.45830 71.79271 70.79666 68.76589 75.14889 68.23831 69.77068 [9] 72.24916 70.37060 > rowSums(tmp5,na.rm=TRUE) [1] 1814.197 1509.166 1364.062 1415.933 1375.318 1502.978 1364.766 1395.414 [9] 1444.983 1407.412 > rowVars(tmp5,na.rm=TRUE) [1] 8064.03895 63.07128 95.35079 51.41221 68.55816 80.53352 [7] 44.18319 65.16276 139.36518 105.19916 > rowSd(tmp5,na.rm=TRUE) [1] 89.799994 7.941743 9.764773 7.170231 8.279985 8.974047 6.647044 [8] 8.072345 11.805303 10.256664 > rowMax(tmp5,na.rm=TRUE) [1] 469.78975 92.26895 90.95635 85.12655 83.23208 90.10254 78.75684 [8] 83.33762 94.89222 90.92910 > rowMin(tmp5,na.rm=TRUE) [1] 55.63239 62.77771 58.86227 58.54186 54.70545 56.49165 55.85604 55.13045 [9] 56.86045 53.60920 > > colMeans(tmp5,na.rm=TRUE) [1] 113.59396 69.27874 72.26225 72.17318 66.34987 68.81596 70.62843 [8] 65.58215 68.87080 74.15197 73.03731 74.54756 72.81263 72.98626 [15] 72.95647 70.44073 71.63197 75.69035 70.29450 70.54396 > colSums(tmp5,na.rm=TRUE) [1] 1135.9396 692.7874 650.3603 721.7318 663.4987 688.1596 706.2843 [8] 655.8215 688.7080 741.5197 730.3731 745.4756 728.1263 729.8626 [15] 729.5647 704.4073 716.3197 756.9035 702.9450 705.4396 > colVars(tmp5,na.rm=TRUE) [1] 15730.73016 56.72237 77.86097 70.42017 67.62661 68.91766 [7] 142.56223 40.91958 93.31459 83.74764 92.84635 155.21916 [13] 88.69389 94.41949 120.50763 99.42267 44.57312 83.74182 [19] 55.13791 85.18676 > colSd(tmp5,na.rm=TRUE) [1] 125.422208 7.531426 8.823886 8.391672 8.223540 8.301666 [7] 11.939943 6.396841 9.659948 9.151374 9.635681 12.458698 [13] 9.417744 9.716969 10.977597 9.971092 6.676310 9.151056 [19] 7.425490 9.229667 > colMax(tmp5,na.rm=TRUE) [1] 469.78975 79.18160 83.01402 90.95635 80.63204 85.12655 89.84028 [8] 77.68512 81.09047 90.80227 92.26895 90.71329 86.55534 87.32907 [15] 94.89222 90.10254 85.13867 90.92910 83.09272 84.50712 > colMin(tmp5,na.rm=TRUE) [1] 62.55166 56.78278 58.54186 60.74930 56.58667 56.86045 54.70545 57.26747 [9] 53.60920 60.06975 59.93649 56.49165 55.85604 58.86227 55.13045 56.74934 [17] 59.68359 62.45420 59.27849 61.86875 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 90.70984 75.45830 NaN 70.79666 68.76589 75.14889 68.23831 69.77068 [9] 72.24916 70.37060 > rowSums(tmp5,na.rm=TRUE) [1] 1814.197 1509.166 0.000 1415.933 1375.318 1502.978 1364.766 1395.414 [9] 1444.983 1407.412 > rowVars(tmp5,na.rm=TRUE) [1] 8064.03895 63.07128 NA 51.41221 68.55816 80.53352 [7] 44.18319 65.16276 139.36518 105.19916 > rowSd(tmp5,na.rm=TRUE) [1] 89.799994 7.941743 NA 7.170231 8.279985 8.974047 6.647044 [8] 8.072345 11.805303 10.256664 > rowMax(tmp5,na.rm=TRUE) [1] 469.78975 92.26895 NA 85.12655 83.23208 90.10254 78.75684 [8] 83.33762 94.89222 90.92910 > rowMin(tmp5,na.rm=TRUE) [1] 55.63239 62.77771 NA 58.54186 54.70545 56.49165 55.85604 55.13045 [9] 56.86045 53.60920 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 117.89465 68.17842 NaN 70.08616 67.05254 68.52700 70.51732 [8] 66.05083 69.48526 74.17877 72.44128 72.78961 72.80418 74.55559 [15] 72.18858 71.64955 72.95957 75.96122 69.57948 70.85629 > colSums(tmp5,na.rm=TRUE) [1] 1061.0518 613.6058 0.0000 630.7754 603.4728 616.7430 634.6559 [8] 594.4575 625.3674 667.6089 651.9715 655.1065 655.2376 671.0003 [15] 649.6972 644.8460 656.6362 683.6510 626.2153 637.7066 > colVars(tmp5,na.rm=TRUE) [1] 17488.99234 50.19230 NA 30.22161 70.52534 76.59304 [7] 160.24362 43.56335 100.73137 94.20802 100.45548 139.85451 [13] 99.77983 78.51541 128.93733 95.41137 30.31643 93.38414 [19] 56.27861 94.73769 > colSd(tmp5,na.rm=TRUE) [1] 132.245954 7.084652 NA 5.497418 8.397937 8.751745 [7] 12.658737 6.600253 10.036502 9.706082 10.022748 11.826010 [13] 9.988985 8.860892 11.355058 9.767874 5.506036 9.663547 [19] 7.501907 9.733329 > colMax(tmp5,na.rm=TRUE) [1] 469.78975 77.35624 -Inf 77.22736 80.63204 85.12655 89.84028 [8] 77.68512 81.09047 90.80227 92.26895 90.71329 86.55534 87.32907 [15] 94.89222 90.10254 85.13867 90.92910 83.09272 84.50712 > colMin(tmp5,na.rm=TRUE) [1] 62.55166 56.78278 Inf 60.74930 56.58667 56.86045 54.70545 57.26747 [9] 53.60920 60.06975 59.93649 56.49165 55.85604 61.52779 55.13045 56.74934 [17] 65.66539 62.45420 59.27849 61.86875 > > > > > 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] 224.35582 261.16749 233.96553 179.57852 142.10232 148.26353 269.88067 [8] 132.75799 94.49486 242.22631 > apply(copymatrix,1,var,na.rm=TRUE) [1] 224.35582 261.16749 233.96553 179.57852 142.10232 148.26353 269.88067 [8] 132.75799 94.49486 242.22631 > > > > 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] 5.684342e-14 0.000000e+00 -1.136868e-13 -5.684342e-14 8.526513e-14 [6] 5.684342e-14 1.705303e-13 -3.694822e-13 -8.526513e-14 0.000000e+00 [11] 0.000000e+00 -1.705303e-13 -5.684342e-14 2.842171e-13 -2.842171e-14 [16] 9.947598e-14 2.842171e-14 2.842171e-14 -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) + } 8 7 10 14 5 8 9 1 9 19 9 5 5 1 2 4 8 15 5 2 5 2 4 18 2 15 8 1 5 4 6 17 8 14 1 17 8 10 4 16 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.131422 > Min(tmp) [1] -2.132202 > mean(tmp) [1] 0.03215054 > Sum(tmp) [1] 3.215054 > Var(tmp) [1] 0.9546888 > > rowMeans(tmp) [1] 0.03215054 > rowSums(tmp) [1] 3.215054 > rowVars(tmp) [1] 0.9546888 > rowSd(tmp) [1] 0.9770818 > rowMax(tmp) [1] 2.131422 > rowMin(tmp) [1] -2.132202 > > colMeans(tmp) [1] -0.190200938 -0.389049448 -0.740835421 0.049624170 -0.219421165 [6] 0.388164461 0.050117934 1.352700370 2.131422475 0.440974276 [11] -1.565630502 0.764577575 -0.609255972 -0.670076832 -0.575814680 [16] -0.472267974 1.960390993 0.347322875 1.460160890 -0.168661619 [21] 1.098264875 1.051562242 -0.545098916 1.907286418 -0.988814438 [26] -0.593011338 0.526633153 0.560970777 0.173900375 -0.876845296 [31] -0.169945187 0.581211730 0.719547072 -0.324812342 0.295113770 [36] -1.656020813 1.449755422 -0.806305515 1.661948534 -0.947692442 [41] -0.706819521 1.414578779 0.660660677 0.432008682 -0.296924084 [46] 1.229122167 0.688590696 0.005045701 0.398186903 -1.411567796 [51] 0.126155811 0.631652768 -1.955575206 -2.132201780 -1.025226027 [56] 0.291836050 0.007812224 -1.055933499 0.563334800 -0.700361264 [61] 1.345371852 1.896727069 -0.016275424 0.096005557 0.005072537 [66] 1.541882828 -0.233683648 -0.342017252 0.083576744 -1.076401384 [71] 1.073121854 -1.265964628 0.471850608 -1.035705968 -0.377882487 [76] -0.156639019 -1.782263774 1.544574272 0.088333697 -1.110697295 [81] 0.582917302 -0.470436015 -0.453509814 -0.929282378 1.249927591 [86] 0.861449958 1.255820834 -1.784828273 -0.925409319 0.312236855 [91] 0.756703187 0.042344436 -1.173088593 -0.786234880 -0.932937781 [96] -0.877150641 1.326800691 -0.593463633 -0.055961585 1.433904700 > colSums(tmp) [1] -0.190200938 -0.389049448 -0.740835421 0.049624170 -0.219421165 [6] 0.388164461 0.050117934 1.352700370 2.131422475 0.440974276 [11] -1.565630502 0.764577575 -0.609255972 -0.670076832 -0.575814680 [16] -0.472267974 1.960390993 0.347322875 1.460160890 -0.168661619 [21] 1.098264875 1.051562242 -0.545098916 1.907286418 -0.988814438 [26] -0.593011338 0.526633153 0.560970777 0.173900375 -0.876845296 [31] -0.169945187 0.581211730 0.719547072 -0.324812342 0.295113770 [36] -1.656020813 1.449755422 -0.806305515 1.661948534 -0.947692442 [41] -0.706819521 1.414578779 0.660660677 0.432008682 -0.296924084 [46] 1.229122167 0.688590696 0.005045701 0.398186903 -1.411567796 [51] 0.126155811 0.631652768 -1.955575206 -2.132201780 -1.025226027 [56] 0.291836050 0.007812224 -1.055933499 0.563334800 -0.700361264 [61] 1.345371852 1.896727069 -0.016275424 0.096005557 0.005072537 [66] 1.541882828 -0.233683648 -0.342017252 0.083576744 -1.076401384 [71] 1.073121854 -1.265964628 0.471850608 -1.035705968 -0.377882487 [76] -0.156639019 -1.782263774 1.544574272 0.088333697 -1.110697295 [81] 0.582917302 -0.470436015 -0.453509814 -0.929282378 1.249927591 [86] 0.861449958 1.255820834 -1.784828273 -0.925409319 0.312236855 [91] 0.756703187 0.042344436 -1.173088593 -0.786234880 -0.932937781 [96] -0.877150641 1.326800691 -0.593463633 -0.055961585 1.433904700 > 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.190200938 -0.389049448 -0.740835421 0.049624170 -0.219421165 [6] 0.388164461 0.050117934 1.352700370 2.131422475 0.440974276 [11] -1.565630502 0.764577575 -0.609255972 -0.670076832 -0.575814680 [16] -0.472267974 1.960390993 0.347322875 1.460160890 -0.168661619 [21] 1.098264875 1.051562242 -0.545098916 1.907286418 -0.988814438 [26] -0.593011338 0.526633153 0.560970777 0.173900375 -0.876845296 [31] -0.169945187 0.581211730 0.719547072 -0.324812342 0.295113770 [36] -1.656020813 1.449755422 -0.806305515 1.661948534 -0.947692442 [41] -0.706819521 1.414578779 0.660660677 0.432008682 -0.296924084 [46] 1.229122167 0.688590696 0.005045701 0.398186903 -1.411567796 [51] 0.126155811 0.631652768 -1.955575206 -2.132201780 -1.025226027 [56] 0.291836050 0.007812224 -1.055933499 0.563334800 -0.700361264 [61] 1.345371852 1.896727069 -0.016275424 0.096005557 0.005072537 [66] 1.541882828 -0.233683648 -0.342017252 0.083576744 -1.076401384 [71] 1.073121854 -1.265964628 0.471850608 -1.035705968 -0.377882487 [76] -0.156639019 -1.782263774 1.544574272 0.088333697 -1.110697295 [81] 0.582917302 -0.470436015 -0.453509814 -0.929282378 1.249927591 [86] 0.861449958 1.255820834 -1.784828273 -0.925409319 0.312236855 [91] 0.756703187 0.042344436 -1.173088593 -0.786234880 -0.932937781 [96] -0.877150641 1.326800691 -0.593463633 -0.055961585 1.433904700 > colMin(tmp) [1] -0.190200938 -0.389049448 -0.740835421 0.049624170 -0.219421165 [6] 0.388164461 0.050117934 1.352700370 2.131422475 0.440974276 [11] -1.565630502 0.764577575 -0.609255972 -0.670076832 -0.575814680 [16] -0.472267974 1.960390993 0.347322875 1.460160890 -0.168661619 [21] 1.098264875 1.051562242 -0.545098916 1.907286418 -0.988814438 [26] -0.593011338 0.526633153 0.560970777 0.173900375 -0.876845296 [31] -0.169945187 0.581211730 0.719547072 -0.324812342 0.295113770 [36] -1.656020813 1.449755422 -0.806305515 1.661948534 -0.947692442 [41] -0.706819521 1.414578779 0.660660677 0.432008682 -0.296924084 [46] 1.229122167 0.688590696 0.005045701 0.398186903 -1.411567796 [51] 0.126155811 0.631652768 -1.955575206 -2.132201780 -1.025226027 [56] 0.291836050 0.007812224 -1.055933499 0.563334800 -0.700361264 [61] 1.345371852 1.896727069 -0.016275424 0.096005557 0.005072537 [66] 1.541882828 -0.233683648 -0.342017252 0.083576744 -1.076401384 [71] 1.073121854 -1.265964628 0.471850608 -1.035705968 -0.377882487 [76] -0.156639019 -1.782263774 1.544574272 0.088333697 -1.110697295 [81] 0.582917302 -0.470436015 -0.453509814 -0.929282378 1.249927591 [86] 0.861449958 1.255820834 -1.784828273 -0.925409319 0.312236855 [91] 0.756703187 0.042344436 -1.173088593 -0.786234880 -0.932937781 [96] -0.877150641 1.326800691 -0.593463633 -0.055961585 1.433904700 > colMedians(tmp) [1] -0.190200938 -0.389049448 -0.740835421 0.049624170 -0.219421165 [6] 0.388164461 0.050117934 1.352700370 2.131422475 0.440974276 [11] -1.565630502 0.764577575 -0.609255972 -0.670076832 -0.575814680 [16] -0.472267974 1.960390993 0.347322875 1.460160890 -0.168661619 [21] 1.098264875 1.051562242 -0.545098916 1.907286418 -0.988814438 [26] -0.593011338 0.526633153 0.560970777 0.173900375 -0.876845296 [31] -0.169945187 0.581211730 0.719547072 -0.324812342 0.295113770 [36] -1.656020813 1.449755422 -0.806305515 1.661948534 -0.947692442 [41] -0.706819521 1.414578779 0.660660677 0.432008682 -0.296924084 [46] 1.229122167 0.688590696 0.005045701 0.398186903 -1.411567796 [51] 0.126155811 0.631652768 -1.955575206 -2.132201780 -1.025226027 [56] 0.291836050 0.007812224 -1.055933499 0.563334800 -0.700361264 [61] 1.345371852 1.896727069 -0.016275424 0.096005557 0.005072537 [66] 1.541882828 -0.233683648 -0.342017252 0.083576744 -1.076401384 [71] 1.073121854 -1.265964628 0.471850608 -1.035705968 -0.377882487 [76] -0.156639019 -1.782263774 1.544574272 0.088333697 -1.110697295 [81] 0.582917302 -0.470436015 -0.453509814 -0.929282378 1.249927591 [86] 0.861449958 1.255820834 -1.784828273 -0.925409319 0.312236855 [91] 0.756703187 0.042344436 -1.173088593 -0.786234880 -0.932937781 [96] -0.877150641 1.326800691 -0.593463633 -0.055961585 1.433904700 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.1902009 -0.3890494 -0.7408354 0.04962417 -0.2194212 0.3881645 [2,] -0.1902009 -0.3890494 -0.7408354 0.04962417 -0.2194212 0.3881645 [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.05011793 1.3527 2.131422 0.4409743 -1.565631 0.7645776 -0.609256 [2,] 0.05011793 1.3527 2.131422 0.4409743 -1.565631 0.7645776 -0.609256 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] -0.6700768 -0.5758147 -0.472268 1.960391 0.3473229 1.460161 -0.1686616 [2,] -0.6700768 -0.5758147 -0.472268 1.960391 0.3473229 1.460161 -0.1686616 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [1,] 1.098265 1.051562 -0.5450989 1.907286 -0.9888144 -0.5930113 0.5266332 [2,] 1.098265 1.051562 -0.5450989 1.907286 -0.9888144 -0.5930113 0.5266332 [,28] [,29] [,30] [,31] [,32] [,33] [,34] [1,] 0.5609708 0.1739004 -0.8768453 -0.1699452 0.5812117 0.7195471 -0.3248123 [2,] 0.5609708 0.1739004 -0.8768453 -0.1699452 0.5812117 0.7195471 -0.3248123 [,35] [,36] [,37] [,38] [,39] [,40] [,41] [1,] 0.2951138 -1.656021 1.449755 -0.8063055 1.661949 -0.9476924 -0.7068195 [2,] 0.2951138 -1.656021 1.449755 -0.8063055 1.661949 -0.9476924 -0.7068195 [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 1.414579 0.6606607 0.4320087 -0.2969241 1.229122 0.6885907 0.005045701 [2,] 1.414579 0.6606607 0.4320087 -0.2969241 1.229122 0.6885907 0.005045701 [,49] [,50] [,51] [,52] [,53] [,54] [,55] [1,] 0.3981869 -1.411568 0.1261558 0.6316528 -1.955575 -2.132202 -1.025226 [2,] 0.3981869 -1.411568 0.1261558 0.6316528 -1.955575 -2.132202 -1.025226 [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] 0.291836 0.007812224 -1.055933 0.5633348 -0.7003613 1.345372 1.896727 [2,] 0.291836 0.007812224 -1.055933 0.5633348 -0.7003613 1.345372 1.896727 [,63] [,64] [,65] [,66] [,67] [,68] [1,] -0.01627542 0.09600556 0.005072537 1.541883 -0.2336836 -0.3420173 [2,] -0.01627542 0.09600556 0.005072537 1.541883 -0.2336836 -0.3420173 [,69] [,70] [,71] [,72] [,73] [,74] [,75] [1,] 0.08357674 -1.076401 1.073122 -1.265965 0.4718506 -1.035706 -0.3778825 [2,] 0.08357674 -1.076401 1.073122 -1.265965 0.4718506 -1.035706 -0.3778825 [,76] [,77] [,78] [,79] [,80] [,81] [,82] [1,] -0.156639 -1.782264 1.544574 0.0883337 -1.110697 0.5829173 -0.470436 [2,] -0.156639 -1.782264 1.544574 0.0883337 -1.110697 0.5829173 -0.470436 [,83] [,84] [,85] [,86] [,87] [,88] [,89] [1,] -0.4535098 -0.9292824 1.249928 0.86145 1.255821 -1.784828 -0.9254093 [2,] -0.4535098 -0.9292824 1.249928 0.86145 1.255821 -1.784828 -0.9254093 [,90] [,91] [,92] [,93] [,94] [,95] [,96] [1,] 0.3122369 0.7567032 0.04234444 -1.173089 -0.7862349 -0.9329378 -0.8771506 [2,] 0.3122369 0.7567032 0.04234444 -1.173089 -0.7862349 -0.9329378 -0.8771506 [,97] [,98] [,99] [,100] [1,] 1.326801 -0.5934636 -0.05596159 1.433905 [2,] 1.326801 -0.5934636 -0.05596159 1.433905 > > > Max(tmp2) [1] 2.441078 > Min(tmp2) [1] -2.817703 > mean(tmp2) [1] -0.04195861 > Sum(tmp2) [1] -4.195861 > Var(tmp2) [1] 0.7668008 > > rowMeans(tmp2) [1] 1.2429347711 -0.7302361617 0.2855994600 -0.9148112147 -0.8111407835 [6] -0.7980073687 -1.5685108162 -0.3410067069 0.1861213336 -0.2518254416 [11] 0.2423256198 -0.1592813875 0.1979156076 -0.7126969317 -0.4621010049 [16] 0.0629328285 -0.6859422496 0.2377501629 0.3372402687 -0.4091428181 [21] -0.3394698967 -0.8544512207 0.3837618772 -0.0192885519 -0.2269253223 [26] -0.1399835505 -0.2353043044 0.5119008233 -0.2053138912 0.3930390440 [31] -1.0443660240 0.3648387429 -0.5302608832 0.3644993341 0.1556717473 [36] 1.8098055818 0.4469075476 -1.2323246384 -1.5271669811 0.3966049647 [41] 1.3738947035 -1.3234434905 0.1176414189 1.1266867399 -0.1571512543 [46] -1.0494012698 0.0455273275 -0.3693345493 0.7036086262 0.2196142407 [51] -0.1323640197 1.9364875264 -2.8177033886 0.0618352272 0.4029429403 [56] 0.9238250409 -0.4996132695 -0.9439405624 0.2123615956 0.9976987332 [61] -0.0722028674 -0.9054106581 0.9799785249 -2.0082060411 -0.7337660976 [66] -0.9459083443 1.0914133619 -0.8650743128 -0.1542555321 -0.1672859374 [71] -0.4621638853 -0.3201311679 1.0027091674 -0.6072981123 -0.8679178255 [76] -0.7790470558 1.3254985495 -0.2822534924 -1.0635417763 1.8192535807 [81] -0.0001473298 -0.6713328903 0.9512047460 0.6691540328 2.4410781400 [86] -0.3978753553 -0.1242334084 0.9685344333 0.3668552867 1.2847916280 [91] -0.4370980496 0.2626353313 -1.2608681773 1.5375142509 -0.1382469376 [96] 1.0431789728 -0.2381889673 0.1966466903 -0.6271853804 -0.2561323111 > rowSums(tmp2) [1] 1.2429347711 -0.7302361617 0.2855994600 -0.9148112147 -0.8111407835 [6] -0.7980073687 -1.5685108162 -0.3410067069 0.1861213336 -0.2518254416 [11] 0.2423256198 -0.1592813875 0.1979156076 -0.7126969317 -0.4621010049 [16] 0.0629328285 -0.6859422496 0.2377501629 0.3372402687 -0.4091428181 [21] -0.3394698967 -0.8544512207 0.3837618772 -0.0192885519 -0.2269253223 [26] -0.1399835505 -0.2353043044 0.5119008233 -0.2053138912 0.3930390440 [31] -1.0443660240 0.3648387429 -0.5302608832 0.3644993341 0.1556717473 [36] 1.8098055818 0.4469075476 -1.2323246384 -1.5271669811 0.3966049647 [41] 1.3738947035 -1.3234434905 0.1176414189 1.1266867399 -0.1571512543 [46] -1.0494012698 0.0455273275 -0.3693345493 0.7036086262 0.2196142407 [51] -0.1323640197 1.9364875264 -2.8177033886 0.0618352272 0.4029429403 [56] 0.9238250409 -0.4996132695 -0.9439405624 0.2123615956 0.9976987332 [61] -0.0722028674 -0.9054106581 0.9799785249 -2.0082060411 -0.7337660976 [66] -0.9459083443 1.0914133619 -0.8650743128 -0.1542555321 -0.1672859374 [71] -0.4621638853 -0.3201311679 1.0027091674 -0.6072981123 -0.8679178255 [76] -0.7790470558 1.3254985495 -0.2822534924 -1.0635417763 1.8192535807 [81] -0.0001473298 -0.6713328903 0.9512047460 0.6691540328 2.4410781400 [86] -0.3978753553 -0.1242334084 0.9685344333 0.3668552867 1.2847916280 [91] -0.4370980496 0.2626353313 -1.2608681773 1.5375142509 -0.1382469376 [96] 1.0431789728 -0.2381889673 0.1966466903 -0.6271853804 -0.2561323111 > 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] 1.2429347711 -0.7302361617 0.2855994600 -0.9148112147 -0.8111407835 [6] -0.7980073687 -1.5685108162 -0.3410067069 0.1861213336 -0.2518254416 [11] 0.2423256198 -0.1592813875 0.1979156076 -0.7126969317 -0.4621010049 [16] 0.0629328285 -0.6859422496 0.2377501629 0.3372402687 -0.4091428181 [21] -0.3394698967 -0.8544512207 0.3837618772 -0.0192885519 -0.2269253223 [26] -0.1399835505 -0.2353043044 0.5119008233 -0.2053138912 0.3930390440 [31] -1.0443660240 0.3648387429 -0.5302608832 0.3644993341 0.1556717473 [36] 1.8098055818 0.4469075476 -1.2323246384 -1.5271669811 0.3966049647 [41] 1.3738947035 -1.3234434905 0.1176414189 1.1266867399 -0.1571512543 [46] -1.0494012698 0.0455273275 -0.3693345493 0.7036086262 0.2196142407 [51] -0.1323640197 1.9364875264 -2.8177033886 0.0618352272 0.4029429403 [56] 0.9238250409 -0.4996132695 -0.9439405624 0.2123615956 0.9976987332 [61] -0.0722028674 -0.9054106581 0.9799785249 -2.0082060411 -0.7337660976 [66] -0.9459083443 1.0914133619 -0.8650743128 -0.1542555321 -0.1672859374 [71] -0.4621638853 -0.3201311679 1.0027091674 -0.6072981123 -0.8679178255 [76] -0.7790470558 1.3254985495 -0.2822534924 -1.0635417763 1.8192535807 [81] -0.0001473298 -0.6713328903 0.9512047460 0.6691540328 2.4410781400 [86] -0.3978753553 -0.1242334084 0.9685344333 0.3668552867 1.2847916280 [91] -0.4370980496 0.2626353313 -1.2608681773 1.5375142509 -0.1382469376 [96] 1.0431789728 -0.2381889673 0.1966466903 -0.6271853804 -0.2561323111 > rowMin(tmp2) [1] 1.2429347711 -0.7302361617 0.2855994600 -0.9148112147 -0.8111407835 [6] -0.7980073687 -1.5685108162 -0.3410067069 0.1861213336 -0.2518254416 [11] 0.2423256198 -0.1592813875 0.1979156076 -0.7126969317 -0.4621010049 [16] 0.0629328285 -0.6859422496 0.2377501629 0.3372402687 -0.4091428181 [21] -0.3394698967 -0.8544512207 0.3837618772 -0.0192885519 -0.2269253223 [26] -0.1399835505 -0.2353043044 0.5119008233 -0.2053138912 0.3930390440 [31] -1.0443660240 0.3648387429 -0.5302608832 0.3644993341 0.1556717473 [36] 1.8098055818 0.4469075476 -1.2323246384 -1.5271669811 0.3966049647 [41] 1.3738947035 -1.3234434905 0.1176414189 1.1266867399 -0.1571512543 [46] -1.0494012698 0.0455273275 -0.3693345493 0.7036086262 0.2196142407 [51] -0.1323640197 1.9364875264 -2.8177033886 0.0618352272 0.4029429403 [56] 0.9238250409 -0.4996132695 -0.9439405624 0.2123615956 0.9976987332 [61] -0.0722028674 -0.9054106581 0.9799785249 -2.0082060411 -0.7337660976 [66] -0.9459083443 1.0914133619 -0.8650743128 -0.1542555321 -0.1672859374 [71] -0.4621638853 -0.3201311679 1.0027091674 -0.6072981123 -0.8679178255 [76] -0.7790470558 1.3254985495 -0.2822534924 -1.0635417763 1.8192535807 [81] -0.0001473298 -0.6713328903 0.9512047460 0.6691540328 2.4410781400 [86] -0.3978753553 -0.1242334084 0.9685344333 0.3668552867 1.2847916280 [91] -0.4370980496 0.2626353313 -1.2608681773 1.5375142509 -0.1382469376 [96] 1.0431789728 -0.2381889673 0.1966466903 -0.6271853804 -0.2561323111 > > colMeans(tmp2) [1] -0.04195861 > colSums(tmp2) [1] -4.195861 > colVars(tmp2) [1] 0.7668008 > colSd(tmp2) [1] 0.8756716 > colMax(tmp2) [1] 2.441078 > colMin(tmp2) [1] -2.817703 > colMedians(tmp2) [1] -0.1391152 > colRanges(tmp2) [,1] [1,] -2.817703 [2,] 2.441078 > > 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] 5.7443476 0.4990458 2.2366061 1.4760780 -0.5955448 2.4694218 [7] -2.0310494 -2.9065203 -4.7064269 0.6585423 > colApply(tmp,quantile)[,1] [,1] [1,] -1.6235320 [2,] -0.6784610 [3,] 0.9252759 [4,] 1.6812935 [5,] 2.2398803 > > rowApply(tmp,sum) [1] 0.29207288 -0.01267084 0.67685076 1.38347954 3.68225354 -1.18049420 [7] 1.11423339 -5.05984244 -0.96041053 2.90902809 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 10 10 5 9 10 3 5 1 2 10 [2,] 1 8 4 5 5 9 7 4 4 9 [3,] 6 4 6 10 2 5 4 7 7 2 [4,] 4 9 10 8 9 8 2 2 5 6 [5,] 5 6 2 6 3 4 10 3 9 5 [6,] 7 7 9 7 1 10 9 9 3 3 [7,] 2 3 7 2 8 1 8 5 8 8 [8,] 3 2 1 1 4 6 6 10 10 4 [9,] 9 5 3 3 6 2 1 8 1 1 [10,] 8 1 8 4 7 7 3 6 6 7 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] 0.01839903 -3.43962180 -2.22040980 2.34956928 2.44990396 -2.64355401 [7] -3.24596313 -1.67844363 2.25116710 -0.31700933 2.20639126 -1.29035049 [13] -1.15351298 -2.98193766 3.81354807 -2.15138261 -0.01319109 0.38835675 [19] 3.64490458 2.15290709 > colApply(tmp,quantile)[,1] [,1] [1,] -1.6835793 [2,] -0.4305214 [3,] 0.0914728 [4,] 0.4874112 [5,] 1.5536157 > > rowApply(tmp,sum) [1] 0.1810177 0.9352429 1.8005647 0.1353328 -4.9123874 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 6 13 1 12 20 [2,] 3 7 16 4 6 [3,] 17 4 3 9 7 [4,] 5 15 14 13 19 [5,] 10 19 11 15 15 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.4305214 -1.4243571 0.9592294 -0.5850948 -0.03918840 0.36949203 [2,] 0.4874112 -0.7162925 -0.9050118 0.6221516 1.33886198 0.08794429 [3,] -1.6835793 0.8369910 -0.8806030 0.7235651 0.02399301 -0.20622314 [4,] 0.0914728 -0.9884671 -0.2652621 0.1731900 0.51042827 -1.41022877 [5,] 1.5536157 -1.1474961 -1.1287623 1.4157574 0.61580910 -1.48453842 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.8487226 0.2177119 0.7288596 1.2788516 1.0848119 -0.1510381 [2,] -1.1209787 0.3288136 -0.7812211 -0.8897871 1.0901107 0.7315473 [3,] 1.4959644 -0.1269946 -0.2948254 0.7737253 -0.5878997 -0.6104510 [4,] -1.4970177 -0.8868147 1.5614062 -0.8685076 -0.5514257 -1.9682182 [5,] -1.2752085 -1.2111598 1.0369477 -0.6112916 1.1707940 0.7078096 [,13] [,14] [,15] [,16] [,17] [,18] [1,] -0.2142505 -0.2372194 1.7114861 0.30970965 -2.7537463 -1.4425911 [2,] -0.4039045 -1.9970984 0.5694467 -0.95636709 0.3354727 0.9196445 [3,] 1.4603219 0.1672705 1.1566186 -0.59456095 1.3155106 0.4032097 [4,] -0.1510470 -0.7950447 0.9245828 0.04737433 1.1467810 0.2891821 [5,] -1.8446328 -0.1198455 -0.5485861 -0.95753855 -0.0572091 0.2189117 [,19] [,20] [1,] 0.6999064 0.9476890 [2,] 1.9362268 0.2582728 [3,] -0.1356892 -1.4357790 [4,] 2.5284848 2.2444639 [5,] -1.3840243 0.1382605 > > > is.BufferedMatrix(tmp) [1] TRUE > > as.BufferedMatrix(as.matrix(tmp)) BufferedMatrix object Matrix size: 5 20 Buffer size: 1 1 Directory: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.8 Kilobytes. Disk usage : 800 bytes. > > > > subBufferedMatrix(tmp,1:5,1:5) BufferedMatrix object Matrix size: 5 5 Buffer size: 1 1 Directory: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 623 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 542 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.8 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 1.090904 -0.7122118 -1.019478 -0.03769289 1.204996 -0.7571123 0.1264541 col8 col9 col10 col11 col12 col13 col14 row1 1.190524 -0.6585777 -0.1464637 -0.3324308 -1.220363 0.4277189 0.4402797 col15 col16 col17 col18 col19 col20 row1 -1.345143 0.0007246959 -0.7096265 -2.462579 0.712075 0.2922908 > tmp[,"col10"] col10 row1 -0.14646367 row2 -0.02305769 row3 -1.08415991 row4 0.82289194 row5 0.75985965 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 row1 1.090904 -0.7122118 -1.0194782 -0.03769289 1.2049961 -0.7571123 0.1264541 row5 1.422529 -0.4151854 0.4116566 1.95819583 0.5546128 0.3627349 0.8181667 col8 col9 col10 col11 col12 col13 col14 row1 1.1905238 -0.6585777 -0.1464637 -0.3324308 -1.2203632 0.4277189 0.4402797 row5 0.8198911 -1.1771447 0.7598597 -0.2943938 -0.5486896 0.9987774 1.1919605 col15 col16 col17 col18 col19 col20 row1 -1.3451435 0.0007246959 -0.7096265 -2.4625786 0.712075 0.2922908 row5 0.7279752 0.2213213865 1.7475052 0.7529173 -0.956672 -1.4128781 > tmp[,c("col6","col20")] col6 col20 row1 -0.7571123 0.2922908 row2 -1.1979907 2.2761651 row3 -0.5690825 -1.1289125 row4 1.0548564 0.8615344 row5 0.3627349 -1.4128781 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 -0.7571123 0.2922908 row5 0.3627349 -1.4128781 > > > > > 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 51.0656 47.97873 50.79135 48.99539 49.95725 105.1504 48.66334 51.46604 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.15712 49.92318 50.77139 48.17082 50.11313 48.52432 50.67273 50.0673 col17 col18 col19 col20 row1 49.15851 49.9332 49.19786 105.2266 > tmp[,"col10"] col10 row1 49.92318 row2 30.14319 row3 30.73151 row4 29.69078 row5 51.20356 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 51.06560 47.97873 50.79135 48.99539 49.95725 105.1504 48.66334 51.46604 row5 49.78098 49.97241 50.19770 49.63402 49.73428 104.8989 49.72236 51.15457 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.15712 49.92318 50.77139 48.17082 50.11313 48.52432 50.67273 50.06730 row5 50.40485 51.20356 49.46205 50.06484 50.38733 48.83601 50.32784 51.02727 col17 col18 col19 col20 row1 49.15851 49.93320 49.19786 105.2266 row5 51.46801 52.21574 51.90839 104.0310 > tmp[,c("col6","col20")] col6 col20 row1 105.15044 105.22663 row2 74.71906 74.36510 row3 76.30300 75.85345 row4 75.73772 74.44078 row5 104.89889 104.03104 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 105.1504 105.2266 row5 104.8989 104.0310 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 105.1504 105.2266 row5 104.8989 104.0310 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] 1.20355396 [2,] -0.97876852 [3,] -1.42295376 [4,] -1.73919708 [5,] -0.01693154 > tmp[,c("col17","col7")] col17 col7 [1,] -0.7181234 -1.552952418 [2,] 1.0789413 -0.894618735 [3,] -0.8308209 -0.008586807 [4,] -0.8777849 0.357621634 [5,] 0.1590638 0.133987685 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] -0.1380036 -2.5837510 [2,] -1.3035034 -2.4167785 [3,] 1.2419074 0.5482896 [4,] -0.6693120 -0.6186413 [5,] 0.6912006 0.8899204 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] -0.1380036 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] -0.1380036 [2,] -1.3035034 > > > > 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] [,7] row3 1.046888 0.0630888 0.4403938 -0.6988365 0.2597865 1.581773 0.1899261 row1 1.376474 0.8322108 1.4794624 -2.2420950 -1.8996551 -0.283480 -0.4881154 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row3 -0.7167256 1.333695 -0.5971273 1.8167848 1.3212858 0.0788603 0.3968605 row1 1.3900524 1.533554 -0.2691414 0.2056888 -0.5982675 -0.3196641 -0.5898199 [,15] [,16] [,17] [,18] [,19] [,20] row3 -0.2323664 -0.29580311 -1.2982201 -2.294339 -0.4810410 -0.1667822 row1 -1.4057165 -0.01425532 0.9852048 -0.188250 0.2736555 -1.1866187 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -0.001280877 -1.437531 -1.365867 1.166761 -1.554937 -0.4830927 -1.219657 [,8] [,9] [,10] row2 -1.16103 -1.475445 0.4463286 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 0.08733185 1.165748 2.054643 -1.470681 -0.5574486 0.002016478 0.00839326 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -0.1081876 1.595109 -0.7372786 -0.071646 0.854594 0.248232 1.250124 [,15] [,16] [,17] [,18] [,19] [,20] row5 -0.575083 -1.772771 1.011275 -0.8462448 2.036434 0.06260329 > > > 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: 0x0000021aaacfad10> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d687e407223" [2] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d68267431c6" [3] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d684e6c565b" [4] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d6817dd2e95" [5] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d68631e7c21" [6] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d686b2c1600" [7] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d687b1672ce" [8] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d684fac237" [9] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d68f94372d" [10] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d6855437091" [11] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d6861611c76" [12] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d6819d1224" [13] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d68570e4180" [14] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d684086a92" [15] "F:/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests\\BM2d6810806632" > > > ### 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: 0x0000021aacfff110> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x0000021aacfff110> Warning message: In dir.create(new.directory) : 'F:\biocbuild\bbs-3.20-bioc\meat\BufferedMatrix.Rcheck\tests' already exists > > > RowMode(tmp) <pointer: 0x0000021aacfff110> > rowMedians(tmp) [1] -0.032315362 -0.279241357 -0.870503330 -0.005681274 0.524521045 [6] 0.087141253 0.501082979 0.404395956 -0.014696944 0.252300819 [11] 0.280361157 0.094629318 -0.562690007 0.209772755 -0.271156426 [16] -0.144488821 -0.286046188 0.303581623 0.094552726 -0.143976800 [21] -0.628422245 -0.224827938 -0.157203436 -0.171495456 -0.021444477 [26] 0.304760305 -0.109512017 0.065195003 -0.353683371 0.294289630 [31] -0.384275674 0.480538929 0.509879118 -0.275383789 -0.350839694 [36] -0.054515747 -0.188530265 -0.329383890 -0.274032877 -0.136825077 [41] 0.061911888 0.151872138 0.052916675 0.223708249 0.020033767 [46] -0.336608164 0.303985136 0.106786935 0.035389226 0.228822306 [51] 0.679175572 0.027811542 -0.301291826 -0.774154287 -0.123260229 [56] 0.374091070 -0.067321445 -0.593319400 -0.054719629 0.112344882 [61] -0.239433826 -0.017932129 0.151970580 -0.421296534 -0.157468820 [66] 0.485922160 0.299438748 0.269401773 0.021734007 0.251141428 [71] -0.576441778 -0.112132597 0.040996148 0.165568221 -0.337050728 [76] 0.162984667 -0.304252269 -0.534686895 0.113473880 -0.321618546 [81] -0.009222042 0.089556566 0.169800078 0.265575368 -0.157542448 [86] 0.518258365 0.005303257 0.007858413 -0.076977007 0.234050890 [91] 0.039688085 -0.176740958 0.625546952 -0.598434308 0.328014045 [96] 0.255257715 0.199668882 -0.032735852 0.172594060 0.331823056 [101] -0.134328669 0.237886359 0.247811280 0.156852897 0.392829962 [106] 0.001023434 -0.405594993 0.223503134 0.049284580 0.005065119 [111] -0.286059672 -0.084367779 -0.132576548 0.007742882 -0.028978786 [116] -0.369478438 -0.111033325 0.213611585 -0.018849942 -0.209709662 [121] 0.006847541 -0.126202929 -0.089180402 -0.132420350 -0.605694707 [126] 0.499823239 -0.101161588 -0.425981193 0.967538738 0.174458792 [131] -0.445921407 0.167796608 -0.439123947 -0.464542659 -0.256923485 [136] 0.149557322 -0.144248388 -0.262135031 0.156873376 0.126911240 [141] 0.120550104 0.252351647 -0.116193244 0.101141536 0.094813118 [146] -0.410323784 0.297532955 -0.007736406 0.748400764 -0.784967041 [151] -0.107139869 -0.418383759 0.085926387 0.146995667 -0.527118627 [156] -0.009083659 0.050404529 0.116008335 -0.536793678 0.207752761 [161] 0.179338728 0.054728910 0.013431143 0.138385916 0.075551766 [166] 0.029702029 0.525445596 -0.208260184 -0.184598357 0.009573803 [171] 0.164899175 -0.009465120 -0.106577674 -0.293140484 -0.503838344 [176] -0.377825086 -0.169066319 -0.025995853 -0.027183212 0.128804824 [181] -0.470435351 0.193179834 -0.227709643 0.401420245 0.144935722 [186] -0.855481635 0.006186385 0.074026829 -0.289391151 0.115119415 [191] -0.079320124 -0.159971857 -0.068784691 -0.402247757 -0.643777616 [196] -0.797297955 0.330386170 0.151699523 0.417901084 -0.459143445 [201] 0.218106429 -0.038804178 -0.065243186 0.638083256 0.165672121 [206] -0.511605550 -0.161486788 -0.349850645 0.093659245 0.650188309 [211] -0.417563725 0.413329650 -0.259231092 -0.282360806 -0.081362281 [216] 0.249404808 0.181635087 0.434334908 0.578084393 0.014530177 [221] 0.566169226 -0.212972408 -0.363392009 0.692461744 -0.605009563 [226] -0.001947344 -0.054817728 0.406858255 0.495713241 0.138115916 > > proc.time() user system elapsed 4.73 26.10 48.46
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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: 0x000001f6280fd1d0> > .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: 0x000001f6280fd1d0> > .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: 0x000001f6280fd1d0> > .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: 0x000001f6280fd1d0> > 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: 0x000001f6280fd6b0> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd6b0> > .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: 0x000001f6280fd6b0> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd6b0> > .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: 0x000001f6280fd6b0> > 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: 0x000001f6280fd7d0> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd7d0> > .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: 0x000001f6280fd7d0> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x000001f6280fd7d0> > .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: 0x000001f6280fd7d0> > > .Call("R_bm_RowMode",P) <pointer: 0x000001f6280fd7d0> > .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: 0x000001f6280fd7d0> > > .Call("R_bm_ColMode",P) <pointer: 0x000001f6280fd7d0> > .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: 0x000001f6280fd7d0> > 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: 0x000001f6280fd9b0> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x000001f6280fd9b0> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd9b0> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd9b0> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile2eec172520f7" "BufferedMatrixFile2eec4f836fc5" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile2eec172520f7" "BufferedMatrixFile2eec4f836fc5" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd530> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fd530> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x000001f6280fd530> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x000001f6280fd530> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x000001f6280fd530> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x000001f6280fd530> > .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: 0x000001f6280fdb90> > .Call("R_bm_AddColumn",P) <pointer: 0x000001f6280fdb90> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x000001f6280fdb90> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x000001f6280fdb90> > 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: 0x000001f62667abf0> > .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: 0x000001f62667abf0> > rm(P) > > proc.time() user system elapsed 0.23 0.54 0.65
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.4.0 RC (2024-04-16 r86468 ucrt) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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.29 0.21 0.40