Re: [Rd] specials and ::

2024-08-27 Thread Bill Dunlap
removeDoubleColonSurvival (or 'f', as it was shown in the example) could be changed to only remove the 'survival::' from expressions that involve the names to be used in specials. E.g., change if (is.call(expr) && identical(expr[[1]], doubleColon) && identical(expr[[2]], survival)) to specialNam

Re: [Rd] specials and ::

2024-08-26 Thread Bill Dunlap
One could define a function that removes all instances of 'survival::' from an expression, returning the fixed up expression, and applying it to all formulae given as arguments to your survival functions. E.g., removeDoubleColonSurvival <- function (formula) { doubleColon <- as.name("::") sur

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

2024-03-04 Thread Bill Dunlap
Maybe someone has already suggested this, but if your functions accepted strings you could use sub or gsub to replace the -> with a symbol that parsed at the same precedence as <-, say <<-. Then parse it and deal with it. When it is time to display the parsed and perhaps manipulated formulae to t

Re: [Rd] Difficult debug

2024-02-07 Thread Bill Dunlap
akpoint on Rf_error or something in your code, and 'cont' or 'continue' to resume running R. You can get information about the status and history of a memory location, say 0x12345678, with (gdb) monitor vinfo location 0x12345678 More information is in https://valgrind.org/docs

Re: [Rd] Difficult debug

2024-02-07 Thread Bill Dunlap
I haven't done any R memory debugging lately, but https://www.mail-archive.com/rcpp-devel@lists.r-forge.r-project.org/msg10289.html shows how I used to have gdb break where valgrind finds a problem so you could examine the details. Also, running your code after running gctorture(TRUE) can help tr

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, Nov 28, 2023 at 11:28 

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

2023-08-16 Thread Bill Dunlap
You wrote: Using singular value decomposition, any second-order tensor is given as A = UΣVt where U and V are the orthogonal tensors, and Σ is the diagonal matrix (Eigenvalue matrix). For a symmetric matrix, the orthogonal tensors are the same, i.e., U=V. Ca

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. > I als

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

2023-05-11 Thread Bill Dunlap
> What do others think? I can imagine a class, "TemperatureKelvins", that wraps a double but would have a range of 0 to Inf or one called "GymnasticsScore" with a range of 0 to 10. For those sorts of things it would be nice to have a generic that gave the possible min and max for the class inste

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

2023-04-25 Thread Bill Dunlap
x <- c(1, 1, 2, 2, 2, 3) y <- c(1, 2, 1, 3, NA, 3) > str(xyTable(x,y)) List of 3 $ x : num [1:6] 1 1 2 2 NA 3 $ y : num [1:6] 1 2 1 3 NA 3 $ number: int [1:6] 1 1 1 NA NA 1 How many (2,3)s do we have? At least one, the third entry, but the fourth entry, (2,NA), is possibly a (2,3) so

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: > I thin

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

2023-03-02 Thread Bill Dunlap
x$`string` is not the same as x$'string'. They may act similarly now, but they do not parse the same. > vapply(as.list(quote(list$`component`)), typeof, "") [1] "symbol" "symbol" "symbol" > vapply(as.list(quote(list$"component")), typeof, "") [1] "symbol""symbol""character" > vapply(as.li

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 StackOverflow that identifi

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

2022-10-29 Thread Bill Dunlap
> the `delayed` object is ready to be garbage collected if not assigned immediately. I am not sure what is meant here. Any object (at the R code level) is ready to be garbage collected if not given a name or is not part of an object with a name. Do you mean a 'delayed' component of a list should

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

2022-10-28 Thread Bill Dunlap
You can play with the idea by returning an environment that contains delayed assignments. E.g., > f <- function(x) { +delayedAssign("eval_date", { cat("Evaluating 'date'\n"); date()}) +delayedAssign("sum_x", { cat("Evaluating 'sum_x'\n"); sum(x)}) +environment() + } > fx <- f(1:10) >

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 actually be the case for

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

2022-05-02 Thread Bill Dunlap
In R-4.1.2 (and before) as.vector(aDataFrame) returned aDataFrame, unchanged. E.g., 4.1.2> aDataFrame <- data.frame(X=101:103, Y=201:203, Z=301:303) 4.1.2> attr(aDataFrame, "anAttr") <- "an attribute" 4.1.2> identical(as.vector(aDataFrame), aDataFrame) [1] TRUE 4.1.2> dput(aDataFrame)

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Bill Dunlap
n't have behavior > identical to paste0. Was that what you were getting at as well, Bill? > > ~G > > On Mon, Dec 6, 2021 at 4:11 PM Bill Dunlap > wrote: > >> Should paste0(character(0), c("a","b")) give character(0)? >> There is a fair

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., Avraham Adler wrote: > > Gabe, I agree that

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 Wang w

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=function(x) x[1,]) > byy.empty <- by

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
Adding the dimensions attribute takes away the altrep-ness. Removing dimensions does not make it altrep. E.g., > a <- 1:10 > am <- a ; dim(am) <- c(2L,5L) > amn <- am ; dim(amn) <- NULL > .Call("is_altrep", a) [1] TRUE > .Call("is_altrep", am) [1] FALSE > .Call("is_altrep", amn) [1] FALSE where

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

2021-06-21 Thread Bill Dunlap
NULL cannot be in an integer or numeric vector so it would not be a good fit for substring's 'first' or 'last' argument (or substr's 'start' and 'stop'). Also, it is conceivable that string lengths may be 64 bit integers in the future, so why not use Inf as the default? Then the following would g

