Re: [Rd] specials and ::

2024-08-27 Thread Bill Dunlap
identical(expr[[2]], survival)) to specialNames <- c("strata", "whatever") ... if (is.call(expr) && identical(expr[[1]], doubleColon) && identical(expr[[2]], survival) && is.name(expr[[3]]) && is.element(as.character(expr[[3]]), specialNames

Re: [Rd] specials and ::

2024-08-26 Thread Bill Dunlap
){ expr[[i]] <- fix(expr[[i]]) } } expr } fix(formula) } identical(f(y ~ f(x) + survival::g(x,10) + z), y ~ f(x) + g(x,10) + z) # [1] TRUE -Bill On Mon, Aug 26, 2024 at 7:42 AM Therneau, Terry M., Ph.D. via R-devel < r-devel@r-project.org>

Re: [Rd] [External] Re: capture "->"

2024-03-04 Thread Bill Dunlap
ame("<<-") > leftArrow <- as.name("<-") > ast1 <- parse(text=encode("x1 + x2 -> a3"))[[1]] > ast2 <- parse(text=encode("y4 <- b5 + (b6 / b7)"))[[1]] > identical(ast1[[1]], rightArrow) [1] TRUE > identical(ast2[[1]], leftA

Re: [Rd] Difficult debug

2024-02-07 Thread Bill Dunlap
rts memory misuse and | >>> you can inspect variables, etc., where an error occurs. | >>> You can check for memory leaks from gdb with | >>>(gdb) monitor leak_check full | >>> | >>> -Bill You can use ^C to get the gdb prompt, to, say, set a bre

Re: [Rd] Difficult debug

2024-02-07 Thread Bill Dunlap
help track down memory problems. -Bill On Wed, Feb 7, 2024 at 12:03 PM Therneau, Terry M., Ph.D. via R-devel < r-devel@r-project.org> wrote: > I've hit a roadblock debugging a new update to the survival package. I > do debugging in > a developement envinment, i.e. I don&#x

Re: [Rd] capture error messages from loading shared objects

2023-11-28 Thread Bill Dunlap
If you would like to save the error message instead of suppressing it, you can use tryCatch(message=function(e)e, ...). -BIll On Tue, Nov 28, 2023 at 3:55 AM Adrian Dusa wrote: > Once again, Ivan, many thanks. > Yes, that does solve it. > Best wishes, > Adrian > > On Tue,

Re: [Rd] Concerns with SVD -- and the Matrix Exponential

2023-08-16 Thread Bill Dunlap
. Can you state your definition of the SVD and prove (or outline a proof of) that last statement? -Bill On Wed, Aug 16, 2023 at 3:47 AM Durga Prasad G me14d059 < me14d...@smail.iitm.ac.in> wrote: > Dear Martin, I am getting different responses from different officials of > R-Softwar

Re: [Rd] New behavior when running script in package directory?

2023-06-21 Thread Bill Dunlap
If ./Rprofile is not present and ~/.Rprofile is present then R will run the latter at startup. Do you have a ~/.Rprofile that defines a ss() function? -Bill On Wed, Jun 21, 2023 at 8:50 AM Dominick Samperi wrote: > Thanks, I checked for .Rprofile and .RData files. They are not present.

Re: [Rd] range() for Date and POSIXct could respect `finite = TRUE`

2023-05-11 Thread Bill Dunlap
n and max for the class instead of one that just said they were -Inf and Inf or not. -Bill On Thu, May 11, 2023 at 1:49 AM Martin Maechler wrote: > >>>>> Davis Vaughan > >>>>> on Tue, 9 May 2023 09:49:41 -0400 writes: > > > It seems like the ma

Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Bill Dunlap
, NA, 3) > str(xyTable(x,y)) List of 3 $ x : num [1:5] 1 2 2 5 6 $ y : num [1:5] 2 2 4 NA 3 $ number: int [1:5] 2 1 1 1 1 table() does not use this logic, as one NA in a vector would make all the counts NA. Should xyTable have a way to handle NAs the way table() does? -Bill On

Re: [Rd] WISH: Optional mechanism preventing var <<- value from assigning non-existing variable

2023-03-19 Thread Bill Dunlap
Why should it make an exception for cases where the about-to-be-assigned-to name is present in the global environment? I think it should warn or give an error if the altered variable is in any environment on the search list. -Bill On Sun, Mar 19, 2023 at 10:54 AM Duncan Murdoch wrote: >

Re: [Rd] tab-complete for non-syntactic names could attempt backtick-wrapping

2023-03-02 Thread Bill Dunlap
t;)), typeof, "") [1] "symbol""symbol""character" > vapply(as.list(quote(list$'component')), typeof, "") [1] "symbol""symbol""character" Single and double quoted character sequences do parse to t

Re: [Rd] Potential bug in fitted.nls

