Re: [Rd] [External] Re: Segfault when parsing UTF-8 text with srcrefs

2024-05-30 Thread Barry Rowlingson
I get an R error and no segfault: > parse(textConnection(text), srcfile = srcfile) Error in parse(textConnection(text), srcfile = srcfile) : test.r:1:1: unexpected $end 1: × ^ This is R 4.3.0, so maybe the bug has been introduced since then... Version and system info: > version

Re: [Rd] [External] Re: R for the US Air Force

2024-05-18 Thread Barry Rowlingson
> that's not strictly true though is it? Anyone can form a company and > supply R, as long as everyone complies with the license. You are also free > to download R from public services and do it without any corporate > wrappings and trappings, which is what Posit (ex-RStudio) do, right? > > [corre

Re: [Rd] [External] Re: R for the US Air Force

2024-05-18 Thread Barry Rowlingson
R is not a product that is provided by a company or any vendor that can be > procured through a vendor e.g. something on a GSA schedule. > > that's not strictly true though is it? Anyone can form a company and supply R, as long as everyone complies with the license. You are also free to download R

[Rd] R6 "classname" and generator name

2024-03-11 Thread Barry Rowlingson
I'm writing some code that does a bit of introspection of R6 classes and am wondering about the "classname" parameter. Its the first parameter to the "R6Class" class generator generator function, and the few examples I've looked at on CRAN set it the same as the name of the generator function, for

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

2024-03-04 Thread Barry Rowlingson
It seems like you want to use -> and <- as arrows with different meanings to "A gets the value of B" in your package, as a means of writing expressions in your package language. Another possibility would be to use different symbols instead of the problematic -> and <-, for example you could use <.

Re: [Rd] [External] Re: zapsmall(x) for scalar x

2023-12-17 Thread Barry Rowlingson
I think what's been missed is that zapsmall works relative to the absolute largest value in the vector. Hence if there's only one item in the vector, it is the largest, so its not zapped. The function's raison d'etre isn't to replace absolutely small values, but small values relative to the largest

Re: [Rd] [External] subfolders in the R folder

2023-03-28 Thread Barry Rowlingson
The "good reason" is all the tooling in R doesn't work with subfolders and would have to be rewritten. All the package check and build stuff. And that's assuming you don't want to change the basic flat package structure - for example to allow something like `library(foo)` to attach a package and `l

[Rd] attach "warning" is a message

2021-08-09 Thread Barry Rowlingson
If I mask something via `attach`: > d = data.frame(x=1:10) > x=1 > attach(d) The following object is masked _by_ .GlobalEnv: x > I get that message. The documentation for `attach` uses the phrase "warnings", although the message isn't coming from `warning()`: warn.conflicts: logical. If ‘T

Re: [Rd] Making R CMD nicer

2019-07-01 Thread Barry Rowlingson
If you write a lot of R code to run as command line scripts then look at Dirk E's "littler": $ r --help Usage: r [options] [-|file] Launch GNU R to execute the R commands supplied in the specified file, or from stdin if '-' is used. Suitable for so-called shebang '#!/'-line scripts. Options:

Re: [Rd] bugs in head() and tail()

2019-03-28 Thread Barry Rowlingson
On Wed, Mar 27, 2019 at 1:52 AM Abs Spurdle wrote: > > In the case of head.default(), it assumes that the object is a vector, or > something similar. > No it doesn't. It assumes (ultimately) that x[seq_len(n)] is the correct way to generate a "head" of something. Which is reasonable. That's depe

Re: [Rd] Runnable R packages

2019-02-02 Thread Barry Rowlingson
I don't think anyone denies that you *could* make an EXE to do all that. The discussion is on *how easy* it should be to create a single file that contains an initial "main" function plus a set of bundled code (potentially as a package) and which when run will install its package code (which is con

Re: [Rd] Runnable R packages

2019-02-01 Thread Barry Rowlingson
) > > > On Thu, Jan 31, 2019 at 4:38 PM Barry Rowlingson > wrote: >> >> >> >> On Thu, Jan 31, 2019 at 3:14 PM David Lindelof wrote: >>> >>> >>> In summary, I'm convinced R would benefit from something similar to Java's >>

Re: [Rd] Runnable R packages

2019-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2019 at 3:14 PM David Lindelof wrote: > > In summary, I'm convinced R would benefit from something similar to Java's > `Main-Class` header or Python's `__main__()` function. A new R CMD command > would take a package, install its dependencies, and run its "main" > function. I j

Re: [Rd] sys.call() inside replacement functions incorrectly returns *tmp*

