Re: [R] Method Guidance

2022-01-11 Thread Jim Lemon
Hi Jeff,
A completely obscure question deserves a completely obscure answer:

jrdf<-read.table(text="Time   Event_AEvent_B   Lag_B
1  1 10
2  0 11
3  0 00
4  1 00
5  0 11
6  0 00
7  0 13
8  1 10
9  0 00
10 0 12",
header=TRUE,stringsAsFactors=FALSE)
plot(jrdf$Time-0.2,jrdf$Event_A,type="p",
 xlim=c(1,12),ylim=c(0.9,1.1),
 xlab="Day",ylab="",main="The As and the Bs",
 pch=c(" ","A")[jrdf$Event_A+1],yaxt="n")
points(jrdf$Time+jrdf$Lag_B+0.2,jrdf$Event_B,pch=c(" ","B")[jrdf$Event_B+1])

Jim

On Wed, Jan 12, 2022 at 1:33 PM Jeff Newmiller  wrote:
>
> 1) Figure out how to post plain text please. What you saw is not what we see.
>
> 2) I see a "table" of input information but no specific expectation of what 
> would come out of this hypothetical function.
>
> 3) Maybe you will find something relevant in this blog post: 
> https://jdnewmil.github.io/blog/post/cumsum-and-diff-tricks/
>
> ps not sure what "grate so sour" was supposed to be.
>
> pps While loops are not necessarily evil.
>
> On January 11, 2022 4:56:20 PM PST, Jeff Reichman  
> wrote:
> >R-Help Forum
> >
> >
> >
> >Looking for a little guidance. Have an issue were I'm trying to determine
> >the time between when Event A happened(In days) to when a subsequent Event B
> >happens. For Example at Time 1 Evat A happens and subsequently Event B
> >happens at the same day (0) and the next day (1) then Event A happens again
> >at time 4 and Event B happens the next day and 3 days later so on and so
> >forth. I gather there is no function that will do that so I suspect I will
> >need to grate so sour of do while loop?  Any suggestions?
> >
> >
> >
> >
> >
> >Time  Event_A   Event_B   Time_B
> >
> >1  1  1
> >0
> >
> >2  0  1
> >1
> >
> >3  0  0
> >0
> >
> >4  1  0
> >0
> >
> >5  0  1
> >1
> >
> >6  0  0
> >0
> >
> >7  0  1
> >3
> >
> >8  1  1
> >0
> >
> >9  0  0
> >0
> >
> >10   0  1  2
> >
> >
> >
> >
> >Jeff Reichman
> >
> >
> >   [[alternative HTML version deleted]]
> >
> >__
> >R-help@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.
>
> --
> Sent from my phone. Please excuse my brevity.
>
> __
> R-help@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.

__
R-help@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.


Re: [R] Method Guidance

2022-01-11 Thread Jeff Newmiller
1) Figure out how to post plain text please. What you saw is not what we see.

2) I see a "table" of input information but no specific expectation of what 
would come out of this hypothetical function.

3) Maybe you will find something relevant in this blog post: 
https://jdnewmil.github.io/blog/post/cumsum-and-diff-tricks/

ps not sure what "grate so sour" was supposed to be.

pps While loops are not necessarily evil.

On January 11, 2022 4:56:20 PM PST, Jeff Reichman  
wrote:
>R-Help Forum
>
> 
>
>Looking for a little guidance. Have an issue were I'm trying to determine
>the time between when Event A happened(In days) to when a subsequent Event B
>happens. For Example at Time 1 Evat A happens and subsequently Event B
>happens at the same day (0) and the next day (1) then Event A happens again
>at time 4 and Event B happens the next day and 3 days later so on and so
>forth. I gather there is no function that will do that so I suspect I will
>need to grate so sour of do while loop?  Any suggestions?
>
> 
>
> 
>
>Time  Event_A   Event_B   Time_B
>
>1  1  1
>0
>
>2  0  1
>1  
>
>3  0  0
>0
>
>4  1  0
>0
>
>5  0  1
>1
>
>6  0  0
>0
>
>7  0  1
>3
>
>8  1  1
>0
>
>9  0  0
>0
>
>10   0  1  2
>
>
> 
>
>Jeff Reichman
>
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@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.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@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.


[R] Method Guidance

2022-01-11 Thread Jeff Reichman
R-Help Forum

 

