[Rd] Bug report: Function ppois(0:20, lambda=0.9) does not generate a non-decreasing result.

2018-12-04 Thread qweytr1
function ppois is a function calculate the CDF of Poisson distribution, it 
should generate a non-decreasing result, but what I got is:


> any(diff(ppois(0:19,lambda=0.9))<0)
[1] TRUE


Actually,



> ppois(19,lambda=0.9)https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Bug report: R.home() cause package Rcpp failed executing sourceCpp, similar bug are labeled "BUG 16660" since 2016 and here I could provide a solution that tested in my laptop.

2018-12-23 Thread qweytr1
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16660
Here is the bug, which R.home may generate a path contains a whitespace.


this will cause Rcpp failed executing sourceCpp


> sourceCpp("b:/2018-12-14/src/18020/MCMC.cpp")
Error in system(cmd, intern = !showOutput) : 'D:/Program' not found
Error in system(cmd, ignore.stderr = TRUE, intern = TRUE) :
  'D:/Program' not found



Code is tested in both R 3.5.1 and Microsoft R Open 3.5.1.


I find a temp solution, is to copy such words into Rprofile:


unlockBinding("R.home", baseenv())
utils::assignInNamespace("R.home",function (component = "home")
{
rh <- .Internal(R.home())
paste0('"',switch(component, home = rh, bin = if (.Platform$OS.type ==
"windows" && nzchar(p <- .Platform$r_arch)) file.path(rh,
component, p) else file.path(rh, component), share = if (nzchar(p <- 
Sys.getenv("R_SHARE_DIR"))) p else file.path(rh,
component), doc = if (nzchar(p <- Sys.getenv("R_DOC_DIR"))) p else 
file.path(rh,
component), include = if (nzchar(p <- Sys.getenv("R_INCLUDE_DIR"))) p 
else file.path(rh,
component), modules = if (nzchar(p <- .Platform$r_arch)) file.path(rh,
component, p) else file.path(rh, component), file.path(rh,
component)),'"')
}, ns="base", envir=baseenv())
lockBinding("R.home", baseenv())


Actually, calling "D:/Program Files/R/R Open/bin/x64"/R is same to calling 
"D:/Program Files/R/R Open/bin/x64/R"


it shows that we could use quote to quote the whitespaces.


(although the code seems a little bit ugly)



   _  
platform   x86_64-w64-mingw32 
arch   x86_64 
os mingw32
system x86_64, mingw32
status
major  3  
minor  5.1
year   2018   
month  07 
day02 
svn rev74947  
language   R  
version.string R version 3.5.1 (2018-07-02)
nickname   Feather Spray  







[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Is it a good choice to increase the NCONNECTION value?

2021-08-23 Thread qweytr1--- via R-devel
At least in 2015, a github user, tobigithub, submit an 
[issue](https://github.com/sneumann/xcms/issues/20) about the error "Error in 
file(con, "w") : all connections are in use"
Nowadays, since AMD have really cool CPUs which increases the thread numbers to 
128 or even 256 on a single server, we found that the NCONNECTIONS variable 
could prevent us from utilizing all the 128 threads.
It might be a good choice to increase its value.


the variable is defined in `R-4.1.1/src/main/connections.c: 17`
I have tested that, increase it to 1024 generates no error and all the clusters 
(I tried with 256 clusters on my 16 threads Laptop) works fine.


Is it possible increase the size of NCONNECTION?


[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel