Displaying 20 results from an estimated 7000 matches similar to: "special recursive filter"
2011 May 19
1
vectorial search for elements with certain attributes
I have 2 vectors A and B. For each element of B I'd like to find the index of the next higher or equal element in A. And I'd like to store it effectiv. E.g.:
A <- c(1,3,7,8,10)
B <- c(5,8)
result: 3, 4
I have a possibility but for long vectors it works not very effectiv:
ans <- sapply(B, function(x) which.max(A[A < x]) )
as.integer(ans + 1)
Is there anyone how has a better
2012 Apr 01
1
indexing in a function doesn't work?
Hello,
I've written a small function that's supposed to save me some time, and
it's ending up killing it- the intention is to iteratively subset a dataset
fram on framevec, fit a model (either lm or nls depending on type) and
return the r2 or AIC from the model, respectively. Although as far as I can
tell in my code the plots are dependent on the fit of the model to the data
and the
2003 Apr 15
1
Building R package.
Hi!
I am trying to build a package which calls an c function. It compiles
it and installs it. But if i run R CMD check test_
the last output are:
* checking examples ... ERROR
Running examples failed. x<-1:10
and in the test-Ex.out file i find:
> test(x)
Error in .C("mytest", as.double(x), as.integer(lengthx)) :
C/Fortran function name not in load table Execution halte
2011 Sep 09
4
Very simple question about list components
I have a list 'ans' from the following code:
tt <- rnorm(50)
rr <- rnorm(50)
ans <- lm(rr~tt)
ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is
"$effects", ... and so on up to ans[12]. Is there an easy way to
display just these names and not the data they contain? I thought I
saw my advisor type "ans$" and they were displayed,
2012 Aug 09
4
debug vs regular mode
Dear all,
I had a R segmentation fault, and then invoked debug mode and ran step
by step.
When I reached "terms(Y~X1*X2*...*X16)", I would then have
"segmentation" fault. However, if I just ran this under regular "R
interactive" mode, it would be fine though taking long time.
My questions are:
1. Is there a known limit of terms for a formula?
2. Why does the
2012 Aug 09
4
debug vs regular mode
Dear all,
I had a R segmentation fault, and then invoked debug mode and ran step
by step.
When I reached "terms(Y~X1*X2*...*X16)", I would then have
"segmentation" fault. However, if I just ran this under regular "R
interactive" mode, it would be fine though taking long time.
My questions are:
1. Is there a known limit of terms for a formula?
2. Why does the
2011 Oct 29
4
R help with different combinations of vectors of different sizes
Hi,
I am trying to get different combinations of a vector of different size and
find their sum. For example, if I have a vector (i,j) where i and j can be
anything from 0 to 5, i get these combinations (0,0), (0,1), (1,0), (1,1),
(2,0), ...... (5,5) and find sum of these as 0, 1, 1, 2, ..... , 10. I used
outer functions to get this and it worked. What if I have a vector (i,j,k)
where all i, j ,
2011 Aug 04
2
Efficient way of creating a shifted (lagged) variable?
Hello!
I have a data set:
set.seed(123)
y<-data.frame(week=seq(as.Date("2010-01-03"), as.Date("2011-01-31"),by="week"))
y$var1<-c(1,2,3,round(rnorm(54),1))
y$var2<-c(10,20,30,round(rnorm(54),1))
# All I need is to create lagged variables for var1 and var2. I looked
around a bit and found several ways of doing it. They all seem quite
complicated - while in
2011 Dec 06
5
Argument validation within functions
Hi,
I just started with writing functions in R and so some questions popped up.
I provide some values as argument to my function such as:
function(a,b,c){}
Now i want that the function first checks if the arguments are valid for the function. E.g argument "a" has to be a number in the range 0-1. How can that easily done?
So far I have:
a <- as.numeric(a)
if(0 <= a &&
2012 Dec 01
3
screen if a value is within range
Dear all,
could you please give me some pointers on how I could make R screen for a value if it falls within a certain range?
I looked at the subset function, but is not doing it, perhaps because I only have 1 value to screen?
aptreciate the input
ex:
a <-16.5
I would like to screen to see if a is within the range of 15 to 20, (which it is:-)), and I would like the code to return a value
2006 Sep 22
3
how to store recursive results
Hi all,
How to store recursive resutls from a function for each step without using
global operators <<-? Thanks ahead.
Xiaohui Chen
Dept. of Statistics
UBC, Canada
_________________________________________________________________
Don?t waste time standing in line?try shopping online. Visit Sympatico / MSN
2011 Aug 15
2
Extracting information from lm results (multiple model runs)
Just to inform:
I posted that before in R-sig-ecology but as it might be interesting also for other useRs, I post it also to the general r-user list:
Hello Alexandre,
thank you very much. I also found another way to extract summarizing information from lm results over e.g. 1000 repeated model runs:
results2 <- t(as.data.frame(results))
summary(results2)
Although some questions popped up in
2007 Jul 18
3
upgrade to 3.0.25 and ads
Hi,
I'm presently testing to upgrade from 3.0.22 to 3.0.25 and have an ads
problem.
net -d 10 -s /etc/samba/smb.conf ads join
3.0.25:
=======
[2007/07/18 12:03:11, 4] libsmb/namequery_dc.c:ads_dc_name(131)
ads_dc_name: using server='ADS-2K3.ADS2K3.Q-LEAP.DE' IP=192.168.53.212
[...]
[2007/07/18 12:03:11, 3] libads/ldap.c:ads_connect(394)
Connected to LDAP server 192.168.53.212
2013 May 23
11
raid6: rmw writes all the time?
Hi all,
we got a new test system here and I just also tested btrfs raid6 on
that. Write performance is slightly lower than hw-raid (LSI megasas) and
md-raid6, but it probably would be much better than any of these two, if
it wouldn''t read all the during the writes. Is this a known issue? This
is with linux-3.9.2.
Thanks,
Bernd
--
To unsubscribe from this list: send the line
2006 Jul 05
1
HEADS UP: Krb5-1.5
There is an issue with the new Kerberos 1.5. It does not currently support
building static libraries. I'm willing to leave the port at 1.4.3 until MIT
fixes the static library build. OTOH, if folks want 1.5, without static
library support, the 1.5 port is ready to commit. I may update the port to
build 1.5 if static libraries are not wanted and build 1.4.3 if they are
wanted. Static
2011 Oct 17
2
how to use 'which' inside of 'apply'?
Hello R-community,
I am trying to populate a column (doy) in a large dataset with the first
column number that exceeds the value in another column (thold) using the
'apply' function.
Sample data:
pt D1 D17 D33 D49 D65 D81 D97 D113 D129 D145 D161 D177
D193 D209 D225 D241 D257
1 39177 0 0 0 0 0 0 0 0 0.4336 0.4754 0.5340667 0.5927334
0.6514 0.6966
2004 Mar 13
2
recursive matrix multiplication question
List serv subscribers,
I am wondering if there is an efficient means of doing recursive matrix
multiplication in R. My data resides in a 4 X 2541 matrix from which I need
to extract 2541 2X2 matrices based on each row. If I attempt something like
this:
function(AO)
{A<-AO
{for(t in 1:4)
2012 Dec 07
1
Problem with special characters
I have the following problem:
I am using igraph and entering a graph from an external (.txt) file using
read.graph("a.txt","ncol")
In a.xtx the name of the nodes contains special
characters (such Polish names, etc). In the
R console, the visualization of the names is not
correct and I am loosing some of the special characters.
Any help will be greatly appreciate.
Renato
2004 May 09
2
Using known errors and error bars
Hi,
I'm now to R and hope (actually, I'm quite sure) you can help me. I made
an experiment and measured two values. As I know the errors of these
values I want to use them with the linear regression,
eg
Value A
1.1+-0.02
1.9+-0.05
3.05+-0.03
4.0+-0.01
5.1+-0.06
Value B
4.2+-0.14
5.3+-0.05
6.8+-0.11
7.9+-0.01
8.5+-0.02
lm(B~A) does the linear regression but how can I
2004 Aug 06
5
mp3-streaming client for icecast2
Hi!
I'm looking for a streaming client for the icecast2-server. It should
just feed mp3-files from a playlist to the icecast2-server. The old
shout doesn't work:
hout -P a -e 8000 -x -p /big/m3u/list.m3u
=>
[3:21] Size: 3231748 Bitrate: 128000 (41432 bytes/dot)
[Server error: [HTTP/1.0 401 Authentication Required ]
WWW-Authenticate: Basic realm="Icecast2 Server"