2023-01-26 Thread Bill Dunlap
Doesn't nls() expect that the lengths of vectors on both sides of the formula match (if both are supplied)? Perhaps it should check for that. -Bill On Thu, Jan 26, 2023 at 12:17 AM Dave Armstrong wrote: > Dear Colleagues, > > I recently answered [this question]() on Stac

Re: [Rd] Lazy-evaluate elements wrapped with invisible

2022-10-29 Thread Bill Dunlap
ent of a list should be considered garbage if not 'immediately' extracted from a list? Could you show a few usage cases? -Bill On Fri, Oct 28, 2022 at 7:41 PM Dipterix Wang wrote: > > This is not quite true. The value, even when invisible, is captured by > .Last.value, and &

Re: [Rd] Lazy-evaluate elements wrapped with invisible

2022-10-28 Thread Bill Dunlap
m_x'\n"); sum(x)}) +environment() + } > fx <- f(1:10) > date() [1] "Fri Oct 28 14:22:12 2022" > Sys.sleep(2) > fx$eval_date Evaluating 'date' [1] "Fri Oct 28 14:22:24 2022" > Sys.sleep(2) > fx$eval_date [1] "Fri Oct 28 14:22:24

Re: [Rd] Parser bug? A comma too much.

2022-09-16 Thread Bill Dunlap
> By putting in the comma, unless I am mistaken, you are effectively > saying the second element is NULL, which is how it's naturally > defined. No, in f(x,) the second argument is missing, not NULL. -Bill On Fri, Sep 16, 2022 at 7:43 AM Avraham Adler wrote: > That may act

Re: [Rd] New R version - Issue with as.vector coercion on data.frame

2022-05-02 Thread Bill Dunlap
4.1.2's as.vector(aDataFrame) did. I think that as.vector() is a function that few people should use. It has almost nothing to do with with the notion of a vector in math or physics. -Bill On Mon, May 2, 2022 at 2:19 AM Marc Weibel wrote: > Hi > > I recently upgraded to the l

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Bill Dunlap
>I think a lot of these things ultimately mean that if there were to be a string >concatenation operator, it probably shouldn't have behavior identical to >paste0. Was that what you were getting at as well, Bill? Yes. On Mon, Dec 6, 2021 at 4:21 PM Gabriel Becker wrote: > A

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Bill Dunlap
Should paste0(character(0), c("a","b")) give character(0)? There is a fair bit of code that assumes that paste("X",NULL) gives "X" but c(1,2)+NULL gives numeric(0). -Bill On Mon, Dec 6, 2021 at 1:32 PM Duncan Murdoch wrote: > On 06/12/2021 4:21 p.m.,

Re: [Rd] How is the environment variable "R_USER" defined?

2021-11-22 Thread Bill Dunlap
Is your C:\Users\yourname\Documents linked to OneDrive (either by your choice or by some administrator setting a group policy)? If so, ou could unlink it using OneDrive's settings dialog. Or you could set R_USER to avoid using ...\Documents. -Bill On Mon, Nov 22, 2021 at 8:47 AM Jiefei

Re: [Rd] Inconsistent is.list results on 'by' objects