Looking for a little guidance. Have an issue were I'm trying to determine
the time between when Event A happened(In days) to when a subsequent Event B
happens. For Example at Time 1 Evat A happens and subsequently Event B
happens at the same day (0) and the next day (1) then Event A happens again
at time 4 and Event B happens the next day and 3 days later so on and so
forth. I gather there is no function that will do that so I suspect I will
need to grate so sour of do while loop?  Any suggestions?

 

 

Time  Event_A   Event_B   Time_B

1  1  1
0

2  0  1
1  

3  0  0
0

4  1  0
0

5  0  1
1

6  0  0
0

7  0  1
3

8  1  1
0

9  0  0
0

10   0  1  2


 

Jeff Reichman


[[alternative HTML version deleted]]

__
R-help@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.


[R] [R-pkgs] Fwd: Ternary 2.0: Holdridge life zones and ternary plots

2022-01-11 Thread Martin R. Smith
Dear R users,

It is now possible to create and annotate Holdridge life zone plots using
functions modelled on the standard graphics package using the the package
"Ternary", whose v2.0 release is now available from CRAN:
https://CRAN.R-project.org/package=Ternary .
The vignette at https://ms609.github.io/Ternary/articles/Holdridge.html gives
an example and pointers to detailed documentation.

Ternary 2.0 also includes a complete 'shiny' graphical user interface to
allow interactive construction of ternary plots without detailed knowledge
of R.

Regards,

Martin Smith


--

*Dr. Martin R. Smith*
Associate Professor in Palaeontology
Durham University
Department of Earth Sciences
Mountjoy Site, South Road, Durham, DH1 3LE United Kingdom

*M*: +44 (0)774 353 7510
*E*: martin.sm...@durham.ac.uk

smithlabdurham.github.io
twitter.com/PalaeoSmith

The information in this e-mail and any attachments is co...{{dropped:7}}

__
R-help@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.


Re: [R] Help with developing package DWLS

2022-01-11 Thread Bert Gunter
Andrew has already provided you a lot of help, but further posts should go
to r-package-devel, which is a mailing list specifically set up to provide
the sort of help you requested.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Jan 11, 2022 at 12:10 AM Adriana Sistig <
adriana.sis...@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.3Biobase_2.50.0
> BiocGenerics_0.36.1
>
> loaded via a namespace (and not attached):
>   [1] Seurat_4.0.5Rtsne_0.15
> colorspace_2.0-2
>   [4] deldir_1.0-6class_7.3-19
> ellipsis_0.3.2
>   [7] ggridges_0.5.3  XVector_0.30.0
> GenomicRanges_1.42.0
>  [10] proxy_0.4-26spatstat.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-18splines_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.9gtable_0.3.0glue_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.1spatstat.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-15reshape_0.8.8
>  stringi_1.7.6
>  [76] S4Vectors_0.28.1e1071_1.7-9
>  GenomeInfoDb_1.26.7
>  [79] rlang_0.4.12pkgconfig_2.0.3
>  matrixStats_0.61.0
>  [82] bitops_1.0-7lattice_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.19plyr_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.6future.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-4tidyr_1.1.4
>
> [118] httpuv_1.6.3stats4_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 f

Re: [R] Help with developing package DWLS

2022-01-11 Thread Andrew Simmons
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@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 '

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 l

[R] Help with developing package DWLS

2022-01-11 Thread Adriana Sistig
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 

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.3Biobase_2.50.0  
BiocGenerics_0.36.1

loaded via a namespace (and not attached):
  [1] Seurat_4.0.5Rtsne_0.15  colorspace_2.0-2  
 
  [4] deldir_1.0-6class_7.3-19ellipsis_0.3.2
 
  [7] ggridges_0.5.3  XVector_0.30.0  
GenomicRanges_1.42.0   
 [10] proxy_0.4-26spatstat.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-18splines_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.9gtable_0.3.0glue_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-153lmtest_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.1spatstat.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-15reshape_0.8.8   stringi_1.7.6 
 
 [76] S4Vectors_0.28.1e1071_1.7-9 
GenomeInfoDb_1.26.7
 [79] rlang_0.4.12pkgconfig_2.0.3 
matrixStats_0.61.0 
 [82] bitops_1.0-7lattice_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.19plyr_1.8.6
 
 [94] magrittr_2.0.1  R6_2.5.1IRanges_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.6future.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-4tidyr_1.1.4   
 
[118] httpuv_1.6.3stats4_4.0.5munsell_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 r8