search for: mailund

Displaying 13 results from an estimated 13 matches for "mailund".

2018 Feb 27
2
Parallel assignments and goto
...nual(1000) 110.215 116.919 ?130.2337 118.7350 ?122.7495 ?255.062 ? 100 ?factorial_tr_automatic_1(1000) 179.897 183.437 ?212.8879 187.8250 ?195.7670 ?979.352 ? 100 ?factorial_tr_automatic_2(1000) 508.353 534.328 ?601.9643 560.7830 ?587.8350 1424.260 ? 100 Cheers On 26 Feb 2018, 21.12 +0100, Thomas Mailund <thomas.mailund at gmail.com>, wrote: > Following up on this attempt of implementing the tail-recursion optimisation ? now that I?ve finally had the chance to look at it again ? I find that non-local return implemented with callCC doesn?t actually incur much overhead once I do it more sens...
2018 Feb 27
0
Parallel assignments and goto
...sign perhaps if you have not done so already. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Feb 27, 2018 at 6:51 AM, Thomas Mailund <thomas.mailund at gmail.com> wrote: > Interestingly, the <<- operator is also a lot faster than using a > namespace explicitly, and only slightly slower than using <- with local > variables, see below. But, surely, both must at some point insert values in > a given envi...
2018 Feb 11
4
Parallel assignments and goto
Hi guys, I am working on some code for automatically translating recursive functions into looping functions to implemented tail-recursion optimisations. See https://github.com/mailund/tailr As a toy-example, consider the factorial function factorial <- function(n, acc = 1) { if (n <= 1) acc else factorial(n - 1, acc * n) } I can automatically translate this into the loop-version factorial_tr_1 <- function (n, acc = 1) { repeat { if (n <= 1)...
2018 Feb 11
0
Parallel assignments and goto
> On Feb 11, 2018, at 7:48 AM, Thomas Mailund <thomas.mailund at gmail.com> wrote: > > Hi guys, > > I am working on some code for automatically translating recursive functions into looping functions to implemented tail-recursion optimisations. See https://github.com/mailund/tailr > > As a toy-example, consider the fa...
2017 Aug 04
0
define a list with names as variables
Hello Thomas, Ulrik, thanks for your suggestions. Giovanni On Fri, Aug 4, 2017 at 12:13 PM, Thomas Mailund <thomas.mailund at gmail.com> wrote: > Do you mean like this? > > >> f <- function(foo, bar) { > + result <- list(bar) > + names(result) <- foo > + result > + } > >> (x <- f("hello", "world")) > $hello > [1] &quot...
2018 Feb 26
0
Parallel assignments and goto
...e ?7990648 is too close to the limit > llength_tr(make_llist(1000)) [1] 1000 I should be able to make the function go faster if I had a faster way of handling the variable assignments, but inside ?with?, I?m not sure how to do that? Any suggestions? Cheers On 11 Feb 2018, 16.48 +0100, Thomas Mailund <thomas.mailund at gmail.com>, wrote: > Hi guys, > > I am working on some code for automatically translating recursive functions into looping functions to implemented tail-recursion optimisations. See https://github.com/mailund/tailr > > As a toy-example, consider the factorial...
2017 Aug 04
1
define a list with names as variables
Do you mean like this? > f <- function(foo, bar) { + result <- list(bar) + names(result) <- foo + result + } > (x <- f("hello", "world")) $hello [1] "world" > names(x) [1] "hello" -- Thomas Mailund On 4 August 2017 at 12.08.28, Giovanni Gherdovich (g.gherdovich at gmail.com) wrote: Hello, I'm having troubles defining a list where names are variables (of type character). Like this, which gives "foo" instead of "world" (the way I meant it is that "world" is...
2018 Feb 14
0
Parallel assignments and goto
...444 2139.329 100 b Best, John ----------------------------- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada Web: socialsciences.mcmaster.ca/jfox/ > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Thomas > Mailund > Sent: Sunday, February 11, 2018 10:49 AM > To: r-help at r-project.org > Subject: [R] Parallel assignments and goto > > Hi guys, > > I am working on some code for automatically translating recursive functions into > looping functions to implemented tail-recursion optimis...
2017 Aug 04
4
define a list with names as variables
Hello, I'm having troubles defining a list where names are variables (of type character). Like this, which gives "foo" instead of "world" (the way I meant it is that "world" is the value of the variable foo). Any hint? > f <- function(foo, bar) { list(foo = bar) } > x <- f("hello", "world") > names(x) [1] "foo"
2018 Mar 13
0
Learning advanced R
See Hadley's advanced R along Thomas Mailund's books. I haven't gone through them carefully but they both seem (from what I've looked at ) to be the best ones for that. Mentions of others are appreciated. On Tue, Mar 13, 2018 at 5:26 PM, Nik Tuzov <ntuzov at beacon.partek.com> wrote: > > Hello: > > Could yo...
2018 Mar 13
5
Learning advanced R
Hello: Could you please suggest the best way to become an "advanced" R programmer. I went through "R for dummies" by de Vries and Meys and I can see two ways to proceed: 1) Get a more advanced textbook. E.g. could you recommend Gentleman, "R for Bioinformatics"? 2) Because textbooks are limited and become obsolete fast, I can focus on learning state-of-the-art
2020 Oct 16
2
Need help in R code of the functional data .
Hello, Please, I want to know how the functional data are defined in programming code R. If possible an illustrative example of code can help me to understand better. Yours sincerely. [[alternative HTML version deleted]]
2009 Jul 03
1
Plot Fonts in Windows vs Mac OSX
I have been plotting the same charts using png on a Windows machine and on a Mac OSX and the quality of the resulting images, particularly in relation to the fonts, look far superior in the plots produced on the Mac. Is there any way I can enhance the quality of the plots produced on the Windows machine? I have also tried using win.metafile on the Windows machine and the quality looks the same as