Displaying 20 results from an estimated 11000 matches similar to: "taylor expansions with real vectors"
2019 Nov 18
2
BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"
On 11/18/19 9:18 AM, Martin Maechler wrote:
>>>>>> Henrik Bengtsson
>>>>>> on Sun, 17 Nov 2019 14:31:07 -0800 writes:
> > $ R --vanilla R version 3.6.1 (2019-07-05) -- "Action of
> > the Toes" Copyright (C) 2019 The R Foundation for
> > Statistical Computing Platform: x86_64-pc-linux-gnu
> > (64-bit) ...
2019 Nov 17
2
BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"
$ R --vanilla
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
> str(base::`+`)
function (e1, e2)
> plus <- structure(base::`+`, class = "plus")
> str(plus)
function (e1, e2)
- attr(*, "class")= chr "plus"
## Hmm ...
>
2019 Nov 18
2
BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"
On 11/18/19 10:45 AM, Martin Maechler wrote:
>>>>>> Tomas Kalibera
>>>>>> on Mon, 18 Nov 2019 09:36:14 +0100 writes:
> > On 11/18/19 9:18 AM, Martin Maechler wrote:
> >>>>>>> Henrik Bengtsson
> >>>>>>> on Sun, 17 Nov 2019 14:31:07 -0800 writes:
> >> > $ R --vanilla R
2009 Nov 25
1
group generics
I have classes A and B, where B contains A. In the implementation of
the group generic for B I would like to use the corresponding group
generic for A. Is there a way to do that?
I would also appreciate any comments if what I'm trying to do seems like
the wrong approach.
Here's a stripped down example:
setClass("A",
2005 Jun 03
2
rearrange data
Dear all:
I have this:
A1 B1 C1 D1 E1
A2 B2 C2 D2 E2
A3 B3 C3 D3 E3
And I want this
A1 E1
B1 E1
C1 E1
D1 E1
A2 E2
B2 E2
C2 E2
D2 E2
A3 E3
B3 E3
C3 E3
D3 E3
Example:
m<- matrix(1:15,nrow=3,byrow=T)
m
v<- unlist(list(t(m[,1:4])))
u<- rep(c(5,10,15),c(4,4,4))
data.frame(v,u)
This is the result I want but I would like to learn a simpler way to do it.
Any clue?
2007 Mar 23
1
substitute and S4 objects
Hi all,
I don't understand why this does not what I expect :
## code start here ##############
setClass("num",representation(x="numeric"))
num<-function(x) new("num",x=x)
add<-function(e1,e2) {
cat("Computing
",deparse(substitute(e1)),"+",deparse(substitute(e2)),"\n")
e1@x+e2@x
}
2008 Mar 13
2
Making custom unary operators in R
Hello,
Is there a way to define a custom unary operator in R (other than making a
class and 'overloading' the normal unary operators in R)? The
documentation seems to suggest that only custom binary operators are
possible with the ``%abc%``construct but I was wondering whether any one
has done so. None of the RSiteSearch or RSeek queries I posed suggested
that this question had
2008 Jul 29
1
environment question
Hi R users!
I was looking at some of the example code for the "environment"
function. Here it is:
e1 <- new.env(parent = baseenv()) # this one has enclosure package:base.
e2 <- new.env(parent = e1)
assign("a", 3, envir=e1)
ls(e1)
ls(e2)
exists("a", envir=e2) # this succeeds by inheritance
exists("a", envir=e2, inherits = FALSE)
2018 Mar 21
2
AMI potential memory leak
We are communicating with Asterisk via AMI. Running Asterisk version 13.18.5 on an Ubuntu box.
If you look at the event response, the Result field is filled with random characters. I'm not sure what to do because that is a completely random result. It makes no sense.
We send the following command to asterisk via AMI
Action: AGI
ActionID: C44415
Channel: SIP/192.168.40.105-00001338
2011 Nov 02
1
overloading + operator for chars
Hello,
I would like to overload the "+" operator so that it can be used to concatenate two strings, e.g "John" + "Doe" = "JohnDoe".
How can I 'unseal' the "+" method?
> setMethod("+", signature(e1="character", e2="character"), function(e1, e2) paste(e1, e2, sep="") )
Error in
2012 Jul 11
2
help with merging 2 data frames
Dear R-ers,
I feel I am close, but can't get it quite right.
Thanks a lot for your help!
Dimitri
# I have 2 data frames:
x<-data.frame(a=c("aa","aa","ab","ab","ba","ba","bb","bb"),b=c(1:2,1:2,1:2,1:2),d=c(10,20,30,40,50,60,70,80))
1999 Mar 23
1
(-2) %% 12
(-2) %% 12 seems to give the wrong result in R pre 63.3:
> e1 <- -2
> e2 <- 12
> e1 %% e2
[1] -2
> e1 - floor(e1/e2) * e2
[1] 10
In Splus:
> e1 <- -2
> e2 <- 12
> e1 %% e2
[1] 10
> e1 - floor(e1/e2) * e2
[1] 10
Paul Gilbert
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2004 May 27
2
ANOVA and contrasts
Dears members of R list,
I would like that a more experienced R user help me to complete
this analysis:
r = gl(3, 8, label = c('r1', 'r2', 'r3'))
e = rep(gl(2, 4, label = c('e1', 'e2')), 3)
y = c(26.2, 26.0, 25.0, 25.4, 24.8, 24.6, 26.7, 25.2, 25.7, 26.3, 25.1, 26.4,
19.6, 21.1, 19.0, 18.6, 22.8, 19.4, 18.8, 19.2, 19.8, 21.4, 22.8, 21.3)
df =
2010 Sep 01
2
testing for emptyenv
Dear R-users,
Is there a way to test whether a particular environment e is equal to emtyenv(), or for that sake whether two environments e1 and e2 are equal?
I tried a couple of ways to compare environments, but neither seem to work:
> e1 <- new.env()
> e2 <- new.env()
> e1 == e2
Error in e1 == e2 :
comparison (1) is possible only for atomic and list types
> all.equal(e1,
2008 Jul 02
1
Constructing logical expressions dynamically
Hello,
I am trying to construct a logical expression dynamically, for use in the
subset() function. I am puzzled by problems with the code that follows
below.
Probably there's an easier way to select rows of a data frame according to
some dynamic criteria--and I'd love to hear about it--but I'd also like to
understand what I'm doing incorrectly in constructing the expression in
2006 Sep 15
1
setMethod() woes
Hello everybody
R version 2.4.0 alpha (2006-09-15 r39323), MacOSX 10.4.7
Next S4 problem.
I have "brob" objects that are large real numbers, and now I want "glub"
numbers that are to be a pair of glubs that represent complex numbers.
I want to define binary operator "+" so that if either the left or right
argument are glubs, it uses .ArithGlub.
If either
2009 Sep 05
2
Combining expressions.
I am trying to construct a function to which I pass an expression as an argument.
>From that expression I want to create a somewhat more complicated expression
and then differentiate it using D() or deriv().
To give a simple example, I'd like to be able to do something like
e1 <- expression(x^2 + y^2)
e2 <- some.magic(e1,"n")
or maybe e2 <- some.magic(e1,expression(n))
2016 Nov 24
2
Dos pequeños códigos casi idénticos y sólo funciona el primero
Buenas tardes a todos,
He adaptado una pregunta realizada en otro foro respecto de un caso que me interesa resolver. Sea el data.table:
DT <- data.table(caso = rep(1:2, c(3, 2)), empresa = factor(rep(c("E1", "E2"), c(3, 2))),
coche = factor(c('A', 'B', 'U', 'W', 'B')), envio = factor(rep(c(T, F), c(3, 2))))
En el siguiente
2009 Sep 01
2
ordering and factors into column headings
Hi,
The lab in which I send my samples return the results in a format that
is difficult for me to run my analysis. The lab outputs the results
where each parameter is its own row and it’s not consistently in the
same order (and not each sample is tested for the same suite of
variables).
e.g.
>dataset
site parameter value
a e2 3
a e1 1
a e3 5
b e3
2018 Sep 03
2
compairing doubles
Maybe a new Operator could be defined for a fast and easy double
Comparison: `~~`
`~~` <- function (e1, e2) all.equal(e1, e2)
And document it properly.