[R] Help with developing package DWLS
Andrew Simmons
@kw@|mmo @end|ng |rom gm@||@com
Tue Jan 11 11:04:20 CET 2022
The NOTE saying 'Possibly misspelled words in DESCRIPTION' can probably be
ignored (though I would probably put the name of your package in single
quotes).
The NOTE 'Non-standard files/directories found at top level' means that you
should move the non-standard files to a different location OR add the
files/directories to your .Rbuildignore file
For example, in my own packages, I usually have a script that will
conveniently run R CMD build, R CMD INSTALL, and R CMD check on that
package, but I don't want to include it in the *.tar.gz, so I add the line:
^Check_This\.R$
to the .Rbuildignore file, and then it's not included. For you, adding
something like:
^Reference_Manual_DWLS\.md$
^Reference_Manual_Rd2md\.md$
might work.
The NOTE 'DEAnalysisMAST: no visible binding for global variable
'Number.of.Cells'', basically on line 46 of the function you have
something like vbeta.1 <- subset(vbeta.fa, Number.of.Cells == 1)
Anyone reading this would know that Number.of.Cells == 1 is evaluated
within the context vbeta.fa, but R CMD check doesn't, so something like:
vbeta.1 <- vbeta.fa[vbeta.fa[["Number.of.Cells"]] == 1, , drop = FALSE]
might get around this issue while still behaving the same code-wise.
The WARNING 'Undocumented code objects:', even though these objects you've
exported are not functions, they still need a documentation file.
It seems like you're using roxygen for documentation, I'm not familiar with
that, but I'd imagine it's nearly identical to documenting a function.
Here's the chapter of the manual they were referring to:
https://cran.r-project.org/doc/manuals/R-exts.html#Writing-R-documentation-files
The NOTE 'installed size is 66.4Mb'
and WARNING 'LazyData DB of 66.3 MB without LazyDataCompression set'
basically, you have too much data. Or not too much necessarily, but it's
not compressed enough.
The default compression is gzip, but you can also try bzip2 and xz.
You can do this by adding the argument --data-compress=bzip2
or --data-compress=xz to R CMD INSTALL,
or you can add LazyDataCompression: bzip2 or LazyDataCompression: xz to
your DESCRIPTION file.
It seems like you already have the line LazyDataCompression: xz in your
DESCRIPTION, but it's commented out, might want to un-comment it.
Also, for comparisons sake, you could add '-1' to the package version
and LazyDataCompression:
gzip, and then do the same thing adding '-2' and LazyDataCompression:
bzip2, and '-3' and LazyDataCompression: xz so that you figure out which
has the best compression.
You can also visit here for more details:
https://cran.r-project.org/doc/manuals/R-exts.html#Data-in-packages
The NOTE 'Examples with CPU (user + system) or elapsed time > 10s'
basically, your examples need to not take as long. If you'd like, you could
move the long computations into a demo, see here:
https://cran.r-project.org/doc/manuals/R-exts.html#Package-subdirectories
Or you could also add a question for the user:
if (utils::askYesNo("Would you like to run the longer, more involved
example?", default = interactive())) {
# long example
} else {
# make a shorter example here
}
and this way, when being check by R CMD check, it will run the short
example, while still allowing the user to run the long example.
I don't think I can offer much help with the last ERROR,
Might also be worth noting, my Windows machine brings up some things that
yours doesn't. For example, it says the directory should be named 'data',
not 'Data'.
Here's the rest of the print out:
andre using DESKTOP-VR312SR:~$ R CMD "check" "--as-cran"
"C:\Users\andre\AppData\Local\Temp\RtmpcjdmpU\file4b8c681a309f\DWLS_0.1.0.tar.gz"
* using log directory 'C:/Users/andre/Documents/DWLS.Rcheck'
* using R version 4.1.2 (2021-11-01)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--as-cran'
* checking for file 'DWLS/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'DWLS' version '0.1.0'
* package encoding: UTF-8
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Adriana Sistig <adriana.sistig using icahn.mssm.edu>'
New submission
Unknown, possibly mis-spelled, fields in DESCRIPTION:
'RemoteType' 'RemoteHost' 'RemoteRepo' 'RemoteUsername' 'RemoteRef'
'RemoteSha' 'GithubRepo' 'GithubUsername' 'GithubRef' 'GithubSHA1'
Size of tarball: 32169874 bytes
* 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 executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'DWLS' can be installed ... OK
* checking installed package size ... NOTE
installed size is 66.4Mb
sub-directories of 1Mb or more:
data 66.3Mb
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... NOTE
Non-standard file/directory found at top level:
'Data'
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ...
OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking use of S3 registration ... 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 ... NOTE
DEAnalysisMAST: no visible binding for global variable
'Number.of.Cells'
Undefined global functions or variables:
Number.of.Cells
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... WARNING
Undocumented code objects:
'Sig' 'dataBulk' 'dataSC_1' 'dataSC_2' 'labels' 'trueLabels'
Undocumented data sets:
'Sig' 'dataBulk' 'dataSC_1' 'dataSC_2' 'labels' 'trueLabels'
All user-level objects in a package should have documentation entries.
See chapter 'Writing R documentation files' in the 'Writing R
Extensions' manual.
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking LazyData ... WARNING
LazyData DB of 66.3 MB without LazyDataCompression set
See §1.1.6 of 'Writing R Extensions'
* checking data for ASCII and uncompressed saves ... OK
* checking R/sysdata.rda ... OK
* checking examples ... ERROR
Running examples in 'DWLS-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: stat.log2
> ### Title: stat.log2
> ### Aliases: stat.log2
>
> ### ** Examples
>
> pseudo.count = 0.1
> dataSC <- cbind(dataSC_1, dataSC_2)
> data.used.log2 <- log2(dataSC+pseudo.count)
> colnames(data.used.log2)<-make.unique(colnames(data.used.log2))
> diff.cutoff=0.5
> for (i in unique(labels)){
+ cells.symbol.list2 = colnames(data.used.log2)[which(labels==i)]
+ cells.coord.list2 = match(cells.symbol.list2, colnames(data.used.log2))
+ cells.symbol.list1 = colnames(data.used.log2)[which(labels != i)]
+ cells.coord.list1 = match(cells.symbol.list1, colnames(data.used.log2))
+ data.used.log2.ordered = cbind(data.used.log2[,cells.coord.list1],
+
data.used.log2[,cells.coord.list2])}
Error: cannot allocate vector of size 2.6 Gb
Execution halted
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
Running 'testthat.R'
OK
* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! Package inputenc Error: Unicode character − (U+2212)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
* checking PDF version of manual without hyperrefs or index ... ERROR
* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
'DWLS-manual.tex'
* checking for detritus in the temp directory ... NOTE
Found the following files/directories:
'lastMiKTeXException'
* DONE
Status: 2 ERRORs, 3 WARNINGs, 6 NOTEs
See
'C:/Users/andre/Documents/DWLS.Rcheck/00check.log'
for details.
Warning message:
In .system(command = command, ...) :
'R CMD "check" "--as-cran"
"C:\Users\andre\AppData\Local\Temp\RtmpcjdmpU\file4b8c681a309f\DWLS_0.1.0.tar.gz"'
execution failed with error code 1
On Tue, Jan 11, 2022 at 3:10 AM Adriana Sistig <
adriana.sistig using icahn.mssm.edu> wrote:
> Hello,
>
> My name is Adriana Sistig and I am struggle to fix an ERROR and a few
> WARNING and NOTE message that I am getting from my package. I am new to
> CRAN packaging and am having some trouble finalizing my package.
>
> I do not have any ERRORS when I check using Mac but when checking via
> Windows and Debian I do. The current Status: 1 ERROR, 3 WARNINGs, 6 NOTEs —
> Pasted below for more information.
>
> GitHub link: https://github.com/sistia01/DWLS <
> https://github.com/sistia01/DWLS>
>
> Further information:
>
> > sessionInfo()
> R version 4.0.5 (2021-03-31)
> Platform: x86_64-apple-darwin17.0 (64-bit)
> Running under: macOS Big Sur 10.16
>
> Matrix products: default
> LAPACK:
> /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] parallel stats graphics grDevices utils datasets methods
> base
>
> other attached packages:
> [1] DWLS_0.1.0 Giotto_1.0.3 Biobase_2.50.0
> BiocGenerics_0.36.1
>
> loaded via a namespace (and not attached):
> [1] Seurat_4.0.5 Rtsne_0.15
> colorspace_2.0-2
> [4] deldir_1.0-6 class_7.3-19
> ellipsis_0.3.2
> [7] ggridges_0.5.3 XVector_0.30.0
> GenomicRanges_1.42.0
> [10] proxy_0.4-26 spatstat.data_2.1-0
> leiden_0.3.9
> [13] listenv_0.8.0 ggrepel_0.9.1 fansi_0.5.0
>
> [16] codetools_0.2-18 splines_4.0.5
> polyclip_1.10-0
> [19] jsonlite_1.7.2 ica_1.0-2
> cluster_2.1.2
> [22] png_0.1-7 uwot_0.1.11 shiny_1.7.1
>
> [25] sctransform_0.3.2 spatstat.sparse_2.0-0
> compiler_4.0.5
> [28] httr_1.4.2 SeuratObject_4.0.4
> Matrix_1.3-4
> [31] fastmap_1.1.0 lazyeval_0.2.2 cli_3.1.0
>
> [34] later_1.3.0 htmltools_0.5.2 tools_4.0.5
>
> [37] igraph_1.2.9 gtable_0.3.0 glue_1.6.0
>
> [40] GenomeInfoDbData_1.2.4 RANN_2.6.1
> reshape2_1.4.4
> [43] dplyr_1.0.7 Rcpp_1.0.7
> scattermore_0.7
> [46] vctrs_0.3.8 nlme_3.1-153
> lmtest_0.9-39
> [49] stringr_1.4.0 globals_0.14.0 mime_0.12
>
> [52] miniUI_0.1.1.1 lifecycle_1.0.1 irlba_2.3.5
>
> [55] goftest_1.2-3 future_1.23.0
> zlibbioc_1.36.0
> [58] MASS_7.3-54 zoo_1.8-9
> scales_1.1.1
> [61] MAST_1.16.0 spatstat.core_2.3-2
> promises_1.2.0.1
> [64] MatrixGenerics_1.2.1 spatstat.utils_2.2-0
> SummarizedExperiment_1.20.0
> [67] RColorBrewer_1.1-2 SingleCellExperiment_1.12.0
> reticulate_1.22
> [70] pbapply_1.5-0 gridExtra_2.3
> ggplot2_3.3.5
> [73] rpart_4.1-15 reshape_0.8.8
> stringi_1.7.6
> [76] S4Vectors_0.28.1 e1071_1.7-9
> GenomeInfoDb_1.26.7
> [79] rlang_0.4.12 pkgconfig_2.0.3
> matrixStats_0.61.0
> [82] bitops_1.0-7 lattice_0.20-45 ROCR_1.0-11
>
> [85] purrr_0.3.4 tensor_1.5
> patchwork_1.1.1
> [88] htmlwidgets_1.5.4 cowplot_1.1.1
> tidyselect_1.1.1
> [91] parallelly_1.29.0 RcppAnnoy_0.0.19 plyr_1.8.6
>
> [94] magrittr_2.0.1 R6_2.5.1
> IRanges_2.24.1
> [97] generics_0.1.1 DBI_1.1.1
> DelayedArray_0.16.3
> [100] mgcv_1.8-38 pillar_1.6.4
> fitdistrplus_1.1-6
> [103] survival_3.2-13 abind_1.4-5
> RCurl_1.98-1.5
> [106] tibble_3.1.6 future.apply_1.8.1
> crayon_1.4.2
> [109] KernSmooth_2.23-20 utf8_1.2.2
> spatstat.geom_2.3-0
> [112] plotly_4.10.0 grid_4.0.5
> data.table_1.14.2
> [115] digest_0.6.29 xtable_1.8-4 tidyr_1.1.4
>
> [118] httpuv_1.6.3 stats4_4.0.5
> munsell_0.5.0
> [121] viridisLite_0.4.0 quadprog_1.5-8
>
> > Sys.getlocale()
> [1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8”
>
> —————————————————
> * using log directory 'd:/RCompile/CRANguest/R-devel/DWLS.Rcheck'
> * using R Under development (unstable) (2022-01-09 r81462 ucrt)
> * using platform: x86_64-w64-mingw32 (64-bit)
> * using session charset: UTF-8
> * checking for file 'DWLS/DESCRIPTION' ... OK
> * checking extension type ... Package
> * this is package 'DWLS' version '0.1.0'
> * package encoding: UTF-8
> * checking CRAN incoming feasibility ... NOTE
> Maintainer: 'Adriana Sistig <adriana.sistig using icahn.mssm.edu>'
>
> New submission
>
> Possibly misspelled words in DESCRIPTION:
> DWLS (25:67, 32:42)
> Deconvolution (3:24)
> deconvolution (26:46)
> transcriptomic (10:51)
> * 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 'DWLS' can be installed ... OK
> * checking installed package size ... NOTE
> installed size is 66.4Mb
> sub-directories of 1Mb or more:
> data 66.3Mb
> * checking package directory ... OK
> * checking for future file timestamps ... OK
> * checking DESCRIPTION meta-information ... OK
> * checking top-level files ... NOTE
> Non-standard files/directories found at top level:
> 'Reference_Manual_DWLS.md' 'Reference_Manual_Rd2md.md'
> * checking for left-over files ... OK
> * checking index information ... OK
> * checking package subdirectories ... OK
> * checking R files for non-ASCII characters ... OK
> * checking R files for syntax errors ... OK
> * checking whether the package can be loaded ... OK
> * checking whether the package can be loaded with stated dependencies ...
> OK
> * checking whether the package can be unloaded cleanly ... OK
> * checking whether the namespace can be loaded with stated dependencies
> ... OK
> * checking whether the namespace can be unloaded cleanly ... OK
> * checking loading without being on the library search path ... OK
> * checking use of S3 registration ... 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 ... [28s] NOTE
> DEAnalysisMAST: no visible binding for global variable
> 'Number.of.Cells'
> Undefined global functions or variables:
> Number.of.Cells
> * checking Rd files ... [1s] OK
> * checking Rd metadata ... OK
> * checking Rd line widths ... OK
> * checking Rd cross-references ... OK
> * checking for missing documentation entries ... WARNING
> Undocumented code objects:
> 'Sig' 'dataBulk' 'dataSC_1' 'dataSC_2' 'labels' 'trueLabels'
> Undocumented data sets:
> 'Sig' 'dataBulk' 'dataSC_1' 'dataSC_2' 'labels' 'trueLabels'
> All user-level objects in a package should have documentation entries.
> See chapter 'Writing R documentation files' in the 'Writing R
> Extensions' manual.
> * checking for code/documentation mismatches ... OK
> * checking Rd \usage sections ... OK
> * checking Rd contents ... OK
> * checking for unstated dependencies in examples ... OK
> * checking contents of 'data' directory ... OK
> * checking data for non-ASCII characters ... OK
> * checking LazyData ... WARNING
> LazyData DB of 66.3 MB without LazyDataCompression set
> See §1.1.6 of 'Writing R Extensions'
> * checking data for ASCII and uncompressed saves ... OK
> * checking R/sysdata.rda ... OK
> * checking examples ... [80s] NOTE
> Examples with CPU (user + system) or elapsed time > 10s
> user system elapsed
> stat.log2 50.87 11.58 62.45
> * checking for unstated dependencies in 'tests' ... OK
> * checking tests ... [9s] OK
> Running 'testthat.R' [9s]
> * checking PDF version of manual ... WARNING
> LaTeX errors when creating PDF version.
> This typically indicates Rd problems.
> LaTeX errors found:
> ! Package inputenc Error: Unicode character − (U+2212)
> (inputenc) not set up for use with LaTeX.
>
> See the inputenc package documentation for explanation.
> Type H <return> for immediate help.
> * checking PDF version of manual without hyperrefs or index ... ERROR
> * checking for detritus in the temp directory ... NOTE
> Found the following files/directories:
> 'lastMiKTeXException'
> * DONE
> Status: 1 ERROR, 3 WARNINGs, 6 NOTEs
> ——————
> With regard to the NOTE about function DEAnalysisMAST —> I’m unsure about
> why this function in particular is throwing a note while other functions
> which use very similar code are not.
> I have tried a few different methods to create the pdf document of the
> manual but have not been able to succeed. I’m unsure of how to decipher the
> LaTeX Errors and have found from further research online that this may
> actually be quite an arduous task. I would greatly appreciate any help with
> this as it is not something that I have been able to solve on my own for
> the past few months. Please let me know if any further information is
> required. I thank you in advance for your help.
>
> Best,
> Adriana Sistig
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]
More information about the R-help
mailing list