2018-10-16 Thread Barry Rowlingson
On Tue, Oct 16, 2018 at 12:03 AM Abs Spurdle wrote: > Probably the best example I can think of is converting cartesian > coordinates to polar coordinates. > Then we might have something like (note, untested, written in my email): > cart2polar = function (x, y) > list (theta=atan (y / x), r=sq

Re: [Rd] diag(-1) produces weird result

2018-09-17 Thread Barry Rowlingson
On Mon, Sep 17, 2018 at 5:22 PM, Gábor Csárdi wrote: > I would say it is a mis-feature. If the 'x' argument of diag() is a > vector of length 1, then it creates an identity matrix of that size, > instead of creating a 1x1 matrix with the given value: > > ❯ diag(3) > [,1] [,2] [,3] > [1,]

Re: [Rd] Possible bug: R --slave --interactive stdin echo on Linux when stdin is a fifo

2018-07-26 Thread Barry Rowlingson
On Thu, Jul 26, 2018 at 12:22 AM, Gábor Csárdi wrote: > I am trying to control a background R session, connected via a fifo / > named pipe. Is the fifo significant here? If I read the same R code from a file via `<` I get the input echoed (R 3.4.4, Ubuntu). Barry __

Re: [Rd] base::mean not consistent about NA/NaN

2018-07-03 Thread Barry Rowlingson
platform (since compilers may re-order computations). > For mean, NA / NaN could be handled in loop in summary.c. I assume that > performance penalty of fix is the reason why this inconsistency still > exists. > Jan > > On Mon, Jul 2, 2018 at 8:28 PM, Barry Rowlingson > wrote:

Re: [Rd] base::mean not consistent about NA/NaN

2018-07-02 Thread Barry Rowlingson
And for a starker example of this (documented) inconsistency, arithmetic addition is not commutative: > NA + NaN [1] NA > NaN + NA [1] NaN On Mon, Jul 2, 2018 at 5:32 PM, Duncan Murdoch wrote: > On 02/07/2018 11:25 AM, Jan Gorecki wrote: >> Hi, >> base::mean is not consistent in terms of h

Re: [Rd] Why R should never move to git

2018-01-31 Thread Barry Rowlingson
On Tue, Jan 30, 2018 at 11:07 PM, Suzen, Mehmet wrote: > This might be off topic, but if R-core development ever moves to git, > I think it would make sense to have its own git service hosted by a > university, rather than using > github or gitlab. It is possible via https://gogs.io/ project. > >

[Rd] R on OpenHub

2017-04-25 Thread Barry Rowlingson
Does anyone want to manage the record for R on OpenHub? OpenHub is a site that records metrics for open source projects. At some point a record for R was created: https://www.openhub.net/p/r_project but there's no manager listed. OpenHub says: """ * Only someone who works on the project and

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

2017-03-27 Thread Barry Rowlingson
On Mon, Mar 27, 2017 at 1:17 AM, Rolf Turner wrote: > > Is there any way to trap/detect the use of an optional argument called > "X" and thereby issue a more perspicuous error message? > > This would be helpful to those users who, like myself, are bears of very > little brain. > > Failing that (it

Re: [Rd] Source code of early S versions

2016-02-29 Thread Barry Rowlingson
On Mon, Feb 29, 2016 at 6:17 PM, John Chambers wrote: > The Wikipedia statement may be a bit misleading. > > S was never open source. Source versions would only have been available with > a nondisclosure agreement, and relatively few copies would have been > distributed in source. There was a

[Rd] Source code of early S versions

2016-02-29 Thread Barry Rowlingson
According to Wikipedia: "In 1980 the first version of S was distributed outside Bell Laboratories and in 1981 source versions were made available." but I've been unable to locate any version of S online. Does anyone have a copy, somewhere, rusting away on an old hard disk or slowly flaking off a

Re: [Rd] Multi-line comments in R

2015-08-20 Thread Barry Rowlingson
On Wed, Aug 19, 2015 at 5:16 AM, Nathan Esau wrote: > I was wondering why the decision was made long ago to never implement > multi-line comments in R. I feel there are several argument to be made for > why the R language should have multi-line comments. > > 1. Many programming languages (includin

Re: [Rd] how useful could be a fast and embedded database for the R community?

2014-12-25 Thread Barry Rowlingson
On Wed, Dec 24, 2014 at 7:37 PM, joanv wrote: > I'm sorry, but I cannot show code. Then can you stop using the word "release". To release means to let something go, preferably out into the wild. I can't even find a binary "release" on that site. Call it the first "version" if you want, but not "

Re: [Rd] SUGGESTION: Force install.packages() to use ASCII encoding when parse():ing code?

2014-12-12 Thread Barry Rowlingson
On Fri, Dec 12, 2014 at 12:34 PM, Jan Kim wrote: > it's just a matter of time that people get characters into their code that > are different but indistinguishable in the font they use (I've seen this > with \H{o} rather than a \"{o}), and mega-personmonths are wasted puzzling > over tracking dow

Re: [Rd] Intel Fortran compiler returns a -1 TRUE value

2014-10-03 Thread Barry Rowlingson
On Thu, Oct 2, 2014 at 4:25 PM, Ei-ji Nakama wrote: > Hello > > > The value generated by Fortran's .TRUE. evaluates as "truthy" -- as in > > all(z[[1]]) -- but is neither equal to nor identical to TRUE. Its numeric > > conversion to -1 is most unusual, every other system I've tried converts > to

Re: [Rd] Intel Fortran compiler returns a -1 TRUE value

2014-10-01 Thread Barry Rowlingson
On Tue, Sep 30, 2014 at 6:25 PM, William Dunlap wrote: > In S+ and S it was valid to pass logicals to .Fortran, where they got > mapped into the > appropriate bit pattern. (The trouble was that 'appropriate' was > compiled into the program - > so you were locked into our compiler vendor's choice

Re: [Rd] Intel Fortran compiler returns a -1 TRUE value

2014-09-30 Thread Barry Rowlingson
On Tue, Sep 30, 2014 at 12:53 PM, Duncan Murdoch wrote: > > This appears to be user error. According to Writing R Extensions, the > Fortran type corresponding to R logical is INTEGER, not LOGICAL. > Oh yes, a very old and long-standing user error. I assume the CRAN checks don't check this. Has

[Rd] Intel Fortran compiler returns a -1 TRUE value

2014-09-30 Thread Barry Rowlingson
I have access to a cluster on which I have been supplied with R 3.1.0 which appears to have been built using the intel compiler tools. The following minimal Fortran file: subroutine truth(lind) logical lind lind = .TRUE. end Compiles thusly: arcadia> R CMD SHLIB truth.f

Re: [Rd] Re R CMD check checking in development version of R

2014-08-28 Thread Barry Rowlingson
And if, like me, you always forget which of Depends and Imports is the one you are supposed to be using, the mnemonic device is "DEPends is DEPrecated[1], IMPorts is IMPortant." Barry [1] kinda. On Thu, Aug 28, 2014 at 4:33 AM, Gavin Simpson wrote: > On Aug 27, 2014 5:24 PM, "Hadley Wickham"

Re: [Rd] Why R-project source code is not on Github

2014-08-21 Thread Barry Rowlingson
On Thu, Aug 21, 2014 at 11:40 AM, Marc Schwartz wrote: > Your suggestion to move to Github is perhaps based upon a false premise, that > the R community at large has the ability to directly post code/patches to the > official distribution. That's not the false premise here. This is: "one sim

Re: [Rd] Listing Packages in Depends or Imports

2014-06-27 Thread Barry Rowlingson
On Fri, Jun 27, 2014 at 3:00 AM, Dario Strbenac wrote: > Hello, > > The Writing R Extensions manual gives confusing advice. Compare > > Packages listed in imports or importFrom directives in the NAMESPACE file > should almost always be in ‘Imports’ and not ‘Depends’. > > with > > Almost always pa

Re: [Rd] setting environmental variable inside R function to call C function

2014-06-03 Thread Barry Rowlingson
What does c_fun look like? Here's mine: #include #include void c_fun(){ printf("TMP is %s\n", getenv("TMP")); } and I then do this at the shell prompt: R CMD SHLIB c_fun.c and this at the R prompt: dyn.load("c_fun.so") wrapper() and I get: > wrapper() [1] "A" TMP is A list() Is that

Re: [Rd] precedence (was 'historical NA question')

2014-05-08 Thread Barry Rowlingson
On Wed, May 7, 2014 at 11:00 PM, Duncan Murdoch wrote: > > > Is there a language where "- 2^2" gives a different answer than "-2^2"? > (Substitute ** or any other exponentiation operator for ^ if you > like.) This is important, because I'd like to avoid ever attempting any > important calculati

Re: [Rd] RFC: API design of package "modules"

2014-04-29 Thread Barry Rowlingson
On Mon, Apr 28, 2014 at 2:55 PM, Konrad Rudolph < konrad.rudolph+r-de...@gmail.com> wrote: > > So this is my question: what do other people think? Which is the most > useful and least confusing alternative from the users’ perspective? > The most useful is alternative is "write packages". The

Re: [Rd] Constructor/extractor.

2014-03-04 Thread Barry Rowlingson
On Tue, Mar 4, 2014 at 1:47 AM, Rolf Turner wrote: > > > Questions: > == > > > (2) Even if there are no such functions, is there anything intrinsically > *wrong* with having a function possessing this somewhat schizophrenic > nature? Is it likely to cause confusion, induce syntactical mi

Re: [Rd] contrib.url in non-interactive mode

2014-02-14 Thread Barry Rowlingson
On Fri, Feb 14, 2014 at 10:54 AM, Prof Brian Ripley wrote: > > It is up to you to set a default mirror: we have little idea where you > live (and it may not be where your email address suggests). Geolocation > of mirrors had been mooted but not implemented (and in a corporate > setting is not 100

Re: [Rd] cat with backspace and newline characters

2013-11-07 Thread Barry Rowlingson
On Thu, Nov 7, 2013 at 8:28 AM, Jari Oksanen wrote: > > On 07/11/2013, at 09:35 AM, Renaud Gaujoux wrote: > >> I agree that the handling of \b is not that strange, once one agrees >> on what \b actually means, i.e. "go back one character" and not >> "delete previous character". It means, to parap

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread Barry Rowlingson
On Mon, Aug 12, 2013 at 6:06 PM, Justin Talbot wrote: > In the recommended package rpart (version 4.1-1), the file rpartpl.R > contains the following line: > > return(x = x[!erase], y = y[!erase]) > > AFAIK, returning multiple values like this is not valid R. Is that > correct? I can't seem to mak

Re: [Rd] proposal for new FAQ entry?

2013-08-05 Thread Barry Rowlingson
On Mon, Aug 5, 2013 at 2:53 PM, peter dalgaard wrote: >> Does this seem FAQ-worthy? Should I e-mail the FAQ maintainer and suggest >> it? > > Sure, as long as we never change the numbering of FAQ 7.31... > Not even to FAQ 7.31+1e-15 ? Barry __ R-dev

Re: [Rd] [R] Internalization of help pages

2013-08-04 Thread Barry Rowlingson
[I've tried to move this back to R-devel, which I think is what Brian Ripley tried and nobody followed...] On Sun, Aug 4, 2013 at 4:15 PM, John Kane wrote: > I tried it in French and there a few hiccups but it's not too bad. > > Personally I'd like to see the help tranlated into English too.l > >

Re: [Rd] Problem with distributing data in package.

2013-07-20 Thread Barry Rowlingson
On Fri, Jul 19, 2013 at 10:33 AM, Simon Knapp wrote: > Hi List, > > I am building a package for a client to help them create and perform > analyses against netcdf files which contain 'a temporal stack' of > grids. > > For my examples and test cases, I create an example dataset in code > (as this i

Re: [Rd] should the text for RIGHT_ASSIGN be -> in getParseData()?

2013-07-05 Thread Barry Rowlingson
On Fri, Jul 5, 2013 at 7:24 PM, peter dalgaard wrote: > I have used in with multi-line input, occasionally, though. As in > > replicate(1, { >ysim <- rbinom(length(p), n, p) >glm(cbind(ysim, n - ysim) ~ x, binomial)$deviance > }) > > ... and then you realize that you probably don't wa

Re: [Rd] should the text for RIGHT_ASSIGN be -> in getParseData()?

2013-07-05 Thread Barry Rowlingson
On Fri, Jul 5, 2013 at 12:57 PM, Duncan Murdoch wrote: > R itself doesn't make use of the text column, it's for display of code > by highlighters etc. So if anyone does assume text is a function name, > it's their bug, not ours. In fact, the bug is already there, because > there is actually one

Re: [Rd] locking down R

2013-05-20 Thread Barry Rowlingson
On Sun, May 19, 2013 at 7:16 PM, Ben Bolker wrote: > >The workstations have no access to external networks, > nor to external media (thumb drives etc.) [information transfer to the > outside world is via shared drives that can be accessed by > administrators with network access]. > > * I stipulate

Re: [Rd] Subset of a 'table' divided by a 'table' is a 'table', but printed by 'print.default'

2013-04-30 Thread Barry Rowlingson
On Tue, Apr 30, 2013 at 10:49 AM, Duncan Murdoch wrote: > So it looks like the bug is in the implementation of "/". Either it > should drop the class, or it should set the object bit. > > The difference in printing between auto-printing and explicit printing > may be worth addressing, but really

[Rd] R CMD INSTALL fail deletes earlier versions

2013-04-18 Thread Barry Rowlingson
Just tried to update devtools for R 2.15.3, and after an error about it only being available for 3.0.0, I found my previously good-enough devtools had disappeared. Here's how it happens: $ R --quiet > require(devtools) Loading required package: devtools pac> packageDescription("devtools")$Version

Re: [Rd] Snippets from other packages/ License

2013-03-15 Thread Barry Rowlingson
On Thu, Mar 14, 2013 at 8:34 AM, Felix Schönbrodt wrote: > Hello, > > I want to use a function from another package (which is GPL>=3), about 20 > lines of code, in my own package. > I somewhat hesitate to depend on the entire package just for this single > function, but of course I want to credi

Re: [Rd] Why cannot `Rscript -e` accept an empty line?

2013-03-09 Thread Barry Rowlingson
On Sat, Mar 9, 2013 at 9:32 PM, Yihui Xie wrote: > See the example below (under Ubuntu): > > $ Rscript -e '1' -e '2' > [1] 1 > [1] 2 > $ Rscript -e '1' -e '' -e '2' > ERROR: option '-e' requires an argument > $ uname -a > Linux xie 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 > x86

Re: [Rd] CRAN task views: markdown? better .CSS?

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 4:28 PM, Yihui Xie wrote: > See this page by Barry Rowlingson: > https://stat.ethz.ch/pipermail/r-devel/2012-February/063338.html Sadly that page is just the lipstick on a pig. Underneath, its still a pig. > Given that CRAN maintainers do not even use JavaScri

Re: [Rd] SystemRequirements’ field

2012-12-12 Thread Barry Rowlingson
I see three references to systemRequirements in Writing R Extensions. The one you list in your last email, this one: "If your package requires one of these interpreters or an extension then this should be declared in the ‘SystemRequirements’ field of its DESCRIPTION file." [for listing interpreter

Re: [Rd] chown, chgrp?

2012-08-15 Thread Barry Rowlingson
On Wed, Aug 15, 2012 at 2:47 PM, Simon Urbanek wrote: > > ... and moreover with the increasing adoption of ACL on unix and > non-existence of uid/gid on Windows this is more an archaic curiosity so I > don't think it makes sense to add it at this point. > It does however raise the question, "

Re: [Rd] chown, chgrp?

2012-08-15 Thread Barry Rowlingson
On Tue, Aug 14, 2012 at 9:30 PM, Hadley Wickham wrote: > Hi all, > > Is there an R wrapper for chown/chgrp (a la Sys.chmod)? I couldn't > find one with a few minutes of searching, but it seems like a curious > omission. A recursive grep of an R-dev source tree I had lying around couldn't find o

Re: [Rd] csv version of data in an R object

2012-04-21 Thread Barry Rowlingson
On Sat, Apr 21, 2012 at 3:28 PM, Max Kuhn wrote: > For a package, I need to write a csv version of a data set to an R > object. Right now, I use: > >    out <- capture.output( >                          write.table(x, >                                      sep = ",", >                            

Re: [Rd] Jazzing up the Task Views index page

2012-02-27 Thread Barry Rowlingson
On Wed, Feb 22, 2012 at 3:34 PM, Joshua Wiley wrote: > Barry, is this a test/example only or would you plan on keeping > something like that on your site even if it is not adopted for cran > task views?  If it is not adopted elsewhere and you are willing to > maintain it, I would like to link to

[Rd] Jazzing up the Task Views index page

2012-02-21 Thread Barry Rowlingson
A little while ago here we had a short discussion about Task Views - I think ignited by someone saying 'how many times do I have to say "have you read the Optimisation Task View?"?' and I poured some fuel on that fire by saying "Task Views" was a stupid name. Anyway, I did say that Task Views were

Re: [Rd] Task views (was: Re: [R] Schwefel Function Optimization)

2012-02-12 Thread Barry Rowlingson
On Sat, Feb 11, 2012 at 5:55 PM, Patrick Burns wrote: > Now it could be that people are not trying > very hard to solve their own problems, but > to be fair it is a pretty gruelling process > to find the Task Views. > > May I suggest that there be a "Task Views" item > on the left sidebar of the

Re: [Rd] Saving nothing with save()

2011-12-22 Thread Barry Rowlingson
On Tue, Dec 20, 2011 at 6:40 PM, Martin Maechler wrote: > I've now changed the patch to only warn and only in the case > when the 'list' argument is missing(.). > > Martin Thanks Martin, that sounds great. This came about from a question on Stack Overflow, where a user was loading an R Data f

Re: [Rd] secure password token management method in R

2011-12-18 Thread Barry Rowlingson
On Sun, Dec 18, 2011 at 1:28 AM, Paul Gilbert wrote: > One way this is often done is to have this information in a file that only > the owner can read. For example, mysql uses a file .my.cnf (in Windows it > may have a different name). The code then just reads the information from > the file. To g

[Rd] Saving nothing with save()

2011-12-17 Thread Barry Rowlingson
Scenario: Here I am working away in R. I've got results that prove global warming is anthropogenic and also the solution for producing limitless carbon-neutral energy from nuclear fusion. Its been a good day. So, I want to save my work. I don't want to overwrite my current .RData, so I save it to

Re: [Rd] secure password token management method in R

2011-12-14 Thread Barry Rowlingson
On Wed, Dec 14, 2011 at 9:54 PM, Ni Wang wrote: > hi, r developers, I am now working on a R function/package to handling > online request with username and token/password. > > For security reasons, it's not so safe to store the username & token in > persistent variables, since they'll be saved to

Re: [Rd] bug in rank(), order(), is.unsorted() on character vector

2011-12-07 Thread Barry Rowlingson
2011/12/7 Joris Meys : > @Barry : regardless of whether '_' comes before or after '1' , it > should be consistent. Adding an 'a' shouldn't shift '_' from before > '1' to between '1' and '2', that's clearly an error. The help files > are not stating anything about that. That's an assumption. The h

Re: [Rd] bug in rank(), order(), is.unsorted() on character vector

2011-12-07 Thread Barry Rowlingson
2011/12/7 Hervé Pagès : > rank(xa) See help(Comparison), specifically: "Beware of making _any_ assumptions about the collation order" followed by "Collation of non-letters (spaces, punctuation signs, hyphens, fractions and so on) is even more problematic." Barry _

Re: [Rd] how to make a true binary package?

2011-10-11 Thread Barry Rowlingson
On Tue, Oct 11, 2011 at 6:09 PM, A Zege wrote: > OK, gentlemen, i agree with you in general. I was not talking about a general > purpose, general use package that one prepares for CRAN. I am sure you are > familiar professionally or can imagine situations where you need to > demonstrate a solution

Re: [Rd] Link between Qt GUI and R

2011-09-12 Thread Barry Rowlingson
On Mon, Sep 12, 2011 at 2:00 AM, typhoong wrote: > hi everyone, thanks for all the tips. > > > Barry, can you tell me why you think PyQT is by far the best way? I said that conditional on you knowing or wanting to learn Python. Python interacts with Qt in much the same way as C++ interacts with

Re: [Rd] Link between Qt GUI and R

2011-09-11 Thread Barry Rowlingson
On Sun, Sep 11, 2011 at 11:30 AM, typhoong wrote: > hi, > > i want to build a Qt front-end GUI which communicates with R, and i am not > sure what i should use for the interface. There seems to be many ways: > R.dll, Rinside, Rcpp, RQt, Rtools... . what is the best way? please advice. > Another w

Re: [Rd] Please explain your workflow from R code -> package -> R code -> package

2011-09-10 Thread Barry Rowlingson
On Fri, Sep 9, 2011 at 7:41 PM, Hadley Wickham wrote: > It's not the cool kids who are doing this, it's the lazy kids ;) laziness being one of the three virtues of a programmer. The other two being hubris and something else I don't have time to look up at the moment. library(fortunes) fodder:

Re: [Rd] non-R package development

2011-05-21 Thread Barry Rowlingson
On Sat, May 21, 2011 at 2:04 AM, Spencer Graves wrote: >      I routinely use the "R CMD check", etc., process with Subversion for > version control and collaborative development.  I've looked for similar > capabilities for other languages, so far without success. Python has a similar package b

Re: [Rd] fortan common block

2011-05-08 Thread Barry Rowlingson
On Fri, May 6, 2011 at 4:04 PM, Paul Gilbert wrote: > Is it possible in R to call a fortran routine that sets variables in a common > block and expect the values to persist when a call is made from R to a second > routine that uses the common block? > > If not (as I suspect),  is it possible to

Re: [Rd] Recursive objects

2011-05-04 Thread Barry Rowlingson
On Wed, May 4, 2011 at 2:21 PM, Hadley Wickham wrote: > Any hints as to what to search for? For recursive objects, search for recursive objects. Barry __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Wish there were a "strict mode" for R interpreter. What

2011-04-11 Thread Barry Rowlingson
On Sat, Apr 9, 2011 at 10:08 PM, Ted Harding wrote: > I'm with Duncan on this one! On the other hand, I can understand the > issues that Paul's students might encounter. > > I think the right thing to so is to introduce the students to the > basics of scoping, early in the process of learning R.

Re: [Rd] How to disable R's crash prompt

2011-03-09 Thread Barry Rowlingson
On Tue, Mar 8, 2011 at 10:41 PM, wrote: > That did the trick.  Thank you soo much Simon! But really you *should* fix the segfault. Either you know why it happens, in which case you should spot it before it happens and do something sensible, or you don't know why it happens, in which case it

Re: [Rd] How to disable R's crash prompt

2011-03-08 Thread Barry Rowlingson
On Tue, Mar 8, 2011 at 2:24 PM, wrote: > Dear R devel, > > I have a C++ app that calls into embedded R to perform some analytic > calculations.  When my app encounters a segmentation fault, R always prints > the following crash prompt and asks me to enter an action: > > > *** caught segfault **

[Rd] Easily switchable factor levels

2011-02-23 Thread Barry Rowlingson
I've recently been working with some California county-level data. The counties can be referred to as either FIPS codes, eg F060102, friendly names such as "Del Norte County", names without 'County' on the end, names with 'CA' on the end ("Del Norte County, CA"). Different data sets use slightly di

Re: [Rd] R vs. C

2011-01-17 Thread Barry Rowlingson
On Mon, Jan 17, 2011 at 6:57 PM, David Henderson wrote: > I think we're also forgetting something, namely testing.  If you write your > routine in C, you have placed additional burden upon yourself to test your C > code through unit tests, etc.  If you write your code in R, you still need the > un

[Rd] stats, pics etc on CRAN

2010-11-01 Thread Barry Rowlingson
Does anyone have some nice ways of showing what's on CRAN? A time-series of the number of packages? A clustered graph of packages by keyword? I'm just after a more impressive way of saying "there's 2600 packages on CRAN" than saying that. Counts of lines of R and C/Fortran code would be interesti

Re: [Rd] Check for updates under Windows (Was: a reliable way to check the latest version of R on CRAN?)

2010-09-21 Thread Barry Rowlingson
On Sat, Sep 18, 2010 at 11:17 PM, Yihui Xie wrote: > Dear R developers, > > I asked this question in r-help list but have not got a definite > solution yet, and I think it might be more appropriate to ask > developers or CRAN maintainers directly. Many software packages often > have a menu item li

Re: [Rd] Non identical numerical results from R code vs C/C++ code?

2010-09-10 Thread Barry Rowlingson
On Fri, Sep 10, 2010 at 11:46 AM, Renaud Gaujoux wrote: > Hi, > > suppose you have two versions of the same algorithm: one in pure R, the > other one in C/C++ called via .Call(). > Assuming there is no bug in the implementations (i.e. they both do the same > thing), is there any well known reason

[Rd] An ls error which is not an error...

2010-09-09 Thread Barry Rowlingson
If I try ls with an unquoted version of something in my search list, I get an error message but the ls completes successfully. For example: > attach("x.RData") > ls(file:x.RData) Error in try(name) : object 'x.RData' not found [1] "x" which seems to be because ls first does: nameValue <- try(

Re: [Rd] No RTFM?

2010-08-24 Thread Barry Rowlingson
On Tue, Aug 24, 2010 at 3:28 PM, Michael Dewey wrote: > The thing I find most rude on the list is not the occasional abrupt postings > by people who are obviously having a bad day but the number of fairly long > exchanges which end unresolved as the OP never bothers to post a conclusion > and we

Re: [Rd] small syntax suggestion

2010-08-24 Thread Barry Rowlingson
On Tue, Aug 24, 2010 at 4:18 PM, Ted Harding wrote: > So, on those grounds, I doubt its wisdom (and would prefer > giving the advice to bracket things, as in "x<(-3)". It's > a potential syntactic trap, but it's only one of many which > can be avoided in similar ways, and I think it's better to >

Re: [Rd] small syntax suggestion

2010-08-23 Thread Barry Rowlingson
On Mon, Aug 23, 2010 at 6:06 PM, Davor Cubranic wrote: > The students are trying to *compare* to a negative number, and trip on R's > parsing of "<-". They could use '=' for assignment all they want (which I > thought is being discouraged as a code style these days, BTW), and they'll > still r

Re: [Rd] small syntax suggestion

2010-08-23 Thread Barry Rowlingson
On Sun, Aug 22, 2010 at 4:33 PM, ivo welch wrote: > Dear R development Team:  I really know very little, so you may ignore > this post.  I have found that my students often make the mistake of > mixing up comparisons and assignments with negative numbers: > >  if (x<-3) do_something; > > I parenth

Re: [Rd] How do you make a formal "feature" request?

2010-08-21 Thread Barry Rowlingson
On Sat, Aug 21, 2010 at 4:41 PM, Donald Winston wrote: > Who decides what features are in R and how they are implemented? If there is > someone here who has that authority I have this request: > > A report() function analogous to the plot() function that makes it easy to > generate a report from

Re: [Rd] Defining a method that behaves like '$'?

2010-07-10 Thread Barry Rowlingson
On Fri, Jul 9, 2010 at 2:10 PM, Renaud Gaujoux wrote: > I do not want to access the slot itself but its content: a:toto would be > a...@slot1[['toto']]. > The thing is that I would like to have two different methods: '$' (that I > already have) and another one to define, ideally that behaves like

Re: [Rd] require( "foo (>= 2.1)" )

2010-05-31 Thread Barry Rowlingson
On Sun, May 30, 2010 at 5:50 PM, Romain Francois wrote: > Hi, > > Sure. I could and I would provide a patch. Since this is more of a "nice to > have", I wanted to first find out whether others would find it useful, and > also if such a patch would have chances to get accepted by one of R-core > me

[Rd] automatically loading packages

2010-05-04 Thread Barry Rowlingson
If I start an R session with a previously saved .RData that has S4 objects in it, there are times when the associated package loads when I use (or mention) the object, and times when it doesn't. For example: > dim(casesIn) NULL > library(sp) > dim(casesIn) [1] 726 22 - because casesIn is a

Re: [Rd] Difference Linux / Windows

2010-04-01 Thread Barry Rowlingson
On Thu, Apr 1, 2010 at 4:37 PM, Simon Urbanek wrote: > > On Mar 31, 2010, at 18:38 , Seth Falcon wrote: > >> On 3/31/10 1:12 PM, Christophe Genolini wrote: >>> >>> Hi the list, >>> I am writing a package that happen to not be compatible with linux >>> because I did not know that the function "save

Re: [Rd] Is it valid to do x == Inf?

2010-04-01 Thread Barry Rowlingson
On Thu, Apr 1, 2010 at 11:03 AM, Henrik Bengtsson wrote: > Hi, > > I found in a bit of code the following test for infinity: > >  if (x == Inf) ... > > Is that valid, or should it be (as I always thought): > >  if (is.infinite(x)) ...? > > Does it depend on whether 'x' is float or integer? > > My

Re: [Rd] CRAN nearly down?

2010-03-06 Thread Barry Rowlingson
On Fri, Mar 5, 2010 at 5:40 PM, Paul Gilbert wrote: > Is CRAN having trouble or is it just me?  (The web interface is very > slow and install.packages() is timing out and giving me "service not > available"). Have you ever tried: http://downforeveryoneorjustme.com/cran.r-project.org - I though

Re: [Rd] Improved Nelder-Mead algorithm - a potential replacement for optim's Nelder-Mead

2010-03-06 Thread Barry Rowlingson
On Fri, Mar 5, 2010 at 8:26 PM, Ravi Varadhan wrote: > Hi, > > I have written an R translation of C.T. Kelley's Matlab version of the > Nelder-Mead algorithm.  This algorithm is discussed in detail in his book > "Iterative methods for optimization" (SIAM 1999, Chapter 8).  I have tested > this

Re: [Rd] R logo as SVG ?

2010-02-21 Thread Barry Rowlingson
On Sat, Feb 20, 2010 at 7:56 PM, Jens Elkner wrote: > Yes and scaling would be too resource consuming as well (very bad for > menus, etc.). I think, the most challenging part here is all the > [different type of] shadows. So does anybody know, who made  the > original pixel based image? If not ra

Re: [Rd] Problem with ?Syntax

2010-02-20 Thread Barry Rowlingson
On Sat, Feb 20, 2010 at 9:52 AM, Gabor Grothendieck wrote: > In ?Syntax [ is given as higher priority than $ but BOD$demand[3] > seems to be the same as (BOD$demand)[3] contrary to [ being higher > priority. > >> BOD$demand[3] > [1] 19 >> (BOD$demand)[3] > [1] 19 > > What is the rule being used he

Re: [Rd] R Startup configuration file

2010-02-12 Thread Barry Rowlingson
On Fri, Feb 12, 2010 at 2:22 PM, Simon Urbanek wrote: > This is getting OT, but, please, no XML. It's entirely useless in this > context IMHO (as it is in others, but that's another story) and we already > have reliable support for storing R objects (more than one in fact). Despite > the fact tha

Re: [Rd] R Startup configuration file

2010-02-12 Thread Barry Rowlingson
On Wed, Feb 10, 2010 at 3:06 PM, Barry Rowlingson wrote: >  But I agree that writing a saveable options package is the first step > - then making that a default in R is the second so people don't have > to edit profiles and R packages and applications can expect an API for &

Re: [Rd] filenames with special characters in the R/ directory of a package?

2010-02-12 Thread Barry Rowlingson
On Fri, Feb 12, 2010 at 5:35 AM, blue sky wrote: > According to R-exts.pdf (page 3): > For maximal portability filenames should only > contain only ASCII characters not excluded already (that is > A-Za-z0-9._!#$%&+,;=...@^(){}’[] > > I have some files with special characters like '[' and '%' e.g.

Re: [Rd] R Startup configuration file

2010-02-10 Thread Barry Rowlingson
On Wed, Feb 10, 2010 at 11:44 AM, Duncan Murdoch wrote: > When I read the ?Startup man page, I find it is too complicated already; I > don't want to add another kind of file to read.  (Would we have  separate > user and site versions of this new file?  When would it be handled?) > > However, we c

[Rd] R Startup configuration file

2010-02-10 Thread Barry Rowlingson
Currently when R starts up it can be configured by a file of environment variable specifications and a file of R code. This makes programmatic modification of startup configuration tricky. Case in point: I start R, do install.packages("foo"), and up pops the 'choose a CRAN mirror' dialog. I'd like

Re: [Rd] Package Directory Hierarchy: Recursive inclusion of *.R possible?

2010-02-04 Thread Barry Rowlingson
On Wed, Feb 3, 2010 at 10:40 AM, Johannes Graumann wrote: > Hello, > > I would like to organize the "R" directory in my home-grown package into > sub-directories, but "R CMD --build" doesn't seem to find *.R files below > the actual source directory. Is there any way around that? This was discuss

  1   2   >