Using vector and array indexes with zeros works for extraction and
for replacement in the case of a vector, list and matrix but for
a data frame only extraction works. All lines below give
the expected answer except the last line which gives the error message
shown.
v <- 1:5
L <- as.list(v)
s the base of R now has pipes.
On Tue, Sep 17, 2024 at 12:14 PM Martin Maechler
wrote:
>
> >>>>> Gabor Grothendieck
> >>>>> on Mon, 16 Sep 2024 11:21:55 -0400 writes:
>
> > Suppose we have `dat` shown below and we want to find the the `y` val
Suppose we have `dat` shown below and we want to find the the `y` value
corresponding to the last value in `x` equal to the corresponding component
of `seek` and we wish to return an output the same length as `seek` using
`findInterval` to perform the search. This returns the correct result:
d
reas (the wisdom of this escapes me)
> >
> >> data.frame(head(airquality), y=data.frame(x=rnorm(6),z=rnorm(6)))
> >Ozone Solar.R Wind Temp Month Dayy.x y.z
> > 141 190 7.4 67 5 1 -0.9250228 0.46483406
> > 236 118 8.0
when x is a matrix."
>
> further differentiating the behavior of row() and col() as more specific
> implementations in the 2-dimensional case.
>
> To my read then, the difference in behavior appears to be intentional and
> expected.
>
> Regards,
>
> Marc Schwart
In the following nrow provides the expected result but row gives an
error. I would have thought that they would both work or both fail.
aa <- array(dim = 5:3)
nrow(aa)
## [1] 5
row(aa)
## Error in row(aa) : a matrix-like object is required as argument to 'row'
# this does work:
s
.z
> 141 190 7.4 67 5 1 -0.9250228 0.46483406
> 236 118 8.0 72 5 2 -0.5035793 0.28822668
> ...
>
> On the whole, I think that transform was never designed (nor documented) to
> take data frame arguments, so caveat emptor.
>
> - Peter
>
One oddity in transform that I recently noticed. It seems that to include
a one-column data frame in the arguments one must name it even though the
name is ignored. If the data frame has more than one column then it must
also be named but in that case it is not ignored and the names are made up o
ies
>
> I think I'd consider using windows() for a head.ts() and tail.ts(),
> but in any case, I am sympathetic adding such methods to "base R"'s
> utils package.
>
>
> Martin
>
> > Best Wishes, Spencer Graves
>
>
>
zoo overcomes many of the limitations of ts:
library(zoo)
as.ts(head(as.zoo(presidents)))
## Qtr1 Qtr2 Qtr3 Qtr4
## 1945 NA 87 82 75
## 1946 63 50
xts also works here.
On Sun, Jun 9, 2024 at 12:04 PM Spencer Graves
wrote:
>
> Hello, All:
>
>
> The 'head' and
Would it be good enough to pass it as a formula? Using your definition of foo
foo(~ A -> result)
## result <- ~A
foo(~ result <- A)
## ~result <- A
On Fri, Mar 1, 2024 at 4:18 AM Dmitri Popavenko
wrote:
>
> Hi everyone,
>
> I am aware this is a parser issue, but is there any possibilit
args1 args2 args3 combined
##
## 1 %s plus %s equals %s 1 1 2 1 plus 1 equals 2
## 2 %s plus %s equals %s 2 2 4 2 plus 2 equals 4
## 3 %s plus %s equals %s 3 3 6 3 plus 3 equals 6
On Fri, Dec 29, 2023 at 1:45 PM Gabor Grothendieck
wro
If the question is how to accomplish this as opposed to how to use eval
then we can do it without eval like this provided we can assume that words
contains three %s .
library(dplyr)
library(tidyr)
df <- tibble(words=c("%s plus %s equals %s"),args=c("1,1,2","2,2,4","3,3,6"))
df |>
sepa
Seems like a leaky abstraction. If both representations are supposed
to be outwardly the same to the user then they should act the same and
if not then identical should not be TRUE.
On Tue, Nov 14, 2023 at 9:56 AM Deepayan Sarkar
wrote:
>
> On Tue, 14 Nov 2023 at 09:41, Gabor Grothe
Also why should that difference result in different behavior?
On Tue, Nov 14, 2023 at 9:38 AM Gabor Grothendieck
wrote:
>
> In that case identical should be FALSE but it is TRUE
>
> identical(a1, a2)
> ## [1] TRUE
>
>
> On Tue, Nov 14, 2023 at 8:58 AM Deepayan Sarka
t; [1] 3
>
> Best,
> -Deepayan
>
> On Tue, 14 Nov 2023 at 08:23, Gabor Grothendieck
> wrote:
> >
> > What is going on here? In the lines ending in the inputs and outputs
> > are identical yet one gives a warning and the other does not.
> >
> > a
What is going on here? In the lines ending in the inputs and outputs
are identical yet one gives a warning and the other does not.
a1 <- `rownames<-`(anscombe[1:3, ], NULL)
a2 <- anscombe[1:3, ]
ix <- 5:8
# input arguments to are identical in both cases
identical(stack(a1[ix]), sta
The gsubfn package can do that.
library(gsubfn)
# swap a and b without explicitly creating a temporary
a <- 1; b <- 2
list[a,b] <- list(b,a)
# get eigenvectors and eigenvalues
list[eval, evec] <- eigen(cbind(1,1:3,3:1))
# get today's month, day, year
requir
ES = FALSE)
> }
>
> gsub("^..", toupper, c("abc", "xyz"))
> [1] "ABc" "XYz"
>
> But this isn't a simple change to replace() anymore, and I may just be
> spending too much time tinkering with Julia.
>
> Steve
>
> On
This could be extended to sub and gsub as well which gsubfn in the
gusbfn package already does:
library(gsubfn)
gsubfn("^..", toupper, c("abc", "xyz"))
## [1] "ABc" "XYz"
On Fri, Mar 3, 2023 at 7:22 PM Pavel Krivitsky wrote:
>
> Dear All,
>
> Currently, list= in base::replace(x, list, valu
lm works with difftime objects but then if you try to get the summary
it fails with an error:
fit <- lm(as.difftime(Time, units = "mins") ~ demand, BOD)
summary(fit)
## Error in Ops.difftime((f - mean(f)), 2) :
## '^' not defined for "difftime" objects
A number of other lm methods also f
Is there some way to avoid the automatic generation of hello* files in
package.skeleton?
I found that the following does it on Windows but then it does not
create an R directory which I still
want and also it gives warnings which I don't want.
package.skeleton(code_files = "NUL")
--
Statistics &
fit1, ~ -1)
> anova(fit0, fit1)
>
> -pd
>
> > On 26 Dec 2022, at 13:49 , Gabor Grothendieck
> > wrote:
> >
> > Suppose we want to perform a paired test using the sleep data frame
> > with anova in R. Then this works and gives the same p value as
> >
Suppose we want to perform a paired test using the sleep data frame
with anova in R. Then this works and gives the same p value as
t.test(extra ~ group, sleep, paired = TRUE, var.equal = TRUE)
ones <- rep(1, 10)
anova(lm(diff(extra, 10) ~ ones + 0, sleep)
This gives output but does not giv
When trying to transform names in a pipeline one can do the following
where for this example we are making names upper case.
BOD |> (\(x) setNames(x, toupper(names(x()
but that seems a bit ugly and verbose.
1. One possibility is to enhance setNames to allow a function as a
second argument.
Because aggregate.formula has a formula argument but the generic
has an x argument neither of these work:
mtcars |> aggregate(x = mpg ~ cyl, FUN = mean)
mtcars |> aggregate(formula = mpg ~ cyl, FUN = mean)
This does work:
mtcars |> stats:::aggregate.formula(formula = mpg ~ cyl, FUN = mean)
In a recent SO post this came up (changed example to simplify it
here). It seems that `test` still has the value sin.
test <- sin
environment(test)$test <- cos
test(0)
## [1] 0
It appears to be related to the double use of `test` in `$<-` since if
we break it up it works as expected:
t guaranteed should be
> flagged by the language at compile time (or when interpreted) and refuse to
> go on.
>
> All I can say with computer languages and adding ever more features,
> with greater power comes greater responsibility and often greater
> confusion.
>
>
>
a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
>
> ///
>
> <https://www.inbo.be>
>
>
> Op vr 27 aug. 2021 om 17:18 schreef Gabor Grothendieck <
> ggrothendi...@gmail.com>:
>
>> Are there any guarantees
Are there any guarantees of whether x will equal 1 or 2 after this is run?
(x <- 1) * (x <- 2)
## [1] 2
x
## [1] 2
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com
__
R-devel@r-p
This gives an error bit if the first gsub line is commented out then there is no
error even though it is equivalent code.
L <- c("Variable:id", "Length:112630 ")
L |>
gsub(pattern = " ", replacement = "") |>
gsub(pattern = " ", replacement = "") |>
textConnection() |>
read
At the very least it would be nice if there were a function that displays all
the locations/paths currently being used in R.
On Sat, Jul 24, 2021 at 6:15 PM Steve Haroz wrote:
>
> Hello,
>
> I'd like to propose moving the default library install location on Windows
> from:
> %USERPROFILE%/Docume
e_0.20-44
>
> which includes S3 method dispatch tables:
>
> > methods(as.ts)
> [1] as.ts.default* as.ts.zoo* as.ts.zooreg*
> see '?methods' for accessing help and source code
>
> so the behavior is as expected.
>
> Cheers,
> Simon
>
>
> > On 25/06/2021
If we start up a vanilla session of R with no packages loaded and
type the single line of code below as the first line entered then
we get the output shown below. The NA in the output and the length
of 7 indicate that as.ts dispatched as.ts.zoo since as.ts.default
would have resulted in a length o
These also work in this particular case although not in general and the Call:
line in the output differs:
mtcars |> subset(cyl == 4) |> with(lm(mpg ~ disp))
mtcars |> with(lm(mpg ~ disp, subset = cyl == 4))
On Sat, Jun 19, 2021 at 7:23 AM Erez Shomron wrote:
>
> Hello,
>
>
> While playing ar
One thing about varying is that reshape ignores the names on the
varying list and makes you
specify them all over again even though it could know what they are.
Note that we had to
specify that names(varying) is the v.names.
DF <- structure(list(A1 = 10L, A2 = 5L, B1 = 11L, B2 = 5L, C1 = 21L,
Currently replicate used within sapply within a function can fail
because it gets the environment for its second argument, which is
currently hard coded to be the parent frame, wrong. See this link for
a full example of how it goes wrong and how it could be made to work
if it were possible to pass
These are documented but still seem like serious deficiencies:
> f <- function(x, y) x + 10*y
> 3 |> x => f(x, x)
Error in f(x, x) : pipe placeholder may only appear once
> 3 |> x => f(1+x, 1)
Error in f(1 + x, 1) :
pipe placeholder must only appear as a top-level argument in the RHS call
Also
On Wed, Dec 9, 2020 at 12:36 PM Gabriel Becker wrote:
> I mean, I think the bizarro pipe was a pretty clever piece of work. I was
> impressed by what John did there, but I don't really know what you're
> suggesting here. As you say, the bizarro pipe works now without any changes
> and you're we
On Wed, Dec 9, 2020 at 10:08 AM Duncan Murdoch wrote:
>
> You might be interested in this blog post by Michael Barrowman:
>
> https://michaelbarrowman.co.uk/post/the-new-base-pipe/
>
> He does some timing comparisons, and the current R-devel implementations
> of |> and \() do quite well.
It does
On Wed, Dec 9, 2020 at 4:03 AM Timothy Goodman wrote:
> But the bigger issue happens when I want to re-run just *part* of the
> pipeline.
Insert one of the following into the pipeline. It does not require that you
edit any lines. It only involves inserting a line.
print %>%
{ str(.); . } %
On Mon, Dec 7, 2020 at 9:09 AM Gabor Grothendieck
wrote:
>
> On Sat, Dec 5, 2020 at 1:19 PM wrote:
> > Let's get some experience
>
> Here is my last SO post using dplyr rewritten to use R 4.1 devel. Seems
It occurred to me it would also be interesting to show this examp
On Mon, Dec 7, 2020 at 12:34 PM wrote:
> I don't disagree in principle, but the reality is users want shortcuts
> and as a result various packages, in particular tidyverse, have been
> providing them. Mostly based on formulas, mostly with significant
> issues since formulas weren't designed for th
Duncan Murdoch:
> I agree it's all about call expressions, but they aren't all being
> treated equally:
>
> x |> f(...)
>
> expands to f(x, ...), while
>
> x |> `function`(...)
>
> expands to `function`(...)(x). This is an exception to the rule for
Yes, this is the problem. It is trying to handl
On Mon, Dec 7, 2020 at 2:02 PM Kevin Ushey wrote:
>
> IMHO the use of anonymous functions is a very clean solution to the
> placeholder problem, and the shorthand lambda syntax makes it much
> more ergonomic to use. Pipe implementations that crawl the RHS for
> usages of `.` are going to be more e
On Mon, Dec 7, 2020 at 12:54 PM Duncan Murdoch wrote:
> An advantage of the current implementation is that it's simple and easy
> to understand. Once you make it a user-modifiable binary operator,
> things will go kind of nuts.
>
> For example, I doubt if there are many users of magrittr's pipe w
It is easier to understand a function if you can see the entire
function body at once on a page or screen and excessive verbosity
interferes with that.
On Mon, Dec 7, 2020 at 12:04 PM Therneau, Terry M., Ph.D. via R-devel
wrote:
>
> “The shorthand form \(x) x + 1 is parsed as function(x) x + 1. I
On Mon, Dec 7, 2020 at 10:11 AM wrote:
> Or, keeping dplyr but with R-devel pipe and function shorthand:
>
> DF <- "myfile.csv" %>%
> readLines() |>
> \(.) gsub(r'{(c\(.*?\)|integer\(0\))}', r'{"\1"}', .) |>
> \(.) read.csv(text = .) |>
> mutate(across(2:3, \(col) lapply(col, \(x)
One could examine how magrittr works as a reference implementation if
there is a question on how something should function. It's in
widespread use and seems to work well.
On Mon, Dec 7, 2020 at 10:20 AM Deepayan Sarkar
wrote:
>
> On Mon, Dec 7, 2020 at 6:53 PM Gabor Grothendie
On Sat, Dec 5, 2020 at 1:19 PM wrote:
> Let's get some experience
Here is my last SO post using dplyr rewritten to use R 4.1 devel. Seems
not too bad. Was able to work around the placeholder for gsub by specifying
the arg names and used \(...)... elsewhere. This does not address the
inconsiste
On Mon, Dec 7, 2020 at 5:41 AM Duncan Murdoch wrote:
> I agree it's all about call expressions, but they aren't all being
> treated equally:
>
> x |> f(...)
>
> expands to f(x, ...), while
>
> x |> `function`(...)
>
> expands to `function`(...)(x). This is an exception to the rule for
> other cal
This is really irrelevant.
On Sun, Dec 6, 2020 at 9:23 PM Gabriel Becker wrote:
>
> Hi Gabor,
>
> On Sun, Dec 6, 2020 at 3:22 PM Gabor Grothendieck
> wrote:
>>
>> I understand very well that it is implemented at the syntax level;
>> however, in any case the im
t is a
matter of breaking
the way R works as a functional language with first class functions.
On Sun, Dec 6, 2020 at 4:06 PM Gabriel Becker wrote:
>
> Hi Gabor,
>
> On Sun, Dec 6, 2020 at 12:52 PM Gabor Grothendieck
> wrote:
>>
>> I think the real issue here is that
using it can change that
inconsistency which seems serious to me and needs to
be addressed even if it complicates the implementation
since it drives to the heart of what R is.
On Sat, Dec 5, 2020 at 1:08 PM Gabor Grothendieck
wrote:
>
> The construct utils::head is not that common but bare
Why is that ambiguous? It works in magrittr.
> library(magrittr)
> 1 %>% `+`()
[1] 1
On Sun, Dec 6, 2020 at 1:09 PM wrote:
>
> On Sun, 6 Dec 2020, Gabor Grothendieck wrote:
>
> > The following gives an error.
> >
> > 1 |> `+`(2)
> > ## Error: f
The following gives an error.
1 |> `+`(2)
## Error: function '+' is not supported in RHS call of a pipe
1 |> `+`()
## Error: function '+' is not supported in RHS call of a pipe
but this does work:
1 |> (`+`)(2)
## [1] 3
1 |> (`+`)()
## [1] 1
The error message suggests
I meant on the R devel download page. (I was just installing Rtools40
on another computer.)
On Sun, Dec 6, 2020 at 10:27 AM Gabor Grothendieck
wrote:
>
> I tried it from another computer and it did work. Is there some way
> of installing R devel using the analog of the R --vanilla fla
to what occurs. I don't see anything documenting flags
on the Rtools40 page.
On Sat, Dec 5, 2020 at 9:52 AM Gabor Grothendieck
wrote:
>
> I clicked on the download link at
> https://cran.r-project.org/bin/windows/base/rdevel.html
> and then opened the downloaded file which starts
For example, this works:
library(zoo)
as.Date(0)
## [1] "1970-01-01"
On Sun, Dec 6, 2020 at 7:10 AM Achim Zeileis wrote:
>
> On Sun, 6 Dec 2020, Jan Gorecki wrote:
>
> > Hello all,
> >
> > I would like to propose to change the default value for "origin"
> > argument in as.POSIXct.numeric m
The construct utils::head is not that common but bare functions are
very common and to make it harder to use the common case so that
the uncommon case is slightly easier is not desirable.
Also it is trivial to write this which does work:
mtcars %>% (utils::head)
On Sat, Dec 5, 2020 at 11:59 AM
encountered this.
On Sat, Dec 5, 2020 at 9:13 AM Jeroen Ooms wrote:
>
> On Sat, Dec 5, 2020 at 3:00 PM Gabor Grothendieck
> wrote:
> >
> > When I try to install r-devel on Windows all I get is this. No other
> > files. This also occurred yesterday as well.
>
>
When I try to install r-devel on Windows all I get is this. No other
files. This also occurred yesterday as well.
Directory of C:\Program Files\R\R-test
12/05/2020 08:56 AM .
12/05/2020 08:56 AM ..
12/05/2020 08:56 AM11,503 unins000.dat
12/05/2020 08:5
A Female 89 19
## 3 B Male 353 207
## 4 B Female 178
## ... etc ...
Fri, May 15, 2020 at 12:25 PM Martin Maechler
wrote:
>
> >>>>> Gabor Grothendieck
> >>>>> on Thu, 14 May 2020 06:56:06 -0400 writes
If you are looking at ftable could you also consider adding
a way to convert an ftable into a usable data.frame such as
the ftable2df function defined here:
https://stackoverflow.com/questions/11141406/reshaping-an-array-to-data-frame/11143126#11143126
and there is an example of using it here:
One can use as.data.frame(as.matrix(tab)) to avoid calling
as.data.frame.matrix directly
(although I find I do use as.data.frame.matrix anyways sometimes even
though it is generally
better to call the generic.).
Also note that the various as.data.frame methods do not address the examples
in the
iple purposes.
library(sqldf)
mytime <- 4
fn$sqldf("select * from BOD where Time < $mytime")
On Mon, Apr 20, 2020 at 9:32 AM Sokol Serguei wrote:
>
> Le 19/04/2020 à 20:46, Gabor Grothendieck a écrit :
> > You can get pretty close to that already using fn$ in the gsubf
You can get pretty close to that already using fn$ in the gsubfn package:
> library(gsubfn)
> fn$sapply(split(mtcars, mtcars$cyl), x ~ summary(lm(mpg ~ wt, x))$r.squared)
4 6 8
0.5086326 0.4645102 0.4229655
It is not specific to sapply but rather fn$ can preface most funct
The link you posted used the same inputs as in my example. If that is
not what you meant maybe
a different example is needed.
Regards.
On Fri, Oct 11, 2019 at 2:39 PM Pages, Herve wrote:
>
> Has someone looked into the image processing area for this? That sounds
> a little bit too high-level for
I pressed return too soon.
If we had such a multiply then
which(embed(A, x) %==.&% reverse(x))
On Fri, Oct 11, 2019 at 10:57 AM Gabor Grothendieck
wrote:
>
> Also note that the functionality discussed could be regarded as a
> generalization
> of matrix multiplication wh
Also note that the functionality discussed could be regarded as a generalization
of matrix multiplication where * and + are general functions and in this case
we have * replaced by == and + replaced by &.
On Fri, Oct 11, 2019 at 10:46 AM Gabor Grothendieck
wrote:
>
> Using the exam
Using the example in the link here are two one-liners:
A <- c(2,3,4,1,2,3,4,1,1,2)
x <- c(1,2)
# 1 - zoo
library(zoo)
which( rollapply(A, length(x), identical, x, fill = FALSE, align = "left") )
## [1] 4 9
# 2 - Base R using conversion to character
gregexpr(paste(x, collapse = ""
Please ignore. Looking at this again I realize the problem is that
Recall is not direclty within my.compose2 but rather is within the
anonymous function in the else.
On Sun, Sep 23, 2018 at 9:23 AM Gabor Grothendieck
wrote:
>
> This works:
>
> my.compose <- function(f, ...) {
&g
This works:
my.compose <- function(f, ...) {
if (missing(f)) identity
else function(x) f(my.compose(...)(x))
}
my.compose(sin, cos, tan)(pi/4)
## [1] 0.5143953
sin(cos(tan(pi/4)))
## [1] 0.5143953
But replacing my.compose with Recall in the else causes it to fail:
my.comp
Try pmap and related functions in purrr:
pmap(as.data.frame(m), ~ { cat("Called...\n"); print(c(...)) })
## list()
On Mon, Jul 30, 2018 at 12:33 AM, David Hugh-Jones
wrote:
> Forgive me if this has been asked many times before, but I couldn't find
> anything on the mailing lists.
>
> I'd exp
The first component name has backticks around it and the second does
not. Though not wrong, it seems inconsistent.
list(a = 1, b = 2)
## $`a`
## [1] 1
##
## $b
## [1] 2
R.version.string
## [1] "R version 3.5.1 Patched (2018-07-02 r74950)"
--
Statistics & Software Consulting
GKX Group, GKX Ass
0 349 44 50 |
> i...@dans.knaw.nl <mailto:i...@dans.kn> | dans.knaw.nl
>
> DANS is an institute of the Dutch Academy KNAW <http://knaw.nl/nl> and
> funding organisation NWO <http://www.nwo.nl/>.
>
> On 23/07/2018, 16:52, "R-devel on behalf of Gabor Grothendie
Note the inconsistency in the names in these two examples. X.Time in
the first case and Time.1 in the second case.
> transform(BOD, X = BOD[1:2] * seq(6))
Time demand X.Time X.demand
118.3 1 8.3
22 10.3 4 20.6
33 19.0 9 57.0
44 1
If there is work going on to improve Rtools
1. one of the most annoying aspects of it is that it does not play nice
with builtin Windows commands. In particular, it defines a command
called find which works like UNIX find but it masks Windows find
if you add the Rtools folders to your PATH making
Regarding the anonymous-function-in-a-pipeline point one can already
do this which does use brackets but even so it involves fewer
characters than the example shown. Here { . * 2 } is basically a
lambda whose argument is dot. Would this be sufficient?
library(magrittr)
1.5 %>% { . * 2 }
##
If xtabs is enhanced then as.data.frame.table may also need to be
modified so that it continues to be usable as an inverse, at least to
the degree feasible.
On Thu, Jan 26, 2017 at 5:42 AM, Martin Maechler
wrote:
> Last week, we've talked here about "xtabs(), factors and NAs",
> -> https://sta
Have a look at the CRAN modules package and the import package.
On Sun, Oct 2, 2016 at 1:29 PM, Kynn Jones wrote:
> I'm looking for a way to approximate the "zero-overhead" model of code
> reuse available in languages like Python, Perl, etc.
>
> I've described this idea in more detail, and the mo
Note that read.pattern in gsubfn does accept stringsAsFactors = FALSE,
e.g. using your input lines and pattern:
library(gsubfn)
Lines <- c("Three 3", "Twenty 20")
pat <- "([[:alpha:]]*) +([[:digit:]]*)"
s2 <- read.pattern(text = Lines, pattern = pat, stringsAsFactors = FALSE,
col.names = c("Name
)) or sort them,
> too?
>
> On Mon, Jun 27, 2016 at 10:39 AM, Gabor Grothendieck
> wrote:
>> stack() seems to drop empty levels. Perhaps there could be a
>> drop=FALSE argument if one wanted all the original levels. In the
>> example below, we may wish to retain l
stack() seems to drop empty levels. Perhaps there could be a
drop=FALSE argument if one wanted all the original levels. In the
example below, we may wish to retain level "b" in s$ind even though
component LL$b has length 0.
> LL <- list(a = 1:3, b = list())
> s <- stack(LL)
> str(s)
'data.frame'
When in the Rgui editor sometimes ctrl-R does not cause anything to be
sent to the R console.
It can be reproduced like this:
- when in the Rgui console press ctrl-F N to get a new editor window
- enter: pi + 3 followed by Enter
- while still in the editor window press ctrl-A ctrl-R and pi + 3 ge
Regarding, this news item for r-devel:
‘for()’ loops are generalized to iterate over any object with ‘[[’ and
‘length()’ methods. Thanks to Hervé Pagès for the idea and the patch.
Below dd is an object for which [[ and length work but the result is
still numeric rather than Date class in "R Unde
This code which I think I wrote but might have gotten from elsewhere a
long time ago shows the environments that are searched from a given
function, in this case chart.RelativePerformance in
PerformanceAnalytics package. Try it on some of your functions in
and out of packages to help determine th
Please disregard. I was running an older version of R at the time. In
R version 3.2.0 Patched (2015-04-19 r68205) returnValue() does work.
On Fri, May 22, 2015 at 6:25 PM, Gabor Grothendieck
wrote:
> In R devel rev.66393 (2014-08-15) it was possible to do this:
>
>trace(optim, exi
In R devel rev.66393 (2014-08-15) it was possible to do this:
trace(optim, exit = quote(str(returnValue(
but returnValue() does not seem to be available any more. The above
was useful to get the output of a function when it was called deep
within another function that I have no control ov
On Mon, Feb 9, 2015 at 8:52 AM, Kirill Müller
wrote:
> Hi
>
>
> I haven't found a way to produce a tabulation from factor data with NA
> values using xtabs. Please find a minimal example below, it's also on R-pubs
> [1]. Tested with R 3.1.2 and R-devel r67720.
>
> It doesn't seem to be documented
On Tue, Dec 23, 2014 at 11:21 AM, Ista Zahn wrote:
> On Tue, Dec 23, 2014 at 10:34 AM, Frank Harrell
> wrote:
>> I am thinking about adding several geom and stat extensions to ggplot2
>> in the Hmisc package. To do this requires using non-exported ggplot2
>> functions as discussed in
>> http://s
On Fri, Oct 31, 2014 at 8:43 PM, Gábor Csárdi wrote:
> On Fri, Oct 31, 2014 at 8:10 PM, Gabor Grothendieck
> wrote:
> [...]
>>> Is there a better way? I have a feeling that this is already supported
>>> somehow, I just can't find out how.
>>>
>>
On Fri, Oct 31, 2014 at 7:34 PM, Gábor Csárdi wrote:
> Dear All,
>
> I am trying to do the following, and could use some hints.
>
> Suppose I have a package called pkgA. pkgA exposes an API that
> includes setting some options, e.g. pkgA works with color palettes,
> and the user of the package can
On Sun, Oct 5, 2014 at 6:51 AM, Uwe Ligges
wrote:
>
>
> On 05.10.2014 12:20, Jeroen Ooms wrote:
>>
>> I started working on some R bindings for mongo-c-driver [1]. The C
>> library compiles fine on Ubuntu Trusty (gcc 4.8.2) and osx (clang),
>> however on my windows machine (gcc 4.6.3 from Rtools 3.
Yes, Depends certainly has a role. The ability of one package to
automatically provide all the facilities of another package to the
user is important. There are many situations where the functionality
you want to provide to the user is split among multiple packages.
For example,
1. xts uses zoo a
On Mon, Jul 21, 2014 at 12:54 PM, Gábor Csárdi wrote:
> In practice, CRAN maintainers do not allow multiple licenses for parts
> of the same package. At least they did not for my package a couple of
> months ago.
>
If that is the case then you could put your data files in a separate
package from
I would like to be able to load two versions of a package at once and
to do that was thinking of giving each version a different package
name in the DESCRIPTION file and the building and installing each such
version separately.
library(myPkg1)
library(myPkg2)
and then use myPkg1::myFun() and myPk
On Sat, Apr 19, 2014 at 1:06 PM, Simon Urbanek
wrote:
> On Apr 19, 2014, at 9:00 AM, Martin Maechler
> wrote:
>
> I think there should be two separate discussions:
>
> a) have an option (argument to type.convert and possibly read.table) to
> enable/disable this behavior. I'm strongly in favor o
On Fri, Apr 18, 2014 at 12:38 PM, Zhang,Jun wrote:
> Within an R session, type Sys.getenv() will list all the environment
> variables, but each one of them occupies about a page, so scrolling to find
> one is difficult. Is this because I don't know how to use it or something
> could be improved
On Thu, Apr 17, 2014 at 2:21 PM, Murray Stokely wrote:
> If you later want to do arithmetic on them, you can choose to lose
> precision by using as.numeric() or use one of the large number
> packages on CRAN (GMP, int64, bit64, etc.). But once you've dropped
> the precision with as.numeric you ca
1 - 100 of 1106 matches
Mail list logo