Re: [Rd] base R pipe documentation

2021-05-18 Thread Bill Dunlap
It would be nice to have "|>" listed in the precedence table in help(Syntax). I think it has the same precedence as "%any%" and both are left-associative. > quote( a |> f1() %any% f2()) f1(a) %any% f2() > quote( a %any% f1() |> f2()) f2(a %any% f1()) help(`|>`) does mention magrittr's pip

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

2021-03-27 Thread Bill Dunlap
> > It looks like when calling the dollar symbol using the function format, it > > treats the input argument as a character literal and does not evaluate it > > inside the function. I know we have the function `field` to get the slot > > variable, but I wonder if this is designed on purpose as the

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
as.matrix.data.frame does not take the absolute value of that number: > dPos <- structure(list(X=101:103,201:203),class="data.frame",row.names=c(NA_integer_,+3L)) > dNeg <- structure(list(X=101:103,201:203),class="data.frame",row.names=c(NA_integer_,-3L)) > rownames(as.matrix(dPos)) [1] "

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 wrote: > Gabor, > > Althou

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
'=>' can be defined as a function. E.g., it could be the logical "implies" function: > `=>` <- function(x, y) !x | y > TRUE => FALSE [1] FALSE > FALSE => TRUE [1] TRUE It might be nice then to have deparse() display it as an infix operator instead of the current prefix: > d

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

2020-12-31 Thread Bill Dunlap
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? No. .Call(C_func, arg1, arg2) expects C_func's arguments to all be SEXP* (pointers to

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 defs of complex types] ... /

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

2020-12-09 Thread Bill Dunlap
When I am debugging a function with code like x <- f1(x) x <- f2(x) result <- f3(x) I will often slip a line like '.GlobalEnv$tmp1 <- x' between the first two lines and '.GlobalEnv$tmp2 <- x' between the last two lines and look at the intermediate results, 'tmp1' and 'tmp2' in the globa

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
The call to system() probably is an internal call used to delete the session's tempdir(). This sort of failure means that a potentially large amount of disk space is not being recovered when R is done. Perhaps R_CleanTempDir() could call R_unlink() instead of having a subprocess call 'rm -rf ...'

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 complicated cases. > > This

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
I just got a new Windows laptop (i7, 10th generation CPU), installed 'Windows Subsystem for Linux 2' and then installed Ubuntu 20.04 and used 'apt-get install' to install packages that the R build seems to require. In particular, I am using gcc version 9.3.0. The build went without a hitch but t

