Re: [Rd] request for discussion on lonely doc patch suggestion

2025-03-27 Thread J C Nash
For Linux users, meld is quite nice for side by side editing, though I've never tried using it for display. Just checking now suggests it isn't obvious how to "print" side by side display. I've made meld easier for my own use by creating an icon in Double Commander (DC allows the user to creat

Re: [Rd] [External] Non-API updates

2024-06-25 Thread J C Nash
It is probably important to note that the WRE with the new section on C API compliance is in the R-Devel docs, not the current ones. JN On 2024-06-25 12:10, luke-tierney--- via R-devel wrote: On Tue, 25 Jun 2024, Josiah Parry wrote: Hey folks, I'm sure many of you all woke to the

Re: [Rd] [External] Non-API updates

2024-06-25 Thread J C Nash
hat states that the packages will be removed from CRAN with a very short timeline. Is there a link you can provide regarding the "Moving into C compliance?" It cannot be found at https://cran.r-project.org/doc/manuals/R-exts.html. Given that there hasn't been a stable release with

Re: [Rd] Advice debugging M1Mac check errors

2024-02-06 Thread J C Nash
t, getting the indicated result of 0 for (sum(vv1) - 1.0e0), with non-zero on my Ryzen 7 laptop. JN # FPExtendedTest.R J C Nash loopsum <- function(vec){ n <- length(vec) vsum<-0.0 for (i in 1:n) { vsum <- vsum + vec[i]} vsum } small<-.Machine$double.eps/4 # 1/4 of the

Re: [Rd] Advice debugging M1Mac check errors

2024-02-04 Thread J C Nash
build R with --disable-long-double to get closer to the arm64 results if that is your worry. Cheers, Simon On 04/02/2024 4:47 p.m., J C Nash wrote: Slightly tangential: I had some woes with some vignettes in my optimx and nlsr packages (actually in examples comparing to OTHER packages) bec

Re: [Rd] Advice debugging M1Mac check errors

2024-02-04 Thread J C Nash
och On 04/02/2024 4:47 p.m., J C Nash wrote: Slightly tangential: I had some woes with some vignettes in my optimx and nlsr packages (actually in examples comparing to OTHER packages) because the M? processors don't have 80 bit registers of the old IEEE 754 arithmetic, so some existing "

Re: [Rd] Advice debugging M1Mac check errors

2024-02-04 Thread J C Nash
Slightly tangential: I had some woes with some vignettes in my optimx and nlsr packages (actually in examples comparing to OTHER packages) because the M? processors don't have 80 bit registers of the old IEEE 754 arithmetic, so some existing "tolerances" are too small when looking to see if is sma

Re: [Rd] ADA Compliance

2024-01-15 Thread J C Nash
Slightly tangential, but about two decades ago I was researching how multimedia databases might be reasonably structured. To have a concrete test case, I built a database of English Country (Playford) dances, which I called Playford's Progeny. (Ben B. will be aware of this, too.) This proved rathe

Re: [Rd] feature request: optim() iteration of functions that return multiple values

2023-08-08 Thread J C Nash
t;- function(fun) function(...) do.call(fun,list(...))[[1]] rosenbrock_all2 <- returnFirst(rosenbrock_all) # benchmark all functions set.seed <- 100 microbenchmark(env = optim(c(-1,2), rosenbrock_env, data = data), env2 = optim(c(-1,2), rosenbrock_env2, data = dat

Re: [Rd] Concerns with SVD

2023-07-16 Thread J C Nash
Better check your definitions of SVD -- there are several forms, but all I am aware of (and I wrote a couple of the codes in the early 1970s for the SVD) have positive singular values. JN On 2023-07-16 02:01, Durga Prasad G me14d059 wrote: Respected Development Team, This is Durga Prasad reac

Re: [Rd] Query: Could documentation include modernized references?

2023-03-31 Thread J C Nash
Thanks Martin. Following Duncan's advice as well as some textual input, I have put a proposed Rd file for optim on a fork of the R code at https://github.com/nashjc/r/blob/master/src/library/stats/man/optim.Rd This has the diffs given below from the github master. The suggested changes primaril

[Rd] Query: Could documentation include modernized references?

2023-03-26 Thread J C Nash
A tangential email discussion with Simon U. has highlighted a long-standing matter that some tools in the base R distribution are outdated, but that so many examples and other tools may use them that they cannot be deprecated. The examples that I am most familiar with concern optimization and non

Re: [Rd] uniroot violates bounds?

2023-02-18 Thread J C Nash
I wrote first cut at unirootR for Martin M and he revised and put in Rmpfr. The following extends Ben's example, but adds the unirootR with trace output. c1 <- 4469.822 c2 <- 572.3413 f <- function(x) { c1/x - c2/(1-x) }; uniroot(f, c(1e-6, 1)) uniroot(f, c(1e-6, 1)) library(Rmp

