[Rd] Suppress conflict messages when mask.ok

2020-12-28 Thread Magnus Torfason
I was very happy to see the new mask.ok option. It works very well when
conflicts.policy is "strict":

---
options(conflicts.policy="strict")
library(igraph, exclude="decompose", mask.ok=c("spectrum","union"))
#> [No messages]
---

However, if no conflicts.policy has been set, the masked objects are loudly
reported, even if they are specified with mask.ok:

---
library(igraph, exclude="decompose", mask.ok=c("spectrum","union"))
#>
#> Attaching package: 'igraph'
#> The following object is masked from 'package:stats':
#>
#> spectrum
#> The following object is masked from 'package:base':
#>
#> union
---

It seems that if I specify mask.ok, that particular masking is expected and
should NOT be reported, regardless of what the conflicts.policy is. It
would be very useful for many users who are not ready to switch over to a
strict conflicts.policy, to nevertheless be able to suppress messages about
expected conflicts using mask.ok and thus only get messages when unexpected
masking occurs.

Best,
Magnus

[[alternative HTML version deleted]]

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


Re: [Rd] installing from source

2020-12-28 Thread Ben Bolker
  Kevin Ushey pointed out to me privately that he submitted a bug 
report and a patch for this about a month ago, which Kurt Hornik put in 
R-devel (c79477):


https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17973

On 12/28/20 4:35 AM, Martin Maechler wrote:

Ben Bolker
 on Sun, 27 Dec 2020 15:02:47 -0500 writes:


 > There is a recurring issue with installing from source into paths
 > that contain single quotes/apostrophes. "Why would anyone do that??" is
 > certainly a legitimate response to such a problem, but I would also say
 > this constitutes a legitimate bug.  Would replacing both single-quotes
 > below with \\' solve the problem?

Here, I'm mostly among the  "Why would anyone do that??" people,
but I agree that it's worth some effort to try fixing this.

To your question above: Why don't you create a repr.ex. (we'd
want anyway for R-bugzilla) and *see* if your proposition solves
it - or did I misinterpret the Q?

 > I'm happy to post this (with a patch if my fix seems appropriate) on
 > r-bugzilla.


 > cheers
 > Ben Bolker

 > line 1672 of src/library/tools/R/install.R :

 > cmd <- paste0("tools:::.test_load_package('", pkg_name, "', ",
 > quote_path(lib), ")")


 > 
https://github.com/wch/r-source/blob/2eade649c80725352256f16509f9ff6919fd079c/src/library/tools/R/install.R#L1672

 > 
https://stackoverflow.com/questions/15129888/r-cmd-install-error-unexpected-symbol-in-test-load-package-function

 > 
https://stackoverflow.com/questions/65462881/cannot-download-packages-from-github-from-unexpected-symbol

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



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


Re: [Rd] .Fortran to .Call

2020-12-28 Thread Therneau, Terry M., Ph.D. via R-devel
Roger,
  Over the years I have converted many of the .C calls in the survival package 
to .Call.  
As others have said, the big advantage is memory footprint.  I did it because 
there are a 
few users who call survfit or coxph with really large data sets, and not 
copying the data 
can be the difference between success and failure (run out of memory).  Like 
you, my 
experience has been that if there is enough memory, then the time required for 
.C or 
.Fortran to make the data copy is minimal.   Don't make the change in order to 
gain 
compute speed.

The downside to .Call is that R then makes the (dangerous) assumption that you 
know what 
you are doing.  That is, vectors/matrices that are passed in to the function 
will NOT have 
new data values written into them, unless you have taken the necessary steps.   
Breaking 
the promise can lead to program failures that are very hard to track down.

-- 
Terry M Therneau, PhD
Department of Health Science Research
Mayo Clinic
thern...@mayo.edu

"TERR-ree THUR-noh"


[[alternative HTML version deleted]]

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


Re: [Rd] installing from source

2020-12-28 Thread Martin Maechler
> Ben Bolker 
> on Sun, 27 Dec 2020 15:02:47 -0500 writes:

> There is a recurring issue with installing from source into paths 
> that contain single quotes/apostrophes. "Why would anyone do that??" is 
> certainly a legitimate response to such a problem, but I would also say 
> this constitutes a legitimate bug.  Would replacing both single-quotes 
> below with \\' solve the problem?

Here, I'm mostly among the  "Why would anyone do that??" people,
but I agree that it's worth some effort to try fixing this.

To your question above: Why don't you create a repr.ex. (we'd 
want anyway for R-bugzilla) and *see* if your proposition solves
it - or did I misinterpret the Q?

> I'm happy to post this (with a patch if my fix seems appropriate) on 
> r-bugzilla.


> cheers
> Ben Bolker

> line 1672 of src/library/tools/R/install.R :

> cmd <- paste0("tools:::.test_load_package('", pkg_name, "', ", 
> quote_path(lib), ")")


> 
https://github.com/wch/r-source/blob/2eade649c80725352256f16509f9ff6919fd079c/src/library/tools/R/install.R#L1672

> 
https://stackoverflow.com/questions/15129888/r-cmd-install-error-unexpected-symbol-in-test-load-package-function

> 
https://stackoverflow.com/questions/65462881/cannot-download-packages-from-github-from-unexpected-symbol

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

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