2021-11-16 Thread Bill Dunlap
Try adding simplify=FALSE to the call to by(). -Bill On Tue, Nov 16, 2021 at 4:04 AM Ofek Shilon wrote: > Take this toy code: > df <- data.frame(a=seq(10), b=rep(1:2, 5)) > df.empty <- subset(df, a>10) > byy <- by(data=df, INDICES=df$b, FUN=functi

Re: [Rd] [R-pkg-devel] Tracking down inconsistent errors and notes across operating systems

2021-07-22 Thread Bill Dunlap
‘s_object’ 7 | static s_object* obj = NULL; |^~~~ On Thu, Jul 22, 2021 at 10:18 AM Bill Dunlap wrote: > I think the problem with RPostgreSQL/sec/RS-DBI.c comes from some changes > to Defn.h and Rinternals.h in RHOME/include that Luke made recently > (2021-07-20, s

Re: [Rd] ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread Bill Dunlap
am) [1] FALSE > .Call("is_altrep", amn) [1] FALSE where is_altrep() is defined by the following C code: #include #include SEXP is_altrep(SEXP x) { return Rf_ScalarLogical(ALTREP(x)); } -Bill On Tue, Jun 29, 2021 at 8:03 AM Sebastian Martin Krantz < sebastian.kra...@graduate

Re: [Rd] Should last default to .Machine$integer.max-1 for substring()

2021-06-21 Thread Bill Dunlap
use Inf as the default? Then the following would give 4 identical results with no warning: > substring("abcde", 3, c(10, 2^31-1, 2^31, Inf)) [1] "cde" "cde" NANA Warning message: In substring("abcde", 3, c(10, 2^31 - 1, 2^31, Inf)) : NAs introduced

Re: [Rd] base R pipe documentation

2021-05-18 Thread Bill Dunlap
help(`|>`) does mention magrittr's pipe operator so the user can compare and contrast them. -Bill On Mon, May 17, 2021 at 10:20 AM Ben Bolker wrote: >As of right now, as far as I can tell, the documentation for the new > native |> pipe still says that it's experimen

Re: [Rd] Surprising behavior when using the reference class with the dollar symbol

2021-03-27 Thread Bill Dunlap
<- "A" > `$`(L, i) NULL The 2nd argument is treated as a symbol and is never evaluated. If it is given as a string literal then it is converted to a symbol - that is a holdover from the old days before backticks could be used to make symbol literals for symbols that included odd th

Re: [Rd] Potential improvements of ave?

2021-03-16 Thread Bill Dunlap
Your proposed change (roughly, replacing interaction() by unique(paste())) slows down ave() considerably when there are long columns with lots of repeated rows. I think that interaction(drop=TRUE, ...) can be changed to use less memory and be faster by making a separate branch for drop=TRUE that u

Re: [Rd] Corrupt internal row names when creating a data.frame with `attributes<-`

2021-02-16 Thread Bill Dunlap
> rownames(as.matrix(dPos)) [1] "1" "2" "3" > rownames(as.matrix(dNeg)) NULL -Bill On Tue, Feb 16, 2021 at 11:06 AM Kevin Ushey wrote: > > Strictly speaking, I don't think this is a "corrupt" representation, > given that any APIs u

Re: [Rd] brief update on the pipe operator in R-devel

2021-01-15 Thread Bill Dunlap
If 3 |> x => f(x, y=x) were allowed then I think that runif(1) |> x => f(x, y=x) be parsed as f(runif(1), y=runif(1)) so runif(1) would be evaluated twice, leading to incorrect results from f(). -Bill On Fri, Jan 15, 2021 at 2:16 PM Avi Gross via R-devel wro

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-13 Thread Bill Dunlap
{ if (!is.list(expr)) { expr <- as.list(expr) } nms <- names(expr) for (i in seq_along(expr)) { str.language(expr[[i]], name=nms[[i]], indent = indent + 1) } } invisible(expr) } On Tue, Jan 12, 2021 at 1:16 P

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Bill Dunlap
l turn the |> and => into an ordinary looking function call so deparsing is irrelevant. > deparse(quote(x |> tmp => f(7,arg2=tmp))) [1] "f(7, arg2 = x)" -Bill On Tue, Jan 12, 2021 at 12:01 PM Dirk Eddelbuettel wrote: > > On 12 January 2021 at 20:38, Iñaki

Re: [Rd] From .Fortran to .Call?

2020-12-31 Thread Bill Dunlap
rs to R objects), never the double* or the like that .Fortran expects. -Bill On Wed, Dec 23, 2020 at 3:58 AM Koenker, Roger W wrote: > Thanks to all and best wishes for a better 2021. > > Unfortunately I remain somewhat confused: > > o Bill reveals an elegant way to get

Re: [Rd] From .Fortran to .Call?

2020-12-31 Thread Bill Dunlap
. -Bill On Wed, Dec 23, 2020 at 8:27 AM Bill Dunlap wrote: >As the proverbial naive R (ab)user I’m left wondering: > > o if I updated my quantreg_init.c file in accordance with Bill’s > suggestion could I > then simply change my .Fortran calls to .Call?

Re: [Rd] From .Fortran to .Call?

