Displaying 3 results from an estimated 3 matches for "cfun2".
Did you mean:
cfunc
2017 Jun 14
2
[WISH / PATCH] possibility to split string literals across multiple lines
...going to be
significant. Take following example:
atestfun <- function(x){
y <- paste0("a very long",
"string for testing")
grep(x, y)
}
atestfun2 <- function(x){
y <- "a very long
string for testing"
grep(x,y)
}
cfun <- cmpfun(atestfun)
cfun2 <- cmpfun(atestfun2)
require(rbenchmark)
benchmark(atestfun("a"),
atestfun2("a"),
cfun("a"),
cfun2("a"),
replications = 100000)
Which gives after 100,000 replications:
test replications elapsed relativ...
2017 Jun 14
0
[WISH / PATCH] possibility to split string literals across multiple lines
...fun <- function(x){
> y <- paste0("a very long",
> "string for testing")
> grep(x, y)
> }
> atestfun2 <- function(x){
> y <- "a very long
> string for testing"
> grep(x,y)
> }
> cfun <- cmpfun(atestfun)
> cfun2 <- cmpfun(atestfun2)
>
> require(rbenchmark)
> benchmark(atestfun("a"),
> atestfun2("a"),
> cfun("a"),
> cfun2("a"),
> replications = 100000)
>
> Which gives after 100,000 replications:
>...
2017 Jun 14
4
[WISH / PATCH] possibility to split string literals across multiple lines
On Wed, 14 Jun 2017 06:12:09 -0500, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 14/06/2017 5:58 AM, Andreas Kersting wrote:
> > Hi,
> >
> > I would really like to have a way to split long string literals across
> > multiple lines in R.
>
> I don't understand why you require the string to be a literal. Why not
> construct the long