Re: [Rd] New grDevices::hcl.colors()

2019-04-02 Thread Abs Spurdle
Oops. I didn't notice that you have references on your blog. The more references the better, I guess. [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] New grDevices::hcl.colors()

2019-04-02 Thread Abs Spurdle
Hi Z I think supporting HCL color spaces more, is a *very* good idea. However, I doubt many R users, understand the motivation for HCL color spaces. I've reproduced Ross Ihaka's notes on color, on my personal website: https://sites.google.com/site/spurdlea/exts/ihaka_r_stats_787_10_color.pdf (Th

Re: [Rd] default for 'signif.stars'

2019-03-29 Thread Abs Spurdle
> If we were to invent lm() now, how would we solve the problem of big P? > I don't think we would use stars. Assuming that this is a good idea in the first place, here's a simple solution, in the context of backward selection. One could sort the terms, from lowest p-value to highest p-value. If

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-28 Thread Abs Spurdle
I know I said that I had no further comments on object oriented semantics. However, I found a contradiction in the R documentation. Gabriel Becker wrote: > So, there are implicit classes, but *only when the data object is NOT an "R object" In the R Language Definition: > The R specific function

Re: [Rd] default for 'signif.stars'

2019-03-27 Thread Abs Spurdle
I read through the editorial. This is the one of the most mega-ultra-super-biased articles I've ever read. e.g. The authors encourage Baysian methods, and literally encourage subjective approaches. However, there's only one reference to robust methods and one reference to nonparametric methods, bo

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-27 Thread Abs Spurdle
> the prison made by ancient design choices That prison of ancient design choices isn't so bad. I have no further comments on object oriented semantics. However, I'm planning to follow the following design pattern. If I set the class of an object, I will append the new class to the existing clas

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

