Displaying 20 results from an estimated 52 matches for "nframe".
Did you mean:
frame
2007 Sep 04
2
Confusion using "functions to access the function call stack" example section
...ks a lot. If the answers are too complicated and someone knows of a
good reference that goes into more details about
the sys functions, that's appreciated also.
gg <- function(y) {
ggg <- function() {
cat("y = ", y, "\n")
cat("current frame is ", sys.nframe(), "\n")
cat("parents are ", sys.parents(), "\n")
print(sys.function(0)) # ggg
print(sys.function(2)) # gg
}
if (y > 0) gg(y-1) else ggg()
}
gg(3)
# OUTPUT
y = 0
current frame is 8
parents are 0 1 2 0 4 5 6 7
function() {
cat(&qu...
2010 Jul 09
2
select columns from vector of column names
...to do. Is there a better solution?
#names of desired columns
colnames <- c("col1","col3")
#my data
data <- data.frame("col1"=c(1,2,3),"col2"=c("A","B","C"),"col3"=c(4,5,6))
fun <- function(colname,dframe){
nframe <- subset(dframe,select=colname)
vec <- nframe[,1]
return(vec)
}
fun(colnames[1],data)
fun(colnames[2],data)
[[alternative HTML version deleted]]
2009 Oct 05
3
Questions about app_jack.c
Hello,
My configuration is :
Card 0 - kernel dummy sound card
Card 1 - my soundcard
I have a jackd running in background. My jackd launch command is :
jackd --port-max 16 --realtime --no-mlock -d alsa --playback hw:1,0
--capture hw:1,0 --rate 8000 --period 1024 --shorts --inchannels 2
--outchannels 2 --dither triangular &
1 ) I open asterisk with chan_alsa.so connected (with asoundrc) to
2010 Jul 09
1
select columns from dataframe
...here a better solution?
Thanks.
#my data
data <- data.frame("col1"=c(1,2,3),"col2"=c("A","B","C"),"col3"=c(4,5,6))
#names of desired columns
colnames <- c("col1","col3")
fun <- function(colname,dframe){
nframe <- subset(dframe,select=colname)
vec <- nframe[,1]
return(vec)
}
fun(colnames[1],data)
fun(colnames[2],data)
[[alternative HTML version deleted]]
2009 Jun 11
1
Thusnelda - Floating point exception in encoder_toplevel.c:209
...fairly
scary block of code, I wouldn't have a clue where to begin trying to fix it!
Here's what gdb has to say about it:
--
#0 0x00007f8d0e3ce515 in oc_enc_select_qi (cpi=0x7f8d0c14f010,
_qti=<value optimized out>, _trial=0) at enc/encoder_toplevel.c:209
209 rderiv=nframes[_qti]*KEY_RATIO[_qti]+drscale;
Missing separate debuginfos, use: debuginfo-install
SDL-1.2.13-7.fc10.x86_64 alsa-lib-1.0.20-1.fc10.x86_64
freetype-2.3.7-3.fc10.x86_64 glibc-2.9-3.x86_64
libjpeg-6b-43.fc10.x86_64 libogg-1.1.3-9.fc9.x86_64
libshout-2.2.2-3.fc9.x86_64 libvorbis-1.2.0-5.fc10.x86_6...
2024 Mar 13
1
Spurious warning in as.data.frame.factor()
...e/R/zzz.R (working copy)
@@ -681,7 +681,14 @@
bdy <- body(as.data.frame.vector)
bdy <- bdy[c(1:2, seq_along(bdy)[-1L])] # taking [(1,2,2:n)] to insert at [2]:
## deprecation warning only when not called by method dispatch from as.data.frame():
- bdy[[2L]] <- quote(if((sys.nframe() <= 1L || !identical(sys.function(-1L), as.data.frame)))
+ bdy[[2L]] <- quote(if((sys.nframe() <= 1L || !(
+ identical(sys.function(-1L), as.data.frame) || (
+ .isMethodsDispatchOn() &&
+ methods::is(sys.function(-1L), 'derivedDefaultMethod') &&
+ id...
2006 Dec 30
3
wrapping mle()
Hi,
How can we set the environment for the minuslog function in mle()? The
call in this code fails because the "ll" function cannot find the object
'y'. Modifying from the example in ?mle:
library(stats4)
ll <- function(ymax=15, xhalf=6) {
-sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
}
fit.mle <- function(FUN, x, y) {
loglik.fun <- match.fun(FUN)
2010 Jun 10
0
speex multi frame
...tateIn, SPEEX_GET_FRAME_SIZE,
&m_nDecodeFrameSize);
}
int CSpeexCodec::Decode(const char* pcIndata, int nIndataSize,
CShortCollection& dataOut)
{
//
speex_bits_read_from( &m_speexBitsIn, (char*)pcIndata, nIndataSize);
static std::vector<float> floatDataOut;
int nFrame = 0;
size_t nbBytes = speex_bits_remaining(&m_speexBitsIn);
while(nbBytes > 0 )
{
if( (nFrame+1) * m_nDecodeFrameSize > (int)floatDataOut.size( ) )
{
if( !floatDataOut.size( ) )
floatDataOut.resize(m_nDecodeFrameSize );
else...
2013 May 17
2
How could I see the source code of functions in an R package?
...;random", "ht", "between",
"pooling", "fd"), random.method = c("swar", "walhus", "amemiya",
"nerlove", "kinla"), inst.method = c("bvk", "baltagi"), index = NULL,
...)
{
nframe <- length(sys.calls())
is.a.list <- class(formula)[1] == "list"
if (is.a.list) {
plmlist <- match.call(expand.dots = FALSE)
plmlist[[1]] <- as.name("plm.list")
plmlist <- eval(plmlist, sys.frame(which = nframe))
return(plmli...
2008 Apr 04
0
speexdec 1.2.3
...id*)&speex_version);
printf ("speexdec version %s\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
static void *process_header(ogg_packet *op, spx_int32_t enh_enabled, spx_int32_t *frame_size, int *granule_frame_size, spx_int32_t *rate, int *nframes, int forceMode, int *channels, SpeexStereoState *stereo, int *extra_headers, int quiet)
{
void *st;
const SpeexMode *mode;
SpeexHeader *header;
int modeID;
SpeexCallback callback;
header = speex_packet_to_header((char*)op->packet, op->bytes);
if (!header)
{...
2008 Apr 04
2
speexdec 1.2.3
On Fri, Apr 4, 2008 at 12:19 AM, Jean-Marc Valin
<jean-marc.valin at usherbrooke.ca> wrote:
> Jahn, Ray (R.) a ?crit :
>
> > Dear Speex codec community:
> >
> > I am working on conversion of voice files. I could not figure out how to use speexdec.exe 1.2.3 in piped mode in order to avoid the creation of the potentially large intermediate *.wav or *.pcm files. Any
1997 Jun 06
1
R-beta: nlm
I am trying to use the function "nlm" to find the mle. I want to use a
generic function for the likelihood which would require me to use both the
parameters and the data as arguments. But nlm requires the function to
have only the parameters as arguments for this function (see example below).
> testfun <- function(x,y) sum((x-y)^2) # x - parameters, y - data
>
2018 May 10
2
using for loop with data frames.
Hi,
Is it possible use a loop to process many data frames in the same way?
For example, if I have three data frames, all with same variables
df_bs_id1 <- read.csv("test1.csv",header =TRUE)
df_bs_id2 <- read.csv("test2.csv",header =TRUE)
df_bs_id3 <- read.csv("test3.csv",header =TRUE)
How could I would implement a code loop that , for instance, would
2023 Jul 06
2
logic tweak needed for as.data.frame.<class> deprecation warning
Continuing the thread started on R-package-devel, here:
https://stat.ethz.ch/pipermail/r-package-devel/2023q3/009307.html
The logic of the now soft-deprecated as.data.frame.<class>,
> body(as.data.frame.integer)[[2L]]
if ((sys.nframe() <= 1L || sys.call(-1L)[[1L]] != quote(as.data.frame)) &&
nzchar(Sys.getenv("_R_CHECK_AS_DATA_FRAME_EXPLICIT_METHOD_")))
.Deprecated(msg = gettextf("Direct call of '%s()' is deprecated. Use '%s()' or
'%s()' instead",
"as.data...
2013 Dec 06
2
Using assign with mapply
I have a data frame whose first colum contains the names of the variables
and whose second colum contains the values to assign to them:
: kkk <- data.frame(vars=c("var1", "var2", "var3"),
vals=c(10, 20, 30), stringsAsFactors=F)
If I do
: assign(kkk$vars[1], kkk$vals[1])
it works
: var1
[1] 10
However, if I try with mapply
2006 Dec 09
1
one more question about speex_bits_insert_terminator and speex_bits_write
...I looked at examples and source code and it goes on.
speex_bits_insert_terminator is called in speex_bits_write function. Shall I
call this method one more time anywhere? Because in speexenc project,
firstly speex_bits_insert_terminator is called then speex_bits_write is
called when we assume that nframe=1. But according to manuel, only
speex_bits_write function is called. What does speex_bits_insert_terminator
do completely and where shall I use it? Is "only calling
speex_bits_insert_terminator in speex_bits_write" sufficient?
Thanks in advance
Sincerely
Yasemin
-------------- nex...
2007 Feb 14
0
environment confusion
...heta = NULL)
{
if (!is.null(parameters)) {
pars <- unlist(as.list(match.call())[-1])
for (i in seq(along = parameters)) {
assign(vars[i], mmats[[i]] %*% pars[vpos[[i]]])
}
}
arglist1 <- lapply(arglist1, eval, envir = data, enclos =
sys.frame(sys.nframe()))
r <- -sum(do.call(ddistn, arglist1))
r
}, start = list(lmu = -2.16316747342067, ltheta = 2.30970721353114),
fixed = list(lmu = -2.18543734742826))
The function appears to have the right stuff in its
environment:
Browse[1]> ls(envir=environment(call$minuslogl))
[1] "ar...
2009 Sep 14
0
Save all objects in all environment stack
Dear R Developers,
I am writing a function that would save all objects in all environments 'visible' from the point where the function is called (very much like save.image, but kind of saving the entire stack).
I figured that the call
lapply (seq(0, sys.nframe()), function(i) ls(sys.frame(i), all.names=T))
will list all such objects.
However not all of them seem to be visible, see a session transcript below
## create a simple function with a 'breakpoint'
> f <- function(x) { browser() }
## call f in lapply inside an anonymous function def...
2005 Dec 22
1
Problems with passing ... to a function
...at only differ in group
names be considert equal (is c(1,1,2)==c(2,2,1))
save.initial.param=TRUE, #should the initial parameters be saved
approach,
... #other arguments to called functions - to 'crit.fun'
){
if(save.initial.param)initial.param<-tryCatch(lapply(as.list(sys.frame(sys.nframe())),eval),error=function(...)return("error"))#saves the inital parameters f<-function(blocks,...)(print(blocks)) f(...) f<-function(m,...)(print(m)) f(...)}opt.par.new(M=M,m=1,clu=rep(1:2,times=c(7,8)),blocks=c("null","reg"),approach="val")
2008 Apr 21
3
Decoding multiple Speex frames
Hello,
Could you please explain or send an example for decoding a packet that contains multiple Speex frames.
According to the API document the speex_decode_int() decodes only one frame of speech.
Best regards,
Danny Peled
R&D Software Engineer
Intelligence Solutions
NICE Systems Ltd. ISRAEL
*+ (972) 9 769 7161
? + (972) 54 4 602840
*Danny.Peled at nice.com <mailto:*Danny.Peled at