Re: [Rd] Potential bug in fitted.nls

2023-01-26 Thread J C Nash
ant by a vector of ones, then the fitted values are of `length(y)`. Is this something that should be reported? ``` r dat <- data.frame(y=c(80,251,304,482,401,141,242,221,304,243,544,669,638), ones = rep(1, 13)) mNull1 <- nls(y ~ a, data=dat, start=c(a=mean(dat$y)))

Re: [Rd] Potential bug in fitted.nls

2023-01-26 Thread J C Nash
model with just a single parameter is length 1, but if I multiply that constant by a vector of ones, then the fitted values are of `length(y)`. Is this something that should be reported? ``` r dat <- data.frame(y=c(80,251,304,482,401,141,242,221,304,243,544,669,638), ones = re

Re: [Rd] Bug in optim for specific orders of magnitude

2022-12-23 Thread J C Nash
ncluded in CRAN offering. Just remove the methods from the ameth and bmeth lists if necessary. Cheers, John Nash # CErickson221223.R # optim(c(0,0), function(x) {x[1]*1e-317}, lower=c(-1,-1), upper=c(1,1), # method='L-BFGS-B') tfun <- function(x, xpnt=317){ if ((length(x)) !

Re: [Rd] Seeking opinions on possible change to nls() code

2021-08-20 Thread J C Nash
concept of inference can be when applied to parameters in such models. JN On 2021-08-20 11:35 a.m., Martin Maechler wrote: >>>>>> J C Nash >>>>>> on Fri, 20 Aug 2021 11:06:25 -0400 writes: > > > In our work on a Google Summer of Code proje

[Rd] Seeking opinions on possible change to nls() code

2021-08-20 Thread J C Nash
nters some computational blockage AFTER it has already found a much better "fit" i.e. set of parameters with smaller sum of squares. Here is a version of the Tetra example: time=c( 1, 2, 3, 4, 6 , 8, 10, 12, 16) conc = c( 0.7, 1.2, 1.4, 1.4, 1.1, 0.8, 0.6, 0.5, 0.3) NLSdata <

[Rd] subset argument in nls() and possibly other functions

2021-07-13 Thread J C Nash
seem to be the "subset()" function of R. John Nash # CroucherSubset.R -- https://walkingrandomly.com/?p=5254 xdata = c(-2,-1.64,-1.33,-0.7,0,0.45,1.2,1.64,2.32,2.9) ydata = c(0.699369,0.700462,0.695354,1.03905,1.97389,2.41143,1.91091,0.919576,-0.730975,-1.42001) Cform <- ydata ~ p1*

[Rd] GSoC project "Improvement to nls()"

2021-05-26 Thread J C Nash
This message is to let R developers know that the project in the Subject is now a Google Summer of Code project. Our aim in this project is to find simplifications and corrections to the nls() code, which has become heavily patched. Moreover, it has some deficiencies in that there is no Marquardt

[Rd] Google Summer of Code for R projects / mentors needed

2021-01-16 Thread J C Nash
One of the mechanisms by which R has been extended and improved has been through the efforts of students and mentors in the Google Summer of Code initiatives. This year Toby Hocking (along with others) has continued to lead this effort. This year, Google has changed the format somewhat so that th

Re: [Rd] URL checks

2021-01-12 Thread J C Nash
Sorry, Martin, but I've NOT commented on this matter, unless someone has been impersonating me. Someone else? JN On 2021-01-11 4:51 a.m., Martin Maechler wrote: >> Viechtbauer, Wolfgang (SP) >> on Fri, 8 Jan 2021 13:50:14 + writes: > > > Instead of a separate file to sto

Re: [Rd] URL checks

2021-01-09 Thread J C Nash
Is this a topic for Google Summer of Code? See https://github.com/rstats-gsoc/gsoc2021/wiki On 2021-01-09 12:34 p.m., Dirk Eddelbuettel wrote: > > The idea of 'white lists' to prevent known (and 'tolerated') issues, note, > warnings, ... from needlessly reappearing is very powerful and general,

Re: [Rd] quantile() names

2020-12-15 Thread Merkle, Edgar C.
other non-default "type" of calculation, what Abby offered may also apply. -Original Message- From: R-devel mailto:r-devel-boun...@r-project.org>> On Behalf Of Abby Spurdle Sent: Monday, December 14, 2020 4:48 PM To: Merkle, Edgar C. mailto:merk...@missouri.edu>> Cc:

[Rd] quantile() names

2020-12-14 Thread Merkle, Edgar C.
All, Consider the code below options(digits=2) x <- 1:1000 quantile(x, .975) The value returned is 975 (the 97.5th percentile), but the name has been shortened to "98%" due to the digits option. Is this intended? I would have expected the name to also be "97.5%" here. Alternatively, the return

Re: [Rd] New URL redirect checks

2020-09-23 Thread J C Nash
t;>>> when you hover over the link, as most browsers do. So one could have >>>>> >>>>> \href{https://disney.org}{https://horrible.web.site} >>>>> >>>>> Duncan Murdoch >>>>> >>>>> >>

Re: [Rd] Help useRs to use R's own Time/Date objects more efficiently

2020-04-04 Thread J C Nash
Show how easily you get month, day, year, day (of {month, week, yr}), ... : > ## (remember to count from 0 (!): mon = 0..11, wday = 0..6, etc !!) > > ##' Transform (Time-)Date vector to convenient data frame : > dt2df <- function(dt, dName = deparse(substitute(dt)), stri

Re: [Rd] unstable corner of parameter space for qbeta?

2020-03-26 Thread J C Nash
chler wrote: >>>>>> J C Nash >>>>>> on Thu, 26 Mar 2020 09:29:53 -0400 writes: > > > Given that a number of us are housebound, it might be a good time to > try to > > improve the approximation. It's not an area where I have muc

Re: [Rd] unstable corner of parameter space for qbeta?

2020-03-26 Thread J C Nash
Any thoughts? > > Well, qbeta() is mostly based on inverting pbeta() and pbeta() > has *several* "dangerous" corners in its parameter spaces > {in some cases, it makes sense to look at the 4 different cases > log.p = TRUE/FALSE // lower.tail = TRUE/FALSE separately ..} >

Re: [Rd] Bug in the "reformulate" function in stats package

2019-03-29 Thread J C Nash
The main thing is to post the "small reproducible example". My (rather long term experience) can be written if (exists("reproducible example") ) { DeveloperFixHappens() } else { NULL } JN On 2019-03-29 11:38 a.m., Saren Tasciyan wrote: > Well, first I can't sign in bugzilla myse

Re: [Rd] as.data.frame.table() does not recognize default.stringsAsFactors()

2019-03-15 Thread Mychaleckyj, Josyf C (jcm6t)
th > as for other character data. > > -pd > >> On 12 Mar 2019, at 21:39 , Mychaleckyj, Josyf C (jcm6t) >> wrote: >> >> Reporting a possible inconsistency or bug in handling stringsAsFactors in >> as.data.frame.table() >> >> Here is a sim

[Rd] as.data.frame.table() does not recognize default.stringsAsFactors()

2019-03-14 Thread Mychaleckyj, Josyf C (jcm6t)
Reporting a possible inconsistency or bug in handling stringsAsFactors in as.data.frame.table() Here is a simple test > options()$stringsAsFactors [1] TRUE > x<-c("a","b","c","a","b") > d<-as.data.frame(table(x)) >

[Rd] Fwd: Package inclusion in R core implementation

2019-03-04 Thread J C Nash
Rereading my post below, I realize scope for misinterpretation. As I have said earlier, I recognize the workload in doing any streamlining, and also the immense service to us all by r-core. The issue is how to manage the workload efficiently while maintaining and modernizing the capability. That

Re: [Rd] Package inclusion in R core implementation

2019-03-04 Thread J C Nash
by folk outside the core. JN On 2019-03-04 9:12 a.m., Avraham Adler wrote: > On Mon, Mar 4, 2019 at 5:01 PM J C Nash <mailto:profjcn...@gmail.com>> wrote: > > As the original coder (in mid 1970s) of BFGS, CG and Nelder-Mead in > optim(), I've > been pu

Re: [Rd] Package inclusion in R core implementation

2019-03-04 Thread J C Nash
As the original coder (in mid 1970s) of BFGS, CG and Nelder-Mead in optim(), I've been pushing for some time for their deprecation. They aren't "bad", but we have better tools, and they are in CRAN packages. Similarly, I believe other optimization tools in the core (optim::L-BFGS-B, nlm, nlminb)

Re: [Rd] trace in uniroot() ?

2018-08-13 Thread J C Nash
the trace/verbose arguments for the various root finders > and optimizers and instead use the trace > function or otherwise modify the function handed to the operator.  You can > print or plot the arguments or save them.  E.g., > >> trace(ff, print=FALSE, quote(cat("x=&qu

[Rd] typo in Ubuntu download page

2018-08-04 Thread J C Nash
In https://cran.r-project.org/bin/linux/ubuntu/ Administration and Maintances of R Packages ^^ Minor stuff, but if someone who can edit is on the page, perhaps it can be changed to "Maintenance" Best, JN __ R-devel@r-project

[Rd] trace in uniroot() ?

2018-07-30 Thread J C Nash
In looking at rootfinding for the histoRicalg project (see gitlab.com/nashjc/histoRicalg), I thought I would check how uniroot() solves some problems. The following short example ff <- function(x){ exp(0.5*x) - 2 } ff(2) ff(1) uniroot(ff, 0, 10) uniroot(ff, c(0, 10), trace=1) uniroot(ff,

[Rd] histoRicalg -- project to document older methods used by R and transfer knowledge

2018-06-05 Thread J C Nash
cument and transfer knowledge of some older algorithms used by R and by other computational systems. These older codes are mainly in Fortran, but some are in C, with the original implementations possibly in other programming languages. My efforts were prompted by finding some apparent bugs in codes, w

[Rd] Minor glitch in optim()

2018-04-17 Thread J C Nash
Having worked with optim() and related programs for years, it surprised me that I haven't noticed this before, but optim() is inconsistent in how it deals with bounds constraints specified at infinity. Here's an example: # optim-glitch-Ex.R x0<-c(1,2,3,4) fnt <- function(x,

Re: [Rd] Simplify and By Convert Factors To Numeric Values

2017-06-16 Thread Charles C. Berry
On Fri, 16 Jun 2017, Dario Strbenac wrote: Good day, It's not described anywhere in the help page, but tapply and by functions will, by default, convert factors into numeric values. Perhaps this needs to be documented or the behaviour changed. It *is* described in the help page. This re

Re: [Rd] A trap for young players with the lapply() function.

2017-03-27 Thread Charles C. Berry
On Mon, 27 Mar 2017, Rolf Turner wrote: From time to time I get myself into a state of bewilderment when using apply() by calling it with FUN equal to a function which has an "optional" argument named "X". E.g. xxx <- lapply(y,function(x,X){cos(x*X)},X=2*pi) which produces the error mes

Re: [Rd] How do I reliably and efficiently hash a function?

2015-12-10 Thread Charles C. Berry
On Thu, 10 Dec 2015, Konrad Rudolph wrote: I’ve got the following scenario: I need to store information about an R function, and retrieve it at a later point. In other programming languages I’d implement this using a dictionary with the functions as keys. In R, I’d usually use `attr(f, 'some-nam

Re: [Rd] R 3.2.2 - make check and install package hang

2015-10-19 Thread McCully, Dwayne (NIH/NIAMS) [C]
When running the "make check" 14736 14735 0 09:03 pts/100:00:00 /bin/sh -c echo "tools::testInstalledPackages(scope='base', types='examples', srcdir=\".\", commentDonttest=!FALSE)" | LANGUAGE= 14738 14736 0 09:03 pts/100:00:03 /hom

Re: [Rd] R 3.2.2 - make check and install package hang

2015-10-19 Thread McCully, Dwayne (NIH/NIAMS) [C]
day, October 17, 2015 5:44 PM To: McCully, Dwayne (NIH/NIAMS) [C] Cc: r-devel@r-project.org Subject: Re: [Rd] R 3.2.2 - make check and install package hang On Sat, Oct 17, 2015 at 9:04 PM, McCully, Dwayne (NIH/NIAMS) [C] wrote: > Hello Everyone, > > After trying several ways to compile R 3

[Rd] R 3.2.2 - make check and install package hang

2015-10-17 Thread McCully, Dwayne (NIH/NIAMS) [C]
-fpic -g -O2 -c conftest.c -o conftest.o gcc -std=gnu99 -shared -L/home/dmccully/R-3.2.2/lib -L/usr/local/lib64 -o conftest.so conftest.o -L/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre/lib/amd64/server -ljvm -L/home/dmccully/R-3.2.2/lib -lR make[2]: Leaving directory `/tmp/Rjavareconf.l

Re: [Rd] Child thread libR.so

2015-08-25 Thread Ryan C Metzger
efully, you'll notice it says > "Rf_initialize_R" - which is quite critical in this matter. > > Cheers, > Simon > > > On Aug 24, 2015, at 9:18 AM, Ryan C Metzger wrote: > >> I did some poking around with GDB and confirmed that the advice of >> setti

Re: [Rd] Child thread libR.so

2015-08-24 Thread Ryan C Metzger
t main.c:861 #4 0x2b14a98b in Rf_initEmbeddedR (argc=, argv=) at Rembedded.c:63 On Thu, Aug 20, 2015 at 1:21 PM, Ryan C Metzger wrote: > So I'm working on a custom front end to R, in one mode of the front > end I dynamically load libR.so into a child worker thread. I'm ve

[Rd] Child thread libR.so

2015-08-20 Thread Ryan C Metzger
e checking inside of R and I get innumerable errors along the lines of Error: C stack usage 140732526462740 is too close to the limit Digging through this email list (and I also found similar things out on google) I found the following advice from 2009 ---

Re: [Rd] R CMD build failure

2015-07-09 Thread Charles C. Berry
On Thu, 9 Jul 2015, Therneau, Terry M., Ph.D. wrote: I have a local library 'dart' that imports "httr". [snip `R CMD build' can't find dart] Any ideas? There is no mention in the Writing R Extentions manual that it ignores the Rprofile file. Terry, From WRE: 1.3 Checking and buildi

Re: [Rd] Different behavior of model.matrix between R 3.2 and R3.1.1

2015-06-16 Thread Charles C. Berry
anged his logic in the survival package to avoid this issue but he requires generating a larger design matrix then dropping columns. A simple example is below. strat <- function(x) x d <- expand.grid(a=c('a1','a2'), b=c('b1','b2')) d$y <- c(1,3

Re: [Rd] Title case in DESCRIPTION for package where a word is a function namei

2015-04-25 Thread Prof J C Nash (U30A)
a bug, but it is asking for trouble. JN On 15-04-25 07:57 AM, peter dalgaard wrote: > >> On 25 Apr 2015, at 13:11 , Prof J C Nash (U30A) wrote: >> >> Hendrik pointed out it was the parentheses that gave the complaint. >> Single quotes and no parentheses seem to satisfy R

Re: [Rd] Title case in DESCRIPTION for package where a word is a function name

2015-04-25 Thread Prof J C Nash (U30A)
. Is this something CRAN should be thinking about? I would argue greater benefit to users than title case. JN On 15-04-24 06:17 PM, Uwe Ligges wrote: > > > On 24.04.2015 22:44, Ben Bolker wrote: >> Prof J C Nash (U30A uottawa.ca> writes: >> >>> >>> I

[Rd] Title case in DESCRIPTION for package where a word is a function name

2015-04-24 Thread Prof J C Nash (U30A)
I was preparing a fix for a minor glitch in my optimx package and R CMD check gave an error that the title was not in title case. It is A Replacement and Extension of the optim() Function R CMD check suggests the incorrect form A Replacement and Extension of the Optim() Function 'Writing R Exte

Re: [Rd] nls

2015-03-19 Thread Prof J C Nash (U30A)
nls() is using 1) only a Gauss-Newton code which is prone to some glitches 2) approximate derivatives Package nlmrt uses symbolic derivatives for expressions (you have to provide Jacobian code for R functions) and an aggressive Marquardt method to try to reduce the sum of squares. It does return m

Re: [Rd] Requirement for pandoc 1.12.3 in R 3.1.3

2015-03-12 Thread Prof J C Nash (U30A)
gt;>> sessionInfo() >> R version 3.1.3 (2015-03-09) >> Platform: x86_64-pc-linux-gnu (64-bit) >> Running under: Ubuntu 14.04.2 LTS >> >> locale: >> [1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C >> [3] LC_TIME=en_CA.UTF-8LC_COLLATE=en_CA.UTF

[Rd] Requirement for pandoc 1.12.3 in R 3.1.3

2015-03-12 Thread Prof J C Nash (U30A)
Are other developers finding R 3.1.3 problematic because vignette building requires pandoc 1.12.3, while Linux Mint 17 / Ubuntu 14.04 have 1.12.2.1? R 3.1.2 seems to work fine. I'd very much like to avoid having to build as large a Linux package as pandoc, which has given me issues outside of R (i

Re: [Rd] Help finding source of warnings

2015-01-18 Thread Prof J C Nash (U30A)
ink I need to do some more digging to narrow down where this issue is lurking. It may be some local matter, as with the r-recommended links failing. Best, JN On 15-01-18 09:27 AM, Kurt Hornik wrote: Prof J C Nash (U30A) writes: I've been implementing a wrapper to the 2011 Fortran ve

[Rd] Help finding source of warnings

2015-01-18 Thread Prof J C Nash (U30A)
I've been implementing a wrapper to the 2011 Fortran version of L-BFGS-B. In optim(), R uses a C translation of a Fortran version (the version number does not appear to be documented by the original authors). The authors of the original Fortran code have updated it and published the reaso

[Rd] Building R on Windows: mkdir of Rtools creates directories with read-only permissions [WEIRD]

2014-12-15 Thread C
With reference to the issue first reported by Henrik Bengtsson (see https://stat.ethz.ch/pipermail/r-devel/2014-January/068184.html), I would like to report that I am experiencing the very same problem when building R 3.1.2 on Windows platform. Fortunately, the same workaround devised by Henrik wor

[Rd] How can I use R-function in My C++ project ? (using optim)

2014-10-22 Thread Prof J C Nash (U30A)
improvements in the method. JN On 14-10-22 06:00 AM, r-devel-requ...@r-project.org wrote: > Date: Tue, 21 Oct 2014 20:14:03 +0800 (CST) > From: ?? <2012111...@njau.edu.cn> > To: R-devel@r-project.org > Subject: [Rd] How can I use R-function in My C++ project ? >

Re: [Rd] lbfgsb from C/C++

2014-09-08 Thread Prof J C Nash (U30A)
I won't comment on the C/C++ option, as I'm not expert in that. However, R users and developers should know that Nocedal et al. who developed L-BFGS-B released an update to correct a fault in 2011. It was important enough that an ACM TOMS article was used for the announcement.

[Rd] a question about optim.R and optim.c in R

2014-07-08 Thread Prof J C Nash (U30A)
As you dig deeper you will find vmmin.c, cgmin.c and (I think) nmmin.c etc. Those were, as I understand, converted by p2c from my Pascal codes that you can find in the pascal library on netlib.org. These can be run with the Free Pascal compiler. Given how long ago these were developed (>30 years i

Re: [Rd] R CMD check for the R code from vignettes -- thread fraying?

2014-06-02 Thread Prof J C Nash (U30A)
I noted Duncan's comment that an answer had been provided, and went to the archives to find his earlier comment, which I am fairly sure I saw a day or two ago. However, neither May nor June archives show Duncan in the thread except for the msg below (edited for space). Possibly tech failures are ca

Re: [Rd] cat with backspace and newline characters

2013-11-07 Thread Prof J C Nash (U30A)
Over the years, this has been useful to me (not just in R) for many nonlinear optimization tasks. The alternatives often clutter the screen. > On 13-11-06 06:00 AM, r-devel-requ...@r-project.org wrote: > People do sometimes use this pattern for displaying progress (e.g. iteration > counts). >>

Re: [Rd] Byte code compile (not) helpful in R3.0.2 -- Fixed.

2013-11-03 Thread Prof J C Nash (U30A)
Thanks. I should not try adjusting code after some hours of proofreading. Making that change gave a suitable time difference. Best, JN On 13-11-03 03:46 PM, Henrik Bengtsson wrote: > tfor <- cmpfun(tfor) > twhile <- cmpfun(twhile) > > /Henrik > > > On Sun, Nov 3,

Re: [Rd] Byte code compile not helpful in R3.0.2

2013-11-03 Thread Prof J C Nash (U30A)
ooted that partition for quite a while. Here is the for-while test code: # forwhiletime.R library(microbenchmark) require(compiler) tfor <- function(n){ for (i in 1:n) { xx<-exp(sin(cos(as.double(i } xx } twhile <- function(n){ i<-0 while (i On 13-11-03

[Rd] Byte code compile not helpful in R3.0.2

2013-11-03 Thread Prof J C Nash (U30A)
I had a bunch of examples of byte code compiles in something I was writing. Changed to 3.0.2 and the advantage of compiler disappears. I've looked in the NEWS file but do not see anything that suggests that the compile is now built-in. Possibly I've just happened on a bunch of examples where it doe

Re: [Rd] Version of L-BFGS-B used in optim etc

2013-10-10 Thread Prof J C Nash (U30A)
This issue has been known for some time and I've had "why don't you fix this?" queries. However, I'm not one of the R-core folk who could do so, and don't code in C. Moreover, as far as I can tell, the version of L-BFGS-B in R is not one of the standard releases

Re: [Rd] What algorithm is R using to calculate mean?

2013-07-27 Thread Prof J C Nash (U30A)
There is quite a literature on related methods for variance. If anyone is interested, I did some work (and even published the code in the magazine Interface Age in 1981) on some of these. I could probably put together scans of relevant materials, some of which are not easily available. It would

Re: [Rd] R 3.0, Rtools3.0,l Windows7 64-bit, and permission agony

2013-04-21 Thread Prof J C Nash (U30A)
While as a Linux user who has not so far been banished to Winland I have not experienced this problem, it seems to be the type of issue where a "how to", for example, on the R Wiki, would be helpful. Moreover, surely this is a name conflict on different platforms, so possibly a list of these

[Rd] Lessons from LibreOffice project

2013-03-06 Thread Prof J C Nash (U30A)
The message below came to me from the Getting Open Source Logic INto Government list. I'm passing it on to the devel list as the infoworld article may have some ideas of relevance to the R project, mainly concerning build and test issues and tracking changes in the code base. While the LibreOff

Re: [Rd] Speeding up R (was Using multicores in R)

2012-12-04 Thread Prof J C Nash (U30A)
For info, I put a little study I did about the byte code compiler and other speedup approaches (but not multicore) on the Rwiki at http://rwiki.sciviews.org/doku.php?id=tips:rqcasestudy which looks at a specific problem, so may not be relevant to everyone. However, one of my reasons for doing i

Re: [Rd] if(!CRAN()){...} / Repository policies

2012-11-02 Thread U30A J C Nash
If CRAN were a passive repository, the discussion about its policies would not be relevant to this list e.g., SourceForge. However, the development of R and its packages are very intimately connected to the CRAN repository policy. I doubt any of the players in building our current R ecosystem

Re: [Rd] R-devel Digest, Vol 112, Issue 8

2012-06-09 Thread John C Nash
I'll not be able to comment on the use of C like this, but will warn that I wrote the routines that became Nelder-Mead, CG, and BFGS in optim() in the mid 1970s. CG never did as well as I would like, but the other two routines turned out pretty well. However, in nearly 40 years, there are

[Rd] How to set up an object to share data across diverse functions

2012-05-15 Thread John C Nash
In the past 6 months I've been struggling with an issue that has been raised periodically on the lists. This is the need to share information across a group of functions, possibly from different packages. So far I've found solutions that are either quite clumsy or else don't work as have (likely

[Rd] Converting expression to a function

2012-03-18 Thread John C Nash
ing. John Nash # - code block --- rm(list=ls()) # clear workspace Form2resfun <- function(f, p ) { cat("In Form2resfun\n") xx <- all.vars(f) fp <- match(names(p), xx) # Problem in matching the names of params xx2 <- c(xx[fp], xx[-fp]

Re: [Rd] bug in sum() on integer vector

2011-12-14 Thread John C Nash
orderings on sums of large numbers of items. JN On 12/14/2011 03:58 PM, Uwe Ligges wrote: > > > On 14.12.2011 17:19, peter dalgaard wrote: >> >> On Dec 14, 2011, at 16:19 , John C Nash wrote: >> >>> >>> Following this thread, I wondered why nobody

Re: [Rd] bug in sum() on integer vector

2011-12-14 Thread John C Nash
Best, John Nash Here's the system info and small script. >> sessionInfo() > R version 2.14.0 (2011-10-31) > Platform: x86_64-pc-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C > [3] LC_TIME=en_US.utf8LC_COLLA

[Rd] Detecting typo in function argument

2011-12-12 Thread John C Nash
start<-rep(3,6) lo<-rep(2,6) up<-rep(4,6) flb <- function(x) { p <- length(x); sum(c(1, rep(4, p-1)) * (x - c(1, x[-p])^2)^2) } ans<-optim(start, flb, lower=lo, upper=up) ans ans<-optim(start, flb, lower<-lo, upper=up) ans ans1<-optim(start, flb, lower<-lo, upper=up

Re: [Rd] testing on platforms, was Fortran error

2011-11-21 Thread John C Nash
I think the poster is interested in being able to try the build/check on a Mac in the fashion that Winbuilder does. That is, rather than have CRAN do all the platform checks, is there a way to submit a package to be tested for just one platform? It may be useful to have such a facility so packag

Re: [Rd] overly long lines in pdf output of manual from package

2011-11-02 Thread John C Nash
Thanks for quick reply. To help others I'll put in short comments in edited thread. On 11/02/2011 03:54 PM, Prof Brian Ripley wrote: > On Wed, 2 Nov 2011, John C Nash wrote: > >> In re-factoring my optimx package, I'm finding that the pdf output has some >> l

[Rd] overly long lines in pdf output of manual from package

2011-11-02 Thread John C Nash
In re-factoring my optimx package, I'm finding that the pdf output has some lines that are outside the margins (and there are warnings in R CMD check optimx). Clearly I can fix this by editing the tex file that is generated, but the build infrastructure would still get things wrong in automatic

[Rd] list of operations that preserve attributes

2011-10-19 Thread John C Nash
ce to know which operations and special functions do so. rm(list=ls()) m<-matrix(1:4,nrow=2, ncol=2) print(m) attributes(m) attr(m,"check")<-"***" attributes(m) bigm<-10*m str(bigm) bigm1<-diag(c(1,1))%*%m str(bigm1) bigm1<-c(1,2)*m str(bigm1) print(bigm1

[Rd] control list gotcha

2011-09-10 Thread John C Nash
This is mainly a reminder to others developing R packages to be careful not to supply control list items that are not used by the called package. Optimx is a wrapper package that aims to provide a common syntax to a number of existing optimization packages. Recently in extending optimx package I

[Rd] An example of very slow computation

2011-08-17 Thread John C Nash
pare problems like this for efficient and effective solution. The code for nlogL was the "original" from the worker who supplied the problem. Best, John Nash -- cat("mineral-timing.R == benchmark M

Re: [Rd] R-devel Digest, Vol 101, Issue 2

2011-07-02 Thread John C Nash
> From: Mohit Dayal > To: R-devel@r-project.org > Subject: [Rd] AS Algorithms > > I would like to use one of the AS Algorithms that used to be published in > the journal Applied Statistics of the Royal Statistical Society (Series C). > FORTRAN code based on these

[Rd] Default values in control list of function

2011-06-25 Thread Prof. John C Nash
In building a function for a package, I'd like to set the defaults in a control list, e.g., makeg<-function(parameters, eps = 1.0e-7, control=list(showwork=TRUE, rubbish=1.0e+101)){ etc. } This does not provide showwork or rubbish within the function if control() is not fully specified.

Re: [Rd] anyway to get R unevaluated expr independent on arguments

2011-04-07 Thread Zheng, Xin (NIH) [C]
Thank you very much. I learned a lot. Regards, Xin -Original Message- From: Simon Urbanek [mailto:simon.urba...@r-project.org] Sent: Thursday, April 07, 2011 5:42 PM To: Zheng, Xin (NIH) [C] Cc: r-devel@r-project.org Subject: Re: [Rd] anyway to get R unevaluated expr independent on

[Rd] anyway to get R unevaluated expr independent on arguments

2011-04-07 Thread Zheng, Xin (NIH) [C]
Hi there, Suppose the cmd is "a<-3", I can parse the cmd sexp with R_ParseVector and eval it. My question is - is it possible to parse a cmd like "a <- ?", afterwards evaluation will give corresponding result depend on different argument? In other words, '?' is just a placeholder. Thanks. Xin

Re: [Rd] Fixing the HDF5 package: the on.exit mystery

2011-03-18 Thread H C Pumphrey
H C Pumphrey wrote: H C Pumphrey wrote: I'm trying to fix a subtle bug in the hdf5 package. This package provides an interfaces to the HDF5 library and hence allows one to load data into R from files in the HDF5 format. The bug appeared during a period in which R changed but the packag

Re: [Rd] Fixing the HDF5 package: the on.exit mystery

2011-03-16 Thread H C Pumphrey
H C Pumphrey wrote: I'm trying to fix a subtle bug in the hdf5 package. This package provides an interfaces to the HDF5 library and hence allows one to load data into R from files in the HDF5 format. The bug appeared during a period in which R changed but the package did not. [details sn

[Rd] Fixing the HDF5 package: the on.exit mystery

2011-03-04 Thread H C Pumphrey
h the R and C code, stripped of everything except what is needed to show the bug. What is supposed to happen is (*) the user calls R function hdf5load() (*) hdf5load() calls C function do_hdf5load() (*) do_hdf5load() opens the HDF5 file recording its HDF5 file id (fid) (*) do_hdf5load() ca

Re: [Rd] return(); was Suggestions for "good teaching" packages

2011-02-16 Thread Prof. John C Nash
I tend to code with return(), at least in development, because I've once stepped in the cowpad of ans<- list() then attr(ans ) and forgot to do another ans so got only part of what I wanted. Perhaps its just my thinking style, but I agree with some others who suggest that it

Re: [Rd] Google Summer of Code 2011 - credit where it is due

2011-02-15 Thread Prof. John C Nash
In my reminder that GSoC project proposals are requested (to R wiki developers' projects page for GSoC 2011), I mentioned that Dirk Eddelbuettel had acted as leader for the R Foundation activity on GSoC prior to handing the torch to Claudia Beleites and I for this year. I should have mentioned t

[Rd] Google Summer of Code 2011

2011-02-15 Thread Prof. John C Nash
The 2011 Google Summer of Code will soon be open for organizations to submit potential projects for which students may apply (with detailed plans) for funding. We have some proposals in process at http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2011 Note that projects do need to h

[Rd] Competing with one's own work

2010-12-03 Thread Prof. John C Nash
No, this is not about Rcpp, but a comment in that overly long discussion raised a question that has been in my mind for a while. This is that one may have work that is used in R in the base functionality and there are improvements that should be incorporated. For me, this concerns the BFGS, Nel

[Rd] Bug in parseNamespaceFile or switch( , ... ) ?

2010-11-27 Thread Charles C. Berry
) $exportMethods character(0) $exportClassPatterns character(0) $dynlibs character(0) $nativeRoutines list() $S3methods [,1] [,2] [,3] So, it picked up 'export' and ignored the other two lines. Chuck p.s. sessionInfo() R version 2.12.0 (2010-10-15) Platform: i386-appl

Re: [Rd] Request: kronecker to get a sep= argument

2010-11-25 Thread Charles C. Berry
On Thu, 25 Nov 2010, Charles C. Berry wrote: On Thu, 25 Nov 2010, Michael Friendly wrote: kronecker, with make.dimnames=TRUE uses a hardwired sep=":" in the line tmp <- outer(dnx[[i]], dny[[i]], FUN = "paste", sep = ":") For an application in w

Re: [Rd] Request: kronecker to get a sep= argument

2010-11-25 Thread Charles C. Berry
rku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listi

  1   2   >