2019-03-26 Thread Abs Spurdle
> so instead of hitting utils:::head.function, it hits utils:::head.default, which uses [ on the argument, causing the error. I've thought about this some more. And I still think that this is a bug. If a generic has a default method, then that default method should be guaranteed to work. Or at le

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-26 Thread Abs Spurdle
> you had seemed to be presenting it as something new in 3.5.3. I would be surprised if the behavior doesn't go all the way back to whenever head.function was added. My bad. I'm just surprised I've never noticed these problems before. > S3 classes have no formal definitions at all > I'm not sure

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-26 Thread Abs Spurdle
If I can merge this thread with the one I started yesterday... > "If the object does not have a class attribute, it has an implicit class..." > which I take to mean that if an object does have a class attribute it does not also have an implicit class. > I think this is reasonable behavior. Conside

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

2019-03-25 Thread Abs Spurdle
(Using R 3.5.3). I found bugs in head() and tail(). The following works: > f = function () 1 > head (f) 1 function () 2 1 However, the following does not: > class (f) = "f" > head (f) Error in x[seq_len(n)] : object of type 'closure' is not subsettable [[alternative HTML version delet

Re: [Rd] Discrepancy between is.list() and is(x, "list")

2019-03-25 Thread Abs Spurdle
> I have noticed a discrepancy between is.list() and is(x, “list”) There's a similar problem with inherits(). On R 3.5.3: > f = function () 1 > class (f) = "f" > is.function (f) [1] TRUE > inherits (f, "function") [1] FALSE I didn't check what happens with: > class (f) = c ("f", "function") H

[Rd] Could we make filled.contour() more suitable for PDF viewers?

2019-03-15 Thread Abs Spurdle
Note that I sent this to r-devel, yesterday. However, it didn't appear on the mailing list. So, I'm resending it. Today, I plotted the following: > filled.contour (,,z, color.palette=terrain.colors) It looked OK, in R. However, when I created a PDF document, the plot (and other similar plots) had

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

2019-03-14 Thread Abs Spurdle
Martin Maechler Wrote: and we should've tried harder to keep things purely functional (R remaining as closely as possible a "functional language") This is diverging from the original post. However, isn't R a multiparadigm programming language (by design)? [[alternative HTML version delete

Re: [Rd] Should CRAN accept packages with non-R code that transcompiles into R code?

2019-03-05 Thread Abs Spurdle
On Tue, Mar 5, 2019 at 12:52 PM Gabriel Becker wrote: > I have thought about and have (somewhere "up near the top" of my todo > list) prototyping a preprocessor for R, and I have relevant code that emits > (transpiles, in a way) structured comments into S4 code in > https://github.com/gmbecker/S4

Re: [Rd] Should CRAN accept packages with non-R code that transcompiles into R code?

2019-03-05 Thread Abs Spurdle
On Tue, Mar 5, 2019 at 12:49 PM jan Vitek wrote: > Everything is possible. One can compile C++ into JavaScript. > > But why? > > I would like to support Java style syntax for class definitions. (Then it could transcompile into either S3 or S4). And possibly change some other things while I'm at

[Rd] Should CRAN accept packages with non-R code that transcompiles into R code?

2019-03-04 Thread Abs Spurdle
It may be possible to create an R-like programming language that transcompiles into R code (or otherwise constructs R objects and calls R functions). I'm not sure whether it would pass R check or not, I will probably try... But the bigger question is: Should CRAN accept packages written in such a

Re: [Rd] Runnable R packages

2019-02-08 Thread Abs Spurdle
I'm not sure whether GCC is in Rtools or not. I will check on Monday. However, that's not the main point. In Rtools, there's nothing like the following: R CMD Rpkg2exe -o my_r_application.exe my_r_package or R CMD Rpkg2exe -o my_r_application.exe my_r_package_0.1.0.tar.gz Which would convert a

Re: [Rd] Runnable R packages

2019-02-02 Thread Abs Spurdle
Creating an .exe file isn't necessarily difficult. The main problems are that you have to write and compile the C (or other) files. Otherwise, the complexity depends on the level of Inter Process Communication that's required. Simply starting R with some initial conditions, is easy. Even if you wa

Re: [Rd] Runnable R packages

2019-02-01 Thread Abs Spurdle
Further to my previous post, it would be possible to create an .exe file, say: my_r_application.exe That starts R, loads your R package(s), calls the R function of your choice and does whatever else you want. However, I don't think that it would add much value. But feel free to correct me if you

Re: [Rd] Runnable R packages

2019-02-01 Thread Abs Spurdle
This is possibly the most redundant discussion I've ever seen on the R mailing lists. In the original post: > 2) It provides no way to deal with dependencies on other packages > 3) It provides no way to "run" an application provided as an R package Both completely false statements. > recently b

[Rd] R-devel from 1997 Good Read

2018-11-26 Thread Abs Spurdle
hi all This is possibly a bit off topic. However, the mailing list is quiet at the moment so I thought I would mention it. Recently, I had a look at R-devel (R-alpha?) from 1997. And it's very informative and very cool. I'm planning to go through it more carefully when I get some more free time.

[Rd] Rd2pdf ignores tabs but not trailing spaces

2018-11-21 Thread Abs Spurdle
hi all R CMD Rd2pdf ignores tabs in the usage section. However, I just discovered that it doesn't ignore trailing spaces (before lines). I'm assuming that the same thing happens when the online man pages are produced. I didn't check what happens in the examples section. I think it would be better

Re: [Rd] An update on the vctrs package

2018-11-08 Thread Abs Spurdle
Kia Ora > vec_size(data.frame(x = 1:10)) > #> [1] 10 > vec_size(array(dim = c(10, 4, 1))) > #> [1] 10 I think that "length" (in the R way) or "size" should incorporate the number of columns (or other dimension information). How about: > vec_npoints (x) > vec_nrecords (x) > vec_nobs (x) Dependin

[Rd] CRAN Feature Request: install.data (task.view="Cluster")

2018-10-28 Thread Abs Spurdle
Hi I wish that it was possible to install datasets from R packages without installing the rest of the packages. Mainly for testing purposes or writing examples. Assuming that there's a top level data directory (which there isn't): > install.data (package=c ("s20x", "R330") ) Which would install

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

2018-10-15 Thread Abs Spurdle
Kia Ora > Although I'm not sure what problem it would solve... Given that you asked, I was interested in writing a multiple assignment function as a replacement function, so something like: massign (x, y, z) = construct.some list () Obviously, that's not possible. Probably the best example I ca

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

2018-10-14 Thread Abs Spurdle
Kia Ora Let's say we have: "myreplacementfunction<-" = function (..., value) { call = sys.call () print (as.list (call) ) 0 } Then we call: x = 0 myreplacementfunction (x, y, z) = 0 It will return: [[1]] `myreplacementfunction<-` [[2]] `*tmp*` [[3]] y [[4]] z $value T

Re: [Rd] WishList: Remove Generic Arguments

2018-08-10 Thread Abs Spurdle
ds two arguments, why not name them, so R can complain when a user calls it with just one? We can apply that principle to the methods rather than the generic. On Fri, Aug 10, 2018 at 10:20 AM, Duncan Murdoch wrote: > On 09/08/2018 5:45 PM, Abs Spurdle wrote: > >> I apologiz

[Rd] WishList: Remove Generic Arguments

2018-08-09 Thread Abs Spurdle
I apologize if this issue has been raised before. I really like object oriented S3 programming. However, there's one feature of object oriented S3 programming that I don't like. Generic functions can have arguments other than dots. Lets say you have an R package with something like: print.myfun

[Rd] R's Identity

2018-07-17 Thread Abs Spurdle
According to R's website, R should be cited as "R: A Language and Environment for Statistical Computing". According to the home page, "R is a free environment for statistical computing and graphics". I think the term "Language" is important and should be included. But not everyone using R uses it f