[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] (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
it should clearly be > PROTECT-ed (I suspect the original version didn't need to be, but leaving > PROTECTs off is prejudicial to future maintenance), so I've incorporated > this in R-devel/R-patched. > > Brian > > On Thu, 7 Aug 2008, Bill Dunlap wrote: > >

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)

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
l/R/library/stats/libs/stats.so /a/homer.insightful.com/users/bill/R-svn/r-devel/R/library/methods/libs/methods.so /lib/libnsl-2.3.4.so /usr/lib/gconv/ISO8859-1.so /lib/libnss_nis-2.3.4.so /usr/lib/libg2c.so.0.0.0 /usr/lib/libncurses.so.5.4 /usr/lib/gconv/gconv-modules.cache /a/homer.insightful.com/

[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
x is %ld\n", (long)x_zero); will print x[0] properly in R and Splus but Rprintf("First element of x is %d\n", x_zero); will not work properly in Splus. Thanks, Bill Bill Dunlap Insightful Corporation

[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 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

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

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

2008-03-19 Thread Bill Dunlap
sidered equal. ('NA==NA' does not evaluate to 'TRUE'.) > >> > >> Is might be more consistent if merge did not include any rows into the > >> output with an "NA" in the key column. > >> > >> Maybe, one could add a flag argument

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 31426 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

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
all calls of the form log(x, base) to logb(x, base) but not change calls of the form log(x) you can do > changeLogCalls<-function(func) { rapply(func, classes="call", how="replace", function(expr){ if(isCallTo(expr,"log",2)

Re: [Rd] Rd2dvi (PR#9812)

2007-07-26 Thread Bill Dunlap
ave added > # a close rdfile at the end of the while(), but > # scoping method is more reliable. 123c127 < while(){ --- > while(<$rdfile>){ Bill Dunlap Insightful Corporation bill at insigh

Re: [Rd] sequence(c(2, 0, 3)) produces surprising results, would like output length to be sum(input) (PR#9811)

2007-07-26 Thread Bill Dunlap
On Thu, 26 Jul 2007 [EMAIL PROTECTED] wrote: > Full_Name: Bill Dunlap > Version: 2.5.0 > OS: Linux > Submission from: (NULL) (70.98.76.47) > > sequence(nvec) is documented to return > the concatenation of seq(nvec[i]), for > i in seq(along=nvec). This produces inconvenien

Re: [Rd] dict package: dictionary data structure for R

2007-07-22 Thread Bill Dunlap
45 6514 1486 2717 1608 289 20 Perhaps new.env() should push the requested size up to the next prime by default. (This is not to say your other changes are not improvements.) Bill Dunlap Insightful Corporation bill at insightful dot com 360-428-8146 "All statements in this message repr

Re: [Rd] (PR#9796) write.dcf/read.dcf cycle converts missing entry

2007-07-18 Thread Bill Dunlap
On Wed, 18 Jul 2007 [EMAIL PROTECTED] wrote: > I am seeing some problems here, for example when all the fields are > missing, or all the fields in a row are missing. I've fixes for those, > and will commit to R-devel shortly. write.dcf() is also used by print.packageDesription() so this change a

Re: [Rd] data messed up by read.table ? (PR#9779)

2007-07-05 Thread Bill Dunlap
rub 4.7T4 > 22Pound.Hill 4.4 2 Arable 4.5F5 > 23Gravel.Pit 2.9 1 Grassland 3.5F1 > 24 Farm.Wood 0.810 Scrub 5.1T3 -

Re: [Rd] package check note: no visible global function definition (in functions using Tcl/Tk)

2007-06-14 Thread Bill Dunlap
lly works when pkgName is not available. This might overload the nightly build machine, but would be useful for the developer. ---- Bill Dunlap Insightful Corporation bill at insightful dot com 360-428-8146 "All statem

Re: [Rd] C function with unknown output length

2007-06-06 Thread Bill Dunlap
(retval)) Rprintf("expanding retval from %d to %d moved it\n", retval_length-1, retval_length) ; NUMERIC_POINTER(retval)[retval_length-1] = r ; } PutRNGstate(); return retval ; } -------- Bil

Re: [Rd] Possible changes to connections

2007-05-31 Thread Bill Dunlap
.txt")) R 16950 bill3r REG8,2 26 229597 /tmp/twolines.txt That difference sinces unnatural to me. Of course, we could just add the mode= argument and hope people started using it instead of open=. --

Re: [Rd] RFC: adding an 'exact' argument to [[

2007-05-17 Thread Bill Dunlap
operator alone, so it will continue to do partial matching? I suspect that that is where the majority of partial matching for list names is done. It might be nice to have an option that made x$partial warn so we would fix code that relied on partial matching, but that is lower priority.

Re: [Rd] optim bug (PR#9684)

2007-05-15 Thread Bill Dunlap
14 May 2007, [EMAIL PROTECTED] wrote: > > 'optim' does not accept arguments called 'u'. Here is an example: > > > R> fun<-function(x,u) (x-u)^2 > > R> optim(7,fn=fun,u=9) > > > > Fehler in fn(par, ...) : Argument "u" fehlt

Re: [Rd] R CMD Rdconv drops sections: arguments, seealso, examples (PR#9649)

2007-05-07 Thread Bill Dunlap
t;. + " on or after line $badlineno\n"; } + } } - if( $extra_info =~ /^'}'$/ ) { - warn "Note: unmatched right brace in '$Rdname'". - " on or after line $badlineno\n"; -

Re: [Rd] R CMD Rdconv drops sections: arguments, seealso, examples (PR#9645)

2007-05-01 Thread Bill Dunlap
On Mon, 30 Apr 2007 [EMAIL PROTECTED] wrote: > On Tue, 10 Apr 2007 [EMAIL PROTECTED] wrote: > > > I've created a .Rd file (below), then converted that to .sgml using > > R CMD Rdconv --type=Ssgm combn.Rd > combn.sgml > > The output (shown below) is missing some of the sections: > > argume

Re: [Rd] R CMD Rdconv drops sections: arguments, seealso, examples (PR#9606)

2007-04-30 Thread Bill Dunlap
On Tue, 10 Apr 2007 [EMAIL PROTECTED] wrote: > I've created a .Rd file (below), then converted that to .sgml using > R CMD Rdconv --type=Ssgm combn.Rd > combn.sgml > The output (shown below) is missing some of the sections: > arguments > seealso > examples > If instead I c

Re: [Rd] plot.xy() with type="s" and huge data (PR#9629)

2007-04-23 Thread Bill Dunlap
someone changed the stack pointer.) type='S' also uses alloca(). ---- Bill Dunlap Insightful Corporation bill at insightful dot com 360-428-8146 "All statements in this message represent the opinions of the author and do not necessarily reflect Insightful Corporation

Re: [Rd] save() and interrupts

2007-04-16 Thread Bill Dunlap
an interrupt you remove the temp file, and on 'kill -9' the only bad effect is the space used by the partially written temp file.) This has the added advantage that you don't overwrite an existing save file by the given name until you know a suitable replacement is ready. Perhaps

Re: [Rd] proposal to allow just transcript files (output only) in the 'tests' directory

2007-02-20 Thread Bill Dunlap
Splus: Splus: Coefficients: Splus: (Intercept) x Splus:0.2432038 0.2304068 Splus: Splus: Degrees of freedom: 10 total; 8 residual Splus: Residual standard error: 0.2388027 This would also be handy for comparing results in different versions of R, where low lev

[Rd] setting up a plot without plotting any data

2006-11-17 Thread Bill Dunlap
;, sig=signature(x="missing", y="missing"), definition=function(x, y, ...).plot.noxy(...)) E.g., plot(xlim=c(-2,2), ylim=c(-2,2)) # set up plot and draw axes for(i in -10:10)points( (.8+.7i)^i) # add points to graph --

Re: [Rd] c.factor

2006-11-15 Thread Bill Dunlap
unction called concat.two(x,y) with is generic and has 2 arguments to make it easer to write methods for. concat(x,y,z) calls concat.two(concat.two(x,y),z). concat() is not used much, but it is the Summary group functions: min, max, sum, etc. ---

  1   2   >