Re: [Rd] Making R CMD nicer
In my humble personal opinion, I try to avoid bash scripts longer than a couple lines because I find the syntax so obtuse and unintuitive it's difficult to maintain and write less buggy code. But that is mostly a reflection of my personal inexperience. I think the only time a bash script is really needed is for maximum portability in systems _with bash_. (I would use python for a wrapper in personal projects, given python comes pre-installed on many linux systems and OS X, but I completely understand not wanting to burden Windows users with an extra python dependency to install.) On Sun, Jun 30, 2019 at 8:08 PM Abby Spurdle wrote: > In that case, I was wrong. > And I must apologize... > > In saying that, good to see Windows out performing Linux on the command > line... > > > On Mon, Jul 1, 2019 at 11:30 AM Gábor Csárdi > wrote: > > > > For the record, this is Linux R-devel: > > > > root@4bef68c16864:~# R CMD > > /opt/R-devel/lib/R/bin/Rcmd: 60: shift: can't shift that many > > root@4bef68c16864:~# R CMD -h > > /opt/R-devel/lib/R/bin/Rcmd: 62: exec: -h: not found > > root@4bef68c16864:~# R CMD --help > > /opt/R-devel/lib/R/bin/Rcmd: 62: exec: --help: not found > > > > This is R-release on macOS: > > > > ❯ R CMD > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: > > /Library/Frameworks/R.framework/Resources/bin/: is a directory > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: > > /Library/Frameworks/R.framework/Resources/bin/: cannot execute: > > Undefined error: 0 > > ❯ R CMD -h > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: -h: > > invalid option > > exec: usage: exec [-cl] [-a name] file [redirection ...] > > ❯ R CMD --help > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: --: > > invalid option > > exec: usage: exec [-cl] [-a name] file [redirection ...] > > > > On Windows you indeed get a useful list of commands and more helpful > tips. > > > > Gabor > > > > > > On Sun, Jun 30, 2019 at 11:36 PM Abby Spurdle > wrote: > > > > > > > First time posting in the R mailing lists so hopefully this works > well. > > > > I noticed when I type `R CMD` I get this unhelpful message: > > > > /usr/lib/R/bin/Rcmd: 60: shift: can't shift that many > > > > > > I wasn't able to reproduce this. > > > Maybe it's a Linux thing. > > > But then, I suspect you've omitted some of your input. > > > > > > > I also think it would be nice if `R CMD help` showed the usable > commands. > > > > > > What do you mean... > > > All of the following give you the "usable commands": > > > > > > > R CMD > > > > R CMD -h > > > > R CMD --help > > > > > > [[alternative HTML version deleted]] > > > > > > __ > > > R-devel@r-project.org mailing list > > > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Making R CMD nicer
Yes I'm using R 3.4.4 on Ubuntu 18.04. I doubt the Windows version would make use of a bash script. I'm all for a more consistent interface. It puzzles me that a shell script is used at all since that does not seem portable, especially for Windows users. To my surprise I discovered the R that's called from shell, usr/bin/R, is actually just a shell script. The binary that's called seems to be /usr/lib/R/bin/exec/R which is a tiny executable that then probably calls something else. In comparison the python called from shell, /usr/bin/python3.6, really is a binary. I'm sure there's a good reason that R uses a shell wrapper script but it's not like a C program can't parse arguments or set env vars. On Sun, Jun 30, 2019 at 7:30 PM Gábor Csárdi wrote: > For the record, this is Linux R-devel: > > root@4bef68c16864:~# R CMD > /opt/R-devel/lib/R/bin/Rcmd: 60: shift: can't shift that many > root@4bef68c16864:~# R CMD -h > /opt/R-devel/lib/R/bin/Rcmd: 62: exec: -h: not found > root@4bef68c16864:~# R CMD --help > /opt/R-devel/lib/R/bin/Rcmd: 62: exec: --help: not found > > This is R-release on macOS: > > ❯ R CMD > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: > /Library/Frameworks/R.framework/Resources/bin/: is a directory > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: > /Library/Frameworks/R.framework/Resources/bin/: cannot execute: > Undefined error: 0 > ❯ R CMD -h > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: -h: > invalid option > exec: usage: exec [-cl] [-a name] file [redirection ...] > ❯ R CMD --help > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: --: > invalid option > exec: usage: exec [-cl] [-a name] file [redirection ...] > > On Windows you indeed get a useful list of commands and more helpful tips. > > Gabor > > > On Sun, Jun 30, 2019 at 11:36 PM Abby Spurdle wrote: > > > > > First time posting in the R mailing lists so hopefully this works well. > > > I noticed when I type `R CMD` I get this unhelpful message: > > > /usr/lib/R/bin/Rcmd: 60: shift: can't shift that many > > > > I wasn't able to reproduce this. > > Maybe it's a Linux thing. > > But then, I suspect you've omitted some of your input. > > > > > I also think it would be nice if `R CMD help` showed the usable > commands. > > > > What do you mean... > > All of the following give you the "usable commands": > > > > > R CMD > > > R CMD -h > > > R CMD --help > > > > [[alternative HTML version deleted]] > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true
I run checks with R-devel rev. 76756 on several of my packages which use S4, with no ill effects. With the risk of not adding much, it seems that Martin's example, which I repeat below, suggests a crossover between several "signatures" involved here - the signature of the generic, the signature of the method (the argument for setMethod()), and the signature of the function object defining the method. >> r2 <- oligoFn(object=diag(2), target=array(42)) > Error in .local(object, target) : > argument "target" is missing, with no default >> getMethod("oligoFn", signature(object="matrix", subset="missing", target="array")) > Method Definition: > function (object, subset, target, value) > { > .local <- function (object, subset, target, value) > list(object = object, target = target) > .local(object, target) > } a) .local() seems superfluous here, since the signature of the function object is identical to that of the generic. b) "subset" is "missing" in the signature of the method but it is (legally, I believe) present in the function object. The call .local(object, target) would be appropriate if "subset" was missing also from the signature of the function object (the latter would be illegal here). Alternatively, it could be named, as in .local(object, target = target) or maybe even .local(object, , target). -- Georgi Boshnakov -- Date: Sat, 29 Jun 2019 22:44:49 +0200 From: Martin Maechler To: R-devel , Henrik Bengtsson Cc: Martin Maechler Subject: Re: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error Message-ID: <23831.52673.201433.320...@stat.math.ethz.ch> Content-Type: text/plain; charset="utf-8" > Martin Maechler > on Sat, 29 Jun 2019 12:05:49 +0200 writes: > Martin Maechler > on Sat, 29 Jun 2019 10:33:10 +0200 writes: > peter dalgaard > on Fri, 28 Jun 2019 16:20:03 +0200 writes: >>> > On 28 Jun 2019, at 16:03 , Martin Maechler wrote: >>> > >>> >> Henrik Bengtsson >>> >>on Thu, 27 Jun 2019 16:00:39 -0700 writes: >>> > >>> >> Using: >>> >> >>> >> untrace(methods::conformMethod) >>> >> at <- c(12,4,3,2) >>> >> str(body(methods::conformMethod)[[at]]) >>> >> ## language omittedSig <- omittedSig && (signature[omittedSig] != "missing") >>> >> cc <- 0L >>> >> trace(methods::conformMethod, tracer = quote({ >>> >> cc <<- cc + 1L >>> >> print(cc) >>> >> if (cc == 31) { ## manually identified >>> >>untrace(methods::conformMethod) >>> >>trace(methods::conformMethod, at = list(at), tracer = quote({ >>> >> str(list(signature = signature, mnames = mnames, fnames = fnames)) >>> >> print(ls()) >>> >> try(str(list(omittedSig = omittedSig, signature = signature))) >>> >>})) >>> >> } >>> >> })) >>> >> loadNamespace("oligo") >>> >> >>> >> gives: >>> >> >>> >> Untracing function "conformMethod" in package "methods" >>> >> Tracing function "conformMethod" in package "methods" >>> >> Tracing conformMethod(signature, mnames, fnames, f, fdef, definition) >>> >> step 12,4,3,2 >>> >> List of 3 >>> >> $ signature: Named chr [1:4] "TilingFeatureSet" "ANY" "ANY" "array" >>> >> ..- attr(*, "names")= chr [1:4] "object" "subset" "target" "value" >>> >> ..- attr(*, "package")= chr [1:4] "oligoClasses" "methods" "methods" "methods" >>> >> $ mnames : chr [1:2] "object" "value" >>> >> $ fnames : chr [1:4] "object" "subset" "target" "value" >>> >> [1] "f" "fdef" "fnames" "fsig" "imf" >>> >> [6] "method" "mnames" "omitted""omittedSig" "sig0" >>> >> [11] "sigNames" "signature" >>> >> List of 2 >>> >> $ omittedSig: logi [1:4] FALSE TRUE TRUE FALSE >>> >> $ signature : Named chr [1:4] "TilingFeatureSet" "ANY" "ANY" "array" >>> >> ..- attr(*, "names")= chr [1:4] "object" "subset" "target" "value" >>> >> ..- attr(*, "package")= chr [1:4] "oligoClasses" "methods" "methods" "methods" >>> >> Error in omittedSig && (signature[omittedSig] != "missing") : >>> >> 'length(x) = 4 > 1' in coercion to 'logical(1)' >>> >> Error: unable to load R code in package 'oligo' >>> >> >>> > >>> > Thank you, Henrik, nice piece of using trace() .. and the above >>> > is useful for solving the issue -- I can work with that. >>> > >>> > I'm already pretty sure the wrong code starts with >>> > >>> >omittedSig <- sigNames %in% fnames[omitted] # >> my "pretty sure" statement above has proven to be wrong .. >>> > - >>> > >>> >>> I think the intention must have been that the two "ANY" signatures should change to "missing". >> Definitely. >>> However, with the current logic that will not happen, because >>> >>> > c(F,T,T,F) &&
Re: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true
> Georgi Boshnakov > on Mon, 1 Jul 2019 09:11:39 + writes: > I run checks with R-devel rev. 76756 on several of my > packages which use S4, with no ill effects. Thank you, Georgi! > With the risk of not adding much, it seems that Martin's example, which > I repeat below, suggests a crossover between several > "signatures" involved here - the signature of the generic, > the signature of the method (the argument for setMethod()), > and the signature of the function object defining the method. that's correct. and the conformMethod() plus rematchDefinition() utility functions have been created to deal with this problem "optimally" and consistently. >>> r2 <- oligoFn(object=diag(2), target=array(42)) >> Error in .local(object, target) : >> argument "target" is missing, with no default >>> getMethod("oligoFn", signature(object="matrix", subset="missing", >>> target="array")) >> >> Method Definition: > >> function (object, subset, target, value) >> { >> .local <- function (object, subset, target, value) >> list(object = object, target = target) >> .local(object, target) >> } > a) .local() seems superfluous here, since the signature of > the function object is identical to that of the generic. that's only true in the *result*ing method, but not in how the method was defined (the following code was in my post) : setMethod("oligoFn", signature(object = "matrix", target="array"), ## Method _ 2 _ function(object, target) list(object=object, target=target)) Here, function object has arguments (object, target) only > b) "subset" is "missing" in the signature of the method > but it is (legally, I believe) present in the function > object. The call .local(object, target) would be > appropriate if "subset" was missing also from the > signature of the function object (the latter would be > illegal here). Alternatively, it could be named, as in > .local(object, target = target) or maybe even > .local(object, , target). > -- > Georgi Boshnakov The 2nd patch I committed -- the one mostly to rematchDefiniton() -- does exactly that: It uses .local() calls where those argument *are* named which should be named. ==> hence the above example works fine there. Martin > -- > Date: Sat, 29 Jun 2019 22:44:49 +0200 > From: Martin Maechler > To: R-devel , Henrik Bengtsson > > Cc: Martin Maechler > Subject: Re: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true > error > Message-ID: <23831.52673.201433.320...@stat.math.ethz.ch> > Content-Type: text/plain; charset="utf-8" > > > Martin Maechler > > on Sat, 29 Jun 2019 12:05:49 +0200 writes: > > > Martin Maechler > > on Sat, 29 Jun 2019 10:33:10 +0200 writes: > > > peter dalgaard > > on Fri, 28 Jun 2019 16:20:03 +0200 writes: > > On 28 Jun 2019, at 16:03 , Martin Maechler > wrote: > >> Henrik Bengtsson >>on Thu, 27 Jun 2019 16:00:39 -0700 writes: > >> Using: >> >> untrace(methods::conformMethod) >> at <- c(12,4,3,2) >> str(body(methods::conformMethod)[[at]]) >> ## language omittedSig <- omittedSig && (signature[omittedSig] != >> "missing") >> cc <- 0L >> trace(methods::conformMethod, tracer = quote({ >> cc <<- cc + 1L >> print(cc) >> if (cc == 31) { ## manually identified >>untrace(methods::conformMethod) >>trace(methods::conformMethod, at = list(at), tracer = quote({ >> str(list(signature = signature, mnames = mnames, fnames = fnames)) >> print(ls()) >> try(str(list(omittedSig = omittedSig, signature = signature))) >>})) >> } >> })) >> loadNamespace("oligo") >> >> gives: >> >> Untracing function "conformMethod" in package "methods" >> Tracing function "conformMethod" in package "methods" >> Tracing conformMethod(signature, mnames, fnames, f, fdef, definition) >> step 12,4,3,2 >> List of 3 >> $ signature: Named chr [1:4] "TilingFeatureSet" "ANY" "ANY" "array" >> ..- attr(*, "names")= chr [1:4] "object" "subset" "target" "value" >> ..- attr(*, "package")= chr [1:4] "oligoClasses" "methods" "methods" >> "methods" >> $ mnames : chr [1:2] "object" "value" >> $ fnames : chr [1:4] "object" "subset" "target" "value" >> [1] "f" "fdef" "fnames" "fsig" "imf" >> [6] "method" "mnames" "omitted""omittedSig" "sig0" >> [11] "sigNames" "signature" >> List of 2 >> $ omittedSig: logi [1:4] FALSE TRUE TRUE FALSE >> $ signature : Named chr [1:4] "TilingFeatureSet" "ANY" "ANY" "array" >> ..- attr(*, "names")= chr [1:4] "object" "subset" "target" "value" >> ..- attr(*, "package")= chr
Re: [Rd] Making R CMD nicer
If you write a lot of R code to run as command line scripts then look at Dirk E's "littler": $ r --help Usage: r [options] [-|file] Launch GNU R to execute the R commands supplied in the specified file, or from stdin if '-' is used. Suitable for so-called shebang '#!/'-line scripts. Options: -h, --help Give this help list --usage Give a short usage message -V, --versionShow the version number -v, --vanillaPass the '--vanilla' option to R -t, --rtemp Use per-session temporary directory as R does -i, --interactiveLet interactive() return 'true' rather than 'false' -q, --quick Skip autoload / delayed assign of default libraries -p, --verbosePrint the value of expressions to the console -l, --packages list Load the R packages from the comma-separated 'list' -d, --datastdin Prepend command to load 'X' as csv from stdin -L, --libpath dirAdd directory to library path via '.libPaths(dir)' -e, --eval expr Let R evaluate 'expr' available from an archive near you... On Mon, Jul 1, 2019 at 8:58 AM Jason Xu wrote: > In my humble personal opinion, I try to avoid bash scripts longer than a > couple lines because I find the syntax so obtuse and unintuitive it's > difficult to maintain and write less buggy code. But that is mostly a > reflection of my personal inexperience. > I think the only time a bash script is really needed is for maximum > portability in systems _with bash_. > (I would use python for a wrapper in personal projects, given python comes > pre-installed on many linux systems and OS X, but I completely understand > not wanting to burden Windows users with an extra python dependency to > install.) > > > > > > On Sun, Jun 30, 2019 at 8:08 PM Abby Spurdle wrote: > > > In that case, I was wrong. > > And I must apologize... > > > > In saying that, good to see Windows out performing Linux on the command > > line... > > > > > > On Mon, Jul 1, 2019 at 11:30 AM Gábor Csárdi > > wrote: > > > > > > For the record, this is Linux R-devel: > > > > > > root@4bef68c16864:~# R CMD > > > /opt/R-devel/lib/R/bin/Rcmd: 60: shift: can't shift that many > > > root@4bef68c16864:~# R CMD -h > > > /opt/R-devel/lib/R/bin/Rcmd: 62: exec: -h: not found > > > root@4bef68c16864:~# R CMD --help > > > /opt/R-devel/lib/R/bin/Rcmd: 62: exec: --help: not found > > > > > > This is R-release on macOS: > > > > > > ❯ R CMD > > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: > > > /Library/Frameworks/R.framework/Resources/bin/: is a directory > > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: > > > /Library/Frameworks/R.framework/Resources/bin/: cannot execute: > > > Undefined error: 0 > > > ❯ R CMD -h > > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: -h: > > > invalid option > > > exec: usage: exec [-cl] [-a name] file [redirection ...] > > > ❯ R CMD --help > > > /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: --: > > > invalid option > > > exec: usage: exec [-cl] [-a name] file [redirection ...] > > > > > > On Windows you indeed get a useful list of commands and more helpful > > tips. > > > > > > Gabor > > > > > > > > > On Sun, Jun 30, 2019 at 11:36 PM Abby Spurdle > > wrote: > > > > > > > > > First time posting in the R mailing lists so hopefully this works > > well. > > > > > I noticed when I type `R CMD` I get this unhelpful message: > > > > > /usr/lib/R/bin/Rcmd: 60: shift: can't shift that many > > > > > > > > I wasn't able to reproduce this. > > > > Maybe it's a Linux thing. > > > > But then, I suspect you've omitted some of your input. > > > > > > > > > I also think it would be nice if `R CMD help` showed the usable > > commands. > > > > > > > > What do you mean... > > > > All of the following give you the "usable commands": > > > > > > > > > R CMD > > > > > R CMD -h > > > > > R CMD --help > > > > > > > > [[alternative HTML version deleted]] > > > > > > > > __ > > > > R-devel@r-project.org mailing list > > > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] ASAN error with R-devel
I have an ASAN enabled version of R-devel on my test machine, and can get it to relably crash. Here is the first part of the session: tmt-local2434% R --vanilla R Under development (unstable) (2019-06-28 r76752) -- "Unsuffered Consequences" Platform: x86_64-pc-linux-gnu (64-bit) 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. Natural language support but running in an English locale 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. > install.packages('kinship2') Installing package into ‘/home/therneau/Rlib’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- = ==21606==ERROR: AddressSanitizer: heap-use-after-free on address 0x60242830 at pc 0x7f9f834fa0f7 bp 0x7fff24ab9050 sp 0x7fff24ab87f8 READ of size 1 at 0x60242830 thread T0 #0 0x7f9f834fa0f6 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5a0f6) #1 0x7f787837d683 in _XimUnRegisterIMInstantiateCallback (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x64683) #2 0x7f7878364d32 in XUnregisterIMInstantiateCallback (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x4bd32) #3 0x7f787837d566 in _XimRegisterIMInstantiateCallback (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x64566) #4 0x7f7878364cba in XRegisterIMInstantiateCallback (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x4bcba) #5 0x7f78745cddfb in TkpOpenDisplay (/usr/lib/x86_64-linux-gnu/libtk8.6.so+0xf2dfb) #6 0x7f787453c769 (/usr/lib/x86_64-linux-gnu/libtk8.6.so+0x61769) #7 0x7f787453d0ab in TkCreateMainWindow (/usr/lib/x86_64-linux-gnu/libtk8.6.so+0x620ab) #8 0x7f7874548cc6 (/usr/lib/x86_64-linux-gnu/libtk8.6.so+0x6dcc6) #9 0x7f7874546c7a (/usr/lib/x86_64-linux-gnu/libtk8.6.so+0x6bc7a) #10 0x7f787453f6c4 (/usr/lib/x86_64-linux-gnu/libtk8.6.so+0x646c4) #11 0x7f7874bf0c0b in tcltk_init /usr/local/src/R-devel/src/library/tcltk/src/tcltk.c:697 #12 0x5582e3aa93c1 in do_dotCode /usr/local/src/R-devel/src/main/dotcode.c:1743 #13 0x5582e3b41f79 in bcEval /usr/local/src/R-devel/src/main/eval.c:6775 #14 0x5582e3b6a5df in Rf_eval /usr/local/src/R-devel/src/main/eval.c:620 #15 0x5582e3b702b9 in R_execClosure /usr/local/src/R-devel/src/main/eval.c:1780 #16 0x5582e3b72777 in Rf_applyClosure /usr/local/src/R-devel/src/main/eval.c:1706 #17 0x5582e3b4ab0a in bcEval /usr/local/src/R-devel/src/main/eval.c:6743 #18 0x5582e3b6a5df in Rf_eval /usr/local/src/R-devel/src/main/eval.c:620 #19 0x5582e3b6c55e in forcePromise /usr/local/src/R-devel/src/main/eval.c:516 #20 0x5582e3b6d22f in FORCE_PROMISE /usr/local/src/R-devel/src/main/eval.c:4900 ... #133 0x7f788f5e6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #134 0x5582e392b999 in _start (/usr/local/src/R-devel/bin/exec/R+0x135999) 0x60255af0 is located 0 bytes inside of 1-byte region [0x60255af0,0x60255af1) freed by thread T0 here: #0 0x7f7891a157b8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7b8) #1 0x7f7878373d8c in XSetLocaleModifiers (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x5ad8c) previously allocated by thread T0 here: #0 0x7f7891a15b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7f7878373984 in _XlcDefaultMapModifiers (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x5a984) SUMMARY: AddressSanitizer: heap-use-after-free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5a0f6) -- The window with a choice of machines never appeared. Terry T. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] eliminate a partial argument match warning in R CMD check
Hello, I'm seeing a nuisance warning when I run `R CMD check --as-cran whatever_x.y.z.tar.gz`. I generally work with these options set: options( warnPartialMatchArgs = TRUE, warnPartialMatchAttr = TRUE, warnPartialMatchDollar = TRUE ) And I see this: * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...Warning in dir("src", patt = "[.]c$") : partial argument match of 'patt' to 'pattern' Warning in dir("src", patt = "[.](cc|cpp)$") : partial argument match of 'patt' to 'pattern' Warning in dir("src", patt = "[.]f$") : partial argument match of 'patt' to 'pattern' Warning in dir("src", patt = "[.]f9[05]$") : partial argument match of 'patt' to 'pattern' It's not a big deal but it would be nice to silence it. Patch below. Thanks, Jenny diff --git a/src/library/tools/R/check.R b/src/library/tools/R/check.R index 21d192af485..199029bda73 100644 --- a/src/library/tools/R/check.R +++ b/src/library/tools/R/check.R @@ -2933,10 +2933,10 @@ add_dummies <- function(dir, Log) any <- msg <- character() for (m in makefiles) { lines <- readLines(m, warn = FALSE) -have_c <- length(dir('src', patt = "[.]c$", recursive = TRUE)) > 0L -have_cxx <- length(dir('src', patt = "[.](cc|cpp)$", recursive = TRUE)) > 0L -have_f <- length(dir('src', patt = "[.]f$", recursive = TRUE)) > 0L -have_f9x <- length(dir('src', patt = "[.]f9[05]$", recursive = TRUE)) > 0L +have_c <- length(dir('src', pattern = "[.]c$", recursive = TRUE)) > 0L +have_cxx <- length(dir('src', pattern = "[.](cc|cpp)$", recursive = TRUE)) > 0L +have_f <- length(dir('src', pattern = "[.]f$", recursive = TRUE)) > 0L +have_f9x <- length(dir('src', pattern = "[.]f9[05]$", recursive = TRUE)) > 0L for (f in c("C", "CXX", "F", "FC", "CPP")) { this <- paste0(f, "FLAGS") this2 <- paste0("PKG_", this) [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Format printing inside a matrix
Hi everyone, I am not sure if there is an existing solution to this, but I want my S4 objects inside a list matrix showing correctly. Currently it shows as: R> str(lst[[1]]) Formal class 'Basic' [package "symengine"] with 1 slot ..@ ptr: R> matrix(lst, 2) [,1] [,2] [,3] [,4] [,5] [1,] ????? [2,] ????? Is it possible that the print method for matrix can call some type of generic such as `as.character` or `format` when it encounters such cases? Or is there any other place that I can override without introducing a new S3 class? Thanks! Jialin Ma __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] eliminate a partial argument match warning in R CMD check
> Jennifer Bryan writes: Thanks: fixed with c76763 in the trunk. Best -k > Hello, > I'm seeing a nuisance warning when I run `R CMD check --as-cran > whatever_x.y.z.tar.gz`. > I generally work with these options set: > options( > warnPartialMatchArgs = TRUE, > warnPartialMatchAttr = TRUE, > warnPartialMatchDollar = TRUE > ) > And I see this: > * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...Warning in dir("src", > patt = "[.]c$") : > partial argument match of 'patt' to 'pattern' > Warning in dir("src", patt = "[.](cc|cpp)$") : > partial argument match of 'patt' to 'pattern' > Warning in dir("src", patt = "[.]f$") : > partial argument match of 'patt' to 'pattern' > Warning in dir("src", patt = "[.]f9[05]$") : > partial argument match of 'patt' to 'pattern' > It's not a big deal but it would be nice to silence it. Patch below. > Thanks, > Jenny > diff --git a/src/library/tools/R/check.R b/src/library/tools/R/check.R > index 21d192af485..199029bda73 100644 > --- a/src/library/tools/R/check.R > +++ b/src/library/tools/R/check.R > @@ -2933,10 +2933,10 @@ add_dummies <- function(dir, Log) > any <- msg <- character() > for (m in makefiles) { > lines <- readLines(m, warn = FALSE) > -have_c <- length(dir('src', patt = "[.]c$", recursive > = TRUE)) > 0L > -have_cxx <- length(dir('src', patt = "[.](cc|cpp)$", > recursive = TRUE)) > 0L > -have_f <- length(dir('src', patt = "[.]f$", recursive > = TRUE)) > 0L > -have_f9x <- length(dir('src', patt = "[.]f9[05]$", > recursive = TRUE)) > 0L > +have_c <- length(dir('src', pattern = "[.]c$", > recursive = TRUE)) > 0L > +have_cxx <- length(dir('src', pattern = > "[.](cc|cpp)$", recursive = TRUE)) > 0L > +have_f <- length(dir('src', pattern = "[.]f$", > recursive = TRUE)) > 0L > +have_f9x <- length(dir('src', pattern = "[.]f9[05]$", > recursive = TRUE)) > 0L > for (f in c("C", "CXX", "F", "FC", "CPP")) { > this <- paste0(f, "FLAGS") > this2 <- paste0("PKG_", this) > [[alternative HTML version deleted]] > __ > 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