2020-12-19 Thread Bill Dunlap
To make C prototypes for routines defined in a *.f file you can use gfortran's -fc-prototypes-external flag. You still have to convert 'name_' to 'F77_NAME(name). bill@Bill-T490:~/packages/quantreg/src$ gfortran -fc-prototypes-external -fsyntax-only boot.f ... [elided d

Re: [Rd] the pipe |> and line breaks in pipelines

2020-12-09 Thread Bill Dunlap
uot;debug"))) before the eval() or assignment to make these do nothing to make it easy to turn debugging on and off with options(debug=TRUE/FALSE). -Bill On Wed, Dec 9, 2020 at 1:58 PM Timothy Goodman wrote: > > On Wed, Dec 9, 2020 at 1:03 PM Duncan Murdoch > wrote: Then I could

Re: [Rd] [R/S-PLUS] [EXTERNAL] Re: [External] anonymous functions

2020-12-07 Thread Bill Dunlap
One advantage of the new pipe operator over magrittr's is that the former works with substitute(). > f <- function(x, xlab=deparse1(substitute(x))) paste(sep="", xlab, ": ", paste(collapse=", ",x)) > 2^(1:4) |> f() [1] "2^(1:4): 2, 4, 8, 16" > 2^(1:4) %>% f() [1] ".: 2, 4, 8, 16" This is because

Re: [Rd] all.equal applied to function closures

2020-12-01 Thread Bill Dunlap
, parent=list2env(list(p=1.5), parent=new.env(parent=baseenv( > base::all.equal.environment(E1,E3) [1] TRUE > globalenv()$all.equal.environment(E1,E3) [1] " Component “p”: Mean relative difference: 0.1538462" [2] " target is and current is " On Tue, Dec 1, 2020 at 1

Re: [Rd] all.equal applied to function closures

2020-11-30 Thread Bill Dunlap
To make the comparison more complete, all.equal.environment could compare the parents of the target and current environments. That would have to be recursive but could stop at the first 'top level environment' (the global, empty, or a package-related environment generally) and use identical there.

Re: [Rd] .Internal(quit(...)): system call failed: Cannot allocate memory

2020-11-23 Thread Bill Dunlap
t=saveact@entry=SA_NOSAVE, status=status@entry=0, runLast=) at system.c:87 #4 0x556cc85e in do_quit (call=, op=, args=0x57813f90, rho=) at main.c:1393 -Bill On Mon, Nov 23, 2020 at 3:15 AM Tomas Kalibera wrote: > On 11/21/20 6:51 PM, Jan Gorecki wrote: > > Dear R-develope

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Bill Dunlap
Perhaps the parser should warn if you use return() at all. It is rarely needed and is akin to the evil 'GOTO' statement in that it makes the flow of control less obvious to the reader. -Bill On Fri, Nov 20, 2020 at 2:37 PM Mateo Obregón wrote: > I'm not thinking of complicat

Re: [Rd] formatting issue with gcc 9.3.0 on Ubuntu on WSL2

2020-11-18 Thread Bill Dunlap
untu 2' in Poweshell fixed the problem. This also fixed one of my test C programs: '1.0L + 1e-60L > 1.0L' was true if I compiled with gcc -O but false with no optimization. On Wed, Nov 18, 2020 at 3:56 AM Iñaki Ucar wrote: > On Wed, 18 Nov 2020 at 10:26, Tomas Kalibera &

[Rd] formatting issue with gcc 9.3.0 on Ubuntu on WSL2

2020-11-17 Thread Bill Dunlap
15" "9.508000e-15" "9.838000e-15" [7] "9.899000e-15" "9.934000e-15" "9.995000e-15" > str(grep(value=TRUE, "0e", vapply((1+(0:1)/1000)*1e-14, deparse, ""))) chr [1:295] "8.0020

[Rd] (no subject)

2020-11-04 Thread Bill Dunlap
Hi All, I am no longer with TIBCO and hope to be able to contribute more directly to R now. It will take a little while to set up a build environment and to start working on some bugzilla issues. -Bill Dunlap williamwdun...@gmail.com [[alternative HTML version deleted

Re: [Rd] tools::package_dependencies problems

2020-10-16 Thread Bill Dunlap
Have you tried using the 'db' argument to tools::package_dependencies? rbind the common columns of installed.packages() and available.packages() and use that as the package database. installed <- installed.packages() available <- available.packages() commonCols <- intersect(colnames(ins

Re: [Rd] How to convert time_t to R date object

2014-03-17 Thread Bill Wang
Hi Sandip, I think that you know on the 64-bit Unix/Linux/OS X platforms, long is 64-bit whereas int and INTEGER are 32-bit, so return directly Integer unexpected problems may occur. Cheers, Bill 2014-03-17 13:24 GMT+08:00 Sandip Nandi : > Hi Bill , > > The following C code may

Re: [Rd] How to convert time_t to R date object

2014-03-16 Thread Bill Wang
Hi Dirk, Thanks for your reply, I neede convert time_t to R type in C code, can not use Rcpp. Maybe Rcpp source code could help me. Cheers, Bill 2014-03-16 22:55 GMT+08:00 Dirk Eddelbuettel : > > On 16 March 2014 at 18:36, Bill Wang wrote: > | I am writing a R extensions, and I

[Rd] How to convert time_t to R date object

2014-03-16 Thread Bill Wang
Hi all, I am writing a R extensions, and I need pass time_t to R in C, but I don't know how to do. Can you give me some help? do not use double directly. Thanks, Bill -- *Travel | Programming* *http://freecnpro.net* <http://freecnpro.net> [[alternative HTML vers

Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1)

2010-06-10 Thread Bill . Glessner
2.11.1_build/bin/Rcmd: @: not found gnumake[2]: *** [MASS.ts] Error 1 gnumake[2]: Leaving directory `/usrX/JunqueYard/R-2.11.1_build/src/library/Recom mended' gnumake[1]: *** [recommended-packages] Error 2 gnumake[1]: Leaving directory `/usrX/JunqueYard/R-2.11.1_build/src/library/Recom mended'

Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1)

2010-06-09 Thread Bill . Glessner
ot;${R_HOME}/etc${R_ARCH}/Renviron" export `sed 's/^ *#.*//; s/^\(.*\)=.*/\1/' "${R_HOME}/etc${R_ARCH}/Renviron"` extra= case "$...@}" in perl) cmd="${PERL}" ;; awk) cmd="${AWK}" ;; ## this was a separate command prior to 2.10.0 Rd

Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Bill . Glessner
txt" ;; Rd2pdf) cmd="${R_HOME}/bin/Rd2dvi" extra="--pdf" ;; *) if test -x "${R_HOME}/bin/${1}"; then cmd="${R_HOME}/bin/${1}" else cmd="${1}" fi ;; esac shift exec "${cmd}" ${extra} "$

[Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Bill . Glessner
t (see R-admin) that our main intention is to allow a ## LAPACK-containing BLAS to be used, so this is rarely needed, and ## it is not used if the BLAS already contains LAPACK. ## LAPACK_LIBS= ## Make name. ## Set this if you want to use a make by another name. ## For example, if your GNU make is called 'gmake', use 'MAKE=gmake'. ## MAKE= MAKE=gnumake ## Tar name ## Set this to prefer a tar which has the capability to automagically ## read compressed archives. The default is to choose 'gtar' (normally ## GNU tar) then 'tar', but other possibilities include 'bsdtar' from ## the libarchive project. ## TAR= TAR=gnutar In looking through the R documentation I didn't see any reference to "@" as a function/variable/language element/etc. Thanks for your help, Bill __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] textConnection performance quadratic (PR#14053)

2009-11-09 Thread bill . hopkins
Full_Name: William E. Hopkins Version: 2.9.0 OS: Windows XP Submission from: (NULL) (209.244.4.106) textConnection() has quadratic performance. A function I wrote was taking outrageous amount of time to execute on a large character vector (small test set was used for functional development). I c

Re: [Rd] (PR#12770) format() under Windows giv wrong resuts w

2008-09-10 Thread Bill Dunlap
On Wed, 10 Sep 2008, Bill Dunlap wrote: > I can reproduce the problem on Windows XP service pack 3 > with R 2.8.0-dev if I set the locale to "italian" (by default > it is English_United States" for me): >> pippo=strptime("23:43:12", format="%H:%M:

Re: [Rd] (PR#12770) format() under Windows giv wrong resuts with

2008-09-10 Thread Bill Dunlap
uot; requires times with AM/PM > > indicator, > > but the resulting output doesn't contain it. > > Example: > >> pippo=strptime("23:43:12", format="%H:%M:%S") > >> pippo > > [1] "2008-09-10 23:43:12" > >> class(pippo) >

[Rd] should system.file(package="no such pkg", "no such file") warn or abort?

2008-09-09 Thread Bill Dunlap
+1,23 @@ `system.file` <- -function (..., package = "base", lib.loc = NULL) +function (..., package = "base", lib.loc = NULL, missingFileOK = FALSE) { if (nargs() == 0) return(file.path(.Library, "base")) if (length(package) != 1)

Re: [Rd] (PR#12628) Second X11 call with invalid display crashes R after first X11 call.

2008-08-28 Thread Bill Dunlap
On Thu, 28 Aug 2008, Prof Brian Ripley wrote: > This is an Xt error, whereas the first one is an Xlib error. It is easy > to trap it. > > You do realize that this will never work? In the current setup all open > X11 devices must be on the same display, and 'display' is ignored if a > device is a

Re: [Rd] dput function (PR#12112)

2008-08-07 Thread Bill Dunlap
By the way, valgrind finally finished checking this example and found no problems after adding the PROTECT(tval). Nor did valgrindless R crash as it did before on this example. -Bill On Thu, 7 Aug 2008, Prof Brian Ripley wrote: > Bill, > > Thanks. Whether or not it is the cause here

Re: [Rd] dput function (PR#12112)

2008-08-07 Thread Bill Dunlap
.c:311) ==32381==by 0x8065454: do_internal (names.c:1138) ==32381==by 0x8160557: Rf_eval (eval.c:461) ==32381==by 0x8160557: Rf_eval (eval.c:461) ==32381==by 0x8162267: do_begin (eval.c:1174) ==32381==by 0x8160557: Rf_eval (eval.c:461)

[Rd] memory leak in sub("[range]", ...) when #ifndef _LIBC (PR#11946)

2008-08-07 Thread bill
Full_Name: Bill Dunlap Version: R version 2.8.0 Under development (unstable) (2008-07-05 r46037) OS: Linux Submission from: (NULL) (76.28.245.14) valgrind finds some memory leaks in R when I use sub() with a range in the regular expression: % R --debugger=valgrind --debugger-args=--leak-check

Re: [Rd] closing View windows after multiple View(x) crashes

2008-07-29 Thread Bill Dunlap
#define USE_Xt 1 Valgrind reports a slew of memory leaks when R closes after using View(), but it didn't show any use of freed or uninitialized memory after that change. ---- Bill Dunlap Insightful Corporation bill

Re: [Rd] closing View windows after multiple View(x) crashes

2008-07-29 Thread Bill Dunlap
"Red Hat Enterprise Linux WS release 4 (Nahant Update 3)" with the Cygwin X server on a Windows XP laptop. ---- Bill Dunlap Insightful Corporation bill at insightful dot com "All statements in this message represent the opinions of the author and do not necessarily r

Re: [Rd] Checking package help file examples

2008-07-18 Thread Bill Dunlap
On Fri, 18 Jul 2008, Arne Henningsen wrote: > On Friday 18 July 2008 02:19:14, Bill Dunlap wrote: > > I am trying to figure out the sanctioned way for > > 'R CMD check pkg' to make sure that the examples > > in help files give the expected results. > > >

[Rd] Checking package help file examples

2008-07-17 Thread Bill Dunlap
y to check help file examples for correctness. (It would be nicer if the example() function could also check for correctness, and the above method doesn't allow for that.) Bill Dunlap Insightful Corporation bill at i

[Rd] memory leak in readline code

2008-07-10 Thread Bill Dunlap
line 4.3 in particular): > sessionInfo() R version 2.8.0 Under development (unstable) (2008-07-07 r46046) i686-pc-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TEL

[Rd] memory leak in sub("[range]",...)

2008-07-09 Thread Bill Dunlap
set->char_classes); re_free (cset); } [This report may be a duplicate: I tried submitting it via the form in http://bugs.r-project.org/cgi-bin/R, but I cannot find it there now.] Bill Dunlap Insightful Corporation

Re: [Rd] how to install header files in package

2008-06-13 Thread Bill Dunlap
they should go into a parallel directory. Where should they go? ---- Bill Dunlap Insightful Corporation bill at insightful dot com "All statements in this message represent the opinions of the author and

Re: [Rd] arima() bug

2008-06-12 Thread Bill Dunlap
b) print np $2 = 67528 (gdb) print r $3 = 367 (gdb) print q $4 = 366 Trying to recover from running out of memory probably causes the crash. rbar is a scratch array. ---- Bill Dunlap Insightful Corporation bill at insightful d

Re: [Rd] Routine and Deep testing with R CMD check

2008-06-11 Thread Bill Dunlap
On Wed, 11 Jun 2008, Prof Brian Ripley wrote: > Bill Dunlap wrote: > > It might be nice if check could print the time it took to do > > each test. > > That's an existing request for various parts of the checking procedure. > When the time to run a package check jump

Re: [Rd] read.table() causes segfault with incorrect data (PR#11627)

2008-06-11 Thread Bill Dunlap
== --- connections.c (revision 45893) +++ connections.c (working copy) @@ -3669,6 +3669,7 @@ if(con->nPushBack > 0) { for(j = 0; j < con->nPushBack; j++) free(con->PushBack[j]); free(con->PushBack); +con->nPu

Re: [Rd] Routine and Deep testing with R CMD check

2008-06-11 Thread Bill Dunlap
alphabetize your test files. It might be nice if check could print the time it took to do each test. -------- Bill Dunlap Insightful Corporation bill at insightful dot com "All statements in this message represent the o

Re: [Rd] Splus/R typedef for C equivalent of S "integer"

2008-06-04 Thread Bill Dunlap
On Wed, 4 Jun 2008, Prof Brian Ripley wrote: > Bill, > > R's R.h already has > > typedef double Sfloat; > typedef int Sint; > #define SINT_MAX INT_MAX > #define SINT_MIN INT_MIN Whoops, I forgot the name and that I'd put it into Splus's R.h (and now

[Rd] Splus/R typedef for C equivalent of S "integer"

2008-06-04 Thread Bill Dunlap
uld be a good place for it, but I don't have strong feeling about that one. If we can come to a consensus on the name, typedef/#define, and which *.h file, I can put it into Splus. -------- Bill Dunlap Insightful Corporation

Re: [Rd] Reading an "unsigned long long" using R readBin()

2008-05-30 Thread Bill Dunlap
out", open="br"), what="integer", n=7, size=8, signed=FALSE) [1] 1 2147483647 -2147483647 -1 1 1 [7] 1 (That one gives the same result in R and Splus.) What do folks think about having this option in

Re: [Rd] bug in R 2.7.0 (PR#11497)

2008-05-22 Thread Bill Dunlap
On Thu, 22 May 2008, Bill Dunlap wrote: > Also, if your input starts with certain errors, parse returns > the stuff after the error: >> parse() >?err//one >expression(one) > > > After the attached change we get > >> parse() >?on

Re: [Rd] bug in R 2.7.0 (PR#11497)

2008-05-22 Thread Bill Dunlap
On Thu, 22 May 2008, Peter Dalgaard wrote: > More succinctly, parse() from stdin() seems to be broken: > > > parse() > ?a > expression() > > This was not the case in January (this was the older version I had lying > around): > > R version 2.6.2 alpha (2008-01-29 r44233) > > > parse() > ?a > e

Re: [Rd] a R_PV problem

2008-05-06 Thread Bill Dunlap
*/ void R_PV(SEXP s) { if(isObject(s)) PrintValueEnv(s, R_GlobalEnv); } and include/Internals.h has the usual add-Rf_ #define: #define PrintValue Rf_PrintValue Bill Dunlap Insightful Corporation

Re: [Rd] reproducible segmentation fault caused by textConnection()

2008-04-29 Thread Bill Dunlap
macro) be changed to propogate the protection status? It looks like it always requires protection tricks to use. Bill On Tue, 29 Apr 2008, Bill Dunlap wrote: > On Tue, 29 Apr 2008, Gregoire Pau wrote: > > > Dear all, > > > > It seems that textConnection() can tri

Re: [Rd] non-digits in svnversion output mess up windows build if (PR#11341)

2008-04-29 Thread bill
then we could check the disribution by checking that !is.na(as.integer(svn$"svn rev")). It might also be nice to include the output of 'svn diff' in the distribution so a user or tester could see how this version was different than the official one. > On 29/04/2008 2:30 P

Re: [Rd] non-digits in svnversion output mess up windows build if USE_SVNVERSION=yes (PR#11339)

2008-04-29 Thread Bill Dunlap
then we could check the disribution by checking that !is.na(as.integer(svn$"svn rev")). It might also be nice to include the output of 'svn diff' in the distribution so a user or tester could see how this version was different than the official one. > On 29/04/2008 2:30 P

[Rd] non-digits in svnversion output mess up windows build if USE_SVNVERSION=yes (PR#11339)

2008-04-29 Thread bill
Full_Name: Bill Dunlap Version: 2.8.0dev OS: Windows XP Submission from: (NULL) (70.98.76.47) I tried for the first time to build R from source on Windows, where I got the source code via svn. Per the Installation and Administration manual, I altered src\gnuwin32\MkRules so it had the the

Re: [Rd] reproducible segmentation fault caused by textConnection()

2008-04-29 Thread Bill Dunlap
}, listsxp = {carval = 0x120, cdrval = 0x0, tagval = 0x57685c0}, envsxp = {frame = 0x120, enclos = 0x0, hashtab = 0x57685c0}, closxp = {formals = 0x120, body = 0x0, env = 0x57685c0}, promsxp = {value = 0x120, expr = 0x0, env = 0x57685c0}}} ---

Re: [Rd] plot(x) in 2.7.0 (with y=NULL) proposed code correction

2008-04-22 Thread Bill Dunlap
ucture(1:10, class="MyRadian"), structure(10:1, class="MyRadian"), main="n pi radians on both axes") plot(1:10, 1:10, main="no pi's on either axis") par(mfrow=c(2,2)) ---- Bill Dunlap

Re: [Rd] prod(0, 1:1000) ; 0 * Inf etc

2008-04-21 Thread Bill Dunlap
p; R-core > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > -- > Institute of Mathematics > Ecole Polytechnique F?d?rale de Lausanne > STAT-IMA-FSB-EPFL, St

Re: [Rd] nondigits in R_FILEVERSION mess up Windows build

2008-04-19 Thread Bill Dunlap
On Fri, 18 Apr 2008, Bill Dunlap wrote: > I tried for the first time to build R from source on Windows, where I > got the source code via svn. Per the Installation and Administration > manual, I altered src\gnuwin32\MkRules so it had the the locally > correct paths to HTML Help Works

[Rd] nondigits in R_FILEVERSION mess up Windows build

2008-04-18 Thread Bill Dunlap
e R_FILEVERSION${maj},${pl}${sl},`echo ${svn_rev}|sed -e 's/[MS]*$//'`,0" echo echo '#ifdef __cplusplus' echo '}' Bill Dunlap Insightful Corporation bill at insightful dot com "All statements in this message represe

Re: [Rd] Couldn't (and shouldn't) is.unsorted() be faster?

2008-04-17 Thread Bill Dunlap
0 0 > revx <- rev(x) > system.time(is.unsorted(revx), gcFirst=TRUE) user system elapsed 0.500 0.170 0.672 > system.time(is.unsorted.no.nacheck(revx),gcFirst=TRUE) user system elapsed 0.131 0.000 0.132 ---

Re: [Rd] HOW TO AVOID LOOPS

2008-04-14 Thread Bill Dunlap
.29 0.18 f65.40 0.78 5.42 3.14 f70.06 0.05 0.06 0.06 I've attached the script so you can figure out whose function is whose if you care to. The lapply/mapply solution, f3, required that there be 1's at both ends of the inp

[Rd] unix.time() scoping problem (PR#11169)

2008-04-14 Thread bill
Full_Name: Bill Dunlap Version: 2.8.0 Under development (unstable) svn 45325 OS: Linux Submission from: (NULL) (76.28.245.14) It is difficult to write wrapper functions for unix.time(expr) because it uses the idiom expr <- substitute(expr) eval(expr, envir=sys.parent()) to evaluate

Re: [Rd] R 64 on Intel Mac check problem

2008-03-26 Thread Bill Northcott
at llvm-gcc is affected? Bill __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R 64 on Intel Mac check problem

2008-03-26 Thread Bill Northcott
t may be worth doing even if you cannot get a minimal case because all the sources are readily available. Finally last time I looked a few days back Simon's 64 bit Intel builds were failing. Bill Northcott __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] 'merge' function: behavior w.r.t. NAs in the key column

2008-03-19 Thread Bill Dunlap
R: k2 k1.x data.x k1.y data.y R: 1 44 44 4 R: 2 55 55 5 R: 3 NA NA 2 NA 1 R: 4 NA NA 22 2 R: 5 NA3 3 NA 1 R: 6 NA3 32 2 > I'll add an

Re: [Rd] 'merge' function: behavior w.r.t. NAs in the key column

2008-03-14 Thread Bill Dunlap
e( x, y, by="key" ) key val.x val.y 1 21222 2 31323 3 31423 4 31326 5 314 26 Is that what you expect? There is no argument to Splus's merge to make it include the NA's in the way R's merge does. Should ther

[Rd] codetools::checkUsage should ignore expression in Quote(expr) (PR#10719)

2008-02-06 Thread bill
Full_Name: Bill Dunlap Version: R version 2.7.0 Under development (unstable) (2008-02-05 r44340) OS: Linux Submission from: (NULL) (76.28.245.14) codetools::checkUsage() should treat the Quote() function just as it does the quote() and expression() functions: by ignoring its argument. Currently

Re: [Rd] read.table: aborting based on a time constraint

2008-01-09 Thread Bill Dunlap
it to catch the interrupt. This is pretty ugly, but I was wondering if R had the facilities to write such a timeout() function. I used to use it to automate tests of infinite-loop bugs. Bill Dunlap Insightful Corporation bill at insightful dot com 360-428-8146 "All statements in this

Re: [Rd] C/C++ 'assert' should not be used in R packages

2007-11-10 Thread Bill Dunlap
ge? I think I could do something like that > in Windows by calling FreeLibrary to unload the DLL, but I'd prefer a > cross-platform solution. Bill Dunlap Insightful Corporation bill at insightful dot com 360-4

Re: [Rd] Use of all/any

2007-10-26 Thread Bill Dunlap
On Fri, 26 Oct 2007, Bill Dunlap wrote: > In Splus I use >rapply(expr, classes="call", > f=function(x)if(isComparisonOfAnyOrAll(x))deparseText(x)) > to rattle down an an expression tree looking for this pattern. > However's R's rapply won't let m

Re: [Rd] Use of all/any

2007-10-26 Thread Bill Dunlap
On Fri, 26 Oct 2007, Martin Maechler wrote: > Apropos Bill Dunlap's note: Do newer versions of S-plus warn? > At least up to 6.2.2, I'm pretty sure no S version has warned > about > X <- c(0.1, pi) > all(X) > 0.5 Hi Martin, No, it doesn't warn.

Re: [Rd] *.Rd file: space after topic in "\alias{topic }" should be (PR#9915)

2007-09-17 Thread bill
On Mon, 17 Sep 2007 [EMAIL PROTECTED] wrote: > Full_Name: Bill Dunlap > Version: R version 2.6.0 Under development (unstable) (2007-07-26 r42329) > OS: Linux > Submission from: (NULL) (24.16.101.199) > > If a *.Rd file has an \alias{topic } with a space > between 'topic

[Rd] *.Rd file: space after topic in "\alias{topic }" should be ignored (PR#9914)

2007-09-17 Thread bill
Full_Name: Bill Dunlap Version: R version 2.6.0 Under development (unstable) (2007-07-26 r42329) OS: Linux Submission from: (NULL) (24.16.101.199) If a *.Rd file has an \alias{topic } with a space between 'topic' and the closing '}' then the space is copied to the help/A

Re: [Rd] (PR#9811) sequence(c(2, 0, 3)) produces surprising results,

2007-07-30 Thread bill
dentifies group [1] 1 1 1 1 1 2 2 3 3 3 3 3 3 3 > sequence(c(5,2,7)) # which in group [1] 1 2 3 4 5 1 2 1 2 3 4 5 6 7 ---- Bill Dunlap Insightful Corporation bill at insightful dot com 360-428-8146 "All statement

  1   2   >