Displaying 20 results from an estimated 3000 matches similar to: "accumulative grouping of time series"
2011 Nov 01
4
building a subscript programatically
Hi,
On ocasion, you need to subscript an array that has an arbitrary
(ie. not known in advance) number of dimensions. How do you deal with
these situations?
It appears that it is not possible use a list as an index, for
instance this fails:
> x <- array(NA, c(2,2,2))
> x[list(TRUE,TRUE,2)]
Error in x[list(TRUE, TRUE, 2)] : invalid subscript type 'list'
The only way I know is
2011 Feb 03
3
get caller's name
Hi,
Suppose a function that checks an object:
stop.if.dims <- function(x) {
if (! is.null(dim(x))) {
stop("cannot handle dimensional data")
}
}
This would be used by other functions that can only work with
dimensionless objects. The problem is the error message would need to
include the name of the function that called stop.if.dims, so that the
user knows which function got
2012 Feb 08
3
R equivalent of Python str()?
Hi,
I was wondering if there's a function in R that is meant to return a
string representation of an object. Basically, it's like print() but
it doesn't print anything, it only returns a string.
I know there's a str() function but it's not quite the same. I mean a
function that returns the same string that print() would display.
--
Bye,
Ernest
2011 Jan 28
3
sapply puzzlement
Hi,
I have this data.frame with two variables in it,
> z
V1 V2
1 10 8
2 NA 18
3 9 7
4 3 NA
5 NA 10
6 11 12
7 13 9
8 12 11
and a vector of means,
> means <- apply(z, 2, function (col) mean(na.omit(col)))
> means
V1 V2
9.666667 10.714286
My intention was substracting means from z, so instictively I tried
> z-means
V1 V2
1 0.3333333
2011 Nov 23
1
how to stack a list of arrays
Hello,
I have this list of 2-d arrays:
$`0`
k d
[1,] 0.2011962 4.019537
[2,] 0.2020706 5.722719
[3,] 0.2029451 7.959612
$`1`
k d
[1,] 0.3148325 2.606903
[2,] 0.3160287 3.806665
[3,] 0.3172249 5.419222
$`2`
k d
[1,] 0.2332536 4.949390
[2,] 0.2342188 7.115258
[3,] 0.2351840 9.955909
which I need to transform into a data frame like this
2012 Jan 31
1
dimensions dropped on assignment
Hi there,
This is a problem I've run into and do not know how to avoid. It
happens when I make an assignment using the dimension names as the
subscript of the array. The end result is a dimenensionless array
(i.e. a vector) which I don't want. See:
> out <- array(0, 5, list(1:5))
> dim(out)
[1] 5
> out[names(out)] <- 1
> dim(out)
NULL
I tried to include a
2007 Jan 04
1
need help with debug package
Hi all,
I met a problem while using the debug package, I have the following program:
mainfun<- function(){
beta<-1
result<-subfun(beta+x)
}
subfun<-function(expr){
y <- eval(expr, envir=list(x=c(1,2)),enclos = parent.frame())
return(y)
}
I have no problem using this program without calling the debug
2004 Mar 26
3
regression problem
i need to know how to estimate a linear regression whose coefficients sum
to zero
2001 Jun 15
1
contrasts in lm and lme
I am using RW 1.2.3. on an IBM PC 300GL.
Using the data bp.dat which accompanies
Helen Brown and Robin Prescott
1999 Applied Mixed Models in Medicine. Statistics in Practice.
John Wiley & Sons, Inc., New York, NY, USA
which is also found at www.med.ed.ac.uk/phs/mixed. The data file was opened
and initialized with
> dat <- read.table("bp.dat")
>
2016 May 23
2
data frame method for as.table()
Hello,
Currently it's possible to convert an object of class table to a data frame
with as.data.frame.table(), but there's no ready-made function, AFAIK, to do
the reverse operation, i.e. conversion of a data frame to a table.
Do you think it would be a good idea to add a data.frame method to
as.table(), to allow such conversions?
The idea is that if `x' is a table and `y <-
2004 Jan 11
3
newbie question on contrasts and aov
I try to move from SPSS to R/S and am trying to reproduce the results of SPSS
in R. I calculated a one-way anova with "spk" as experimental factor and erp
as depended variable.
The result of the Anova are the same concearning the mean square, F and p
values. But I also wanted to caculate the contr.sdif(4) contrast on spk. The
results are completely different now. I hope anybody can
2003 Sep 15
2
Cisco 7905
Can anyone tell me the features of the Cisco 7905 with SIP? I mean things
like number of lines, speakerphone, transfer buttons, etc. I've seen the
Cisco material, but all it told me was how nifty it is and how wonderful
the XML interface will be ;)
Thanks,
--Ernest
2007 Jan 04
3
hidups can't find device
Hello,
I try to install my APC Back-UPS RS 800 on my debian system (Etch):
Linux aigner 2.6.18-3-686 #1 SMP Mon Dec 4 16:41:14 UTC 2006 i686 GNU/Linux
When i try to start the driver an i use hidups i get this failure massage:
aigner:/lib/nut# upsdrvctl start
Network UPS Tools - UPS driver controller 2.0.4
Network UPS Tools: HID UPS driver 0.13 (2.0.4)
Warning: This is an experimental driver.
2013 Nov 01
7
[PATCH] construct listener_fds Hash in 1.8 compatible way
This renables the ability for Ruby 1.8 environments to perform reexecs
---
lib/unicorn/http_server.rb | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 2decd77..9a5795c 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -449,13 +449,14 @@ class Unicorn::HttpServer
end
2007 Mar 19
3
Rinternals.h and undefined symbols
Hi,
I'm trying to register my native routines using R_registerRoutines
(...). I can compile the code, but the loader cannot resolve the symbol:
undefined symbol:
_Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6
_
$ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutines
U
_Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6
2003 Sep 16
3
Follow Me
Ernest,
I hadn't thought of doing that, though having that added protection would
be nice. However, what I'm trying to do it have an incoming call at my home
number follow me to my cell phone for selected numbers -- Since I already
have three way calling, I'd like get Asterisk to essentially three way my
cell phone into the call (or my office number, etc.) I understand the
2018 Nov 22
2
[tryExcept] New try Function
Hi everyone,
When dealing with errors, sometimes I want to run a bunch of code when an error occurs.
For now I usually use a structure such as:
res <- tryCatch(expr, error = function(cond) cond) # or try(expr)
if (inherits(res, ?error?)) # or inherits(res, ?try-error?)
# a bunch of code
I though it would be useful to have a function that does this naturally, so I came up with the attached
2007 Feb 25
3
R/C++/memory leaks
Dear all,
I have wrapped a C++ function in an R package. I allocate/deallocate
memory using C++ 'new' and 'delete'. In order to allow user
interrupts without memory leaks I've moved all the delete statements
required after an interrupt to a separate C++ function freeMemory(),
which is called using on.exit() just before the .C() call.
I am concerned about the
2003 Oct 01
1
Audiocodes gateway and asterisk
Is anyone on the list using an Audiocodes gateway with asterisk and SIP?
I'm looking at that platform, but I have a couple of issues:
1) Echo cancellation. The echo that I'm hearing with an X100P is
unacceptable. Does the Audiocodes do better?
2) Line signalling. I'm using Kewlstart with the X100P, but it looks like
the audiocodes uses loopstart only. How does this work with
2003 Oct 21
1
SNOM 200 beta build + MOH
I'm using the SNOM 200 latest SIP beta (so that I can have the GSM codec,
etc). Everything seems to be working fine, but the music on hold doesn't
play when I use the HOLD button on the snom. Any suggestions?
Thanks,
--Ernest