Displaying 20 results from an estimated 10000 matches similar to: "vector conditional modification"
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
libswfdec/swfdec_as_array.c | 407 +++++++++++++++++++++++++-----------------
test/trace/array2-5.swf |binary
test/trace/array2-5.swf.trace | 38 +++
test/trace/array2-6.swf |binary
test/trace/array2-6.swf.trace | 38 +++
test/trace/array2-7.swf |binary
test/trace/array2-7.swf.trace | 38 +++
test/trace/array2.as | 77 +++++++
8 files changed, 437
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
libswfdec/swfdec_as_array.c | 407 ++++++++++++++++++++--------------
libswfdec/swfdec_as_function.c | 37 +--
libswfdec/swfdec_as_function.h | 4
libswfdec/swfdec_as_internal.h | 4
libswfdec/swfdec_as_interpret.c | 25 +-
libswfdec/swfdec_as_native_function.c | 20 -
libswfdec/swfdec_as_script_function.c | 23 +
2006 Mar 27
2
apply(ing) to sum subset of a vector
Dear R users
I am trying to sum selective elements of a vector but my solution
is not cutting it.
Example:
> g <- 1:5;
> from <- 1:3;
> to <- 3:5;
from to
1 3
2 4
3 5
so I expect 3 sums from g
1+2+3 that is 1 to 3 of g
2+3+4 that is 2 to 4 of g
3+4+5 that is 3 to 5 of g
my solution will not work.
sum.em <- function(g, c1, c2)
2008 Dec 15
1
Unicode problem with mb_chars.index
Hello,
I tried the following
str ="ÄÄa__"
assert str.mb_chars.is_utf8?
assert str.is_utf8?
# this is logical
assert_equal 4, str.index("a", 4)
# this is not logical. shouldn''t this be nil !?
assert_equal 2, str.mb_chars.index("a", 4)
Why is the last line failing? And how could I fix this?
Regards,
Peter.
PS: I am using ruby 1.8.6 on linux with rails
2008 Jan 07
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_types.c libswfdec/swfdec_xml.c
libswfdec-gtk/swfdec_gtk_loader.c | 2 --
libswfdec/swfdec_as_array.c | 38 ++++++++++++++++++--------------------
libswfdec/swfdec_as_function.c | 2 +-
libswfdec/swfdec_as_types.c | 2 +-
libswfdec/swfdec_asbroadcaster.c | 2 +-
libswfdec/swfdec_xml.c | 5 +++--
6 files changed, 24 insertions(+), 27 deletions(-)
New commits:
commit
2006 Mar 23
1
subsets of vector
dear R users
I have been trying a lot to get this task accomplished but need your help.
input:
x <- c(3,3,4,4,4,4,5,7,7,0,1,1,2,2,2)
desired output
3 1 2
4 3 6
7 8 9
...
which means,
3 is repeated at index 1:2
4 is repeated at index 3:6
...
my effort has not been that good.
a <- !c(NA,diff(x));
b <- which(a==1);
a[b-1]=1;
cbind(x,a);
or
sp <-
2007 Jul 21
0
12 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/jpeg libswfdec/swfdec_as_array.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h
configure.ac | 2
doc/Makefile.am | 1
doc/swfdec-sections.txt | 2
libswfdec/jpeg/jpeg.c | 22 ++--
libswfdec/swfdec_as_array.c | 70 ++++++-------
libswfdec/swfdec_as_object.c | 95 +++++++++++++++--
libswfdec/swfdec_as_strings.c | 1
libswfdec/swfdec_player.c | 197
2004 Apr 25
2
package fdim slopeopt error (PR#6819)
Full_Name: Fred J.
Version: 1.8.1
OS: windows 2000
Submission from: (NULL) (203.26.24.216)
platform i386-pc-mingw32
the error can be duplicated as follows
> rt <- data.frame(8:15, 7:14, 6:13, 5:12, 4:11, 3:10, 2:9, 1:8)
> library(fdim)
> FD <- (fdim(rt,q=2))
Error in slopeopt(AllPoints, Alpha) : Object "LineP" not found
2004 Apr 30
3
absolute value
Hello
could you please tell me what is the function to get
the absolute value of the real or complex number.
most of other languages it is abs(x) , what is it in
r?
I did few searhces in the help docs for no avail.
thanks
F.J
2004 Mar 16
3
rate of change
Hello
I am wondering, how do I find if R has a certain
funciton to do a given task. do I just type
help.search("rate").
I am just trying to find a function to calculate the
rate of change for a variable. I could come up with
one if there isn't any allready builtin.
thanks
2007 Jan 18
1
Updating index when non-rails app creates entries?
I have a database shared between a Rails app (gui) and a Java app
(daemon). When the java app periodically updates the database, this
isn''t reflected in Ferret indexes visible via acts_as_ferret in Rails.
How do I trigger re-indexing? Do I just make my Java daemon delete the
index files, or is there something cleverer than that..?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2011 Feb 01
3
sum the values in a vector as a complete number
Hi
I am trying to create a function that is able to calculate this sum:
a<-c(2,3,5)
b<-(8,7)
with "a" meaning 235 and "b" 87. So the result of this sum would be 235 + 87
= 322.
I've searched a function like strsplit but that worked for integers and in
reverse - not spliting but combining.
Can you give me a hand on this please?
thanks
AD
--
View this message in
2005 Mar 28
2
Generating list of vector coordinates
Hi.
Can anyone suggest a simple way to obtain in R a list of vector
coordinates of the following form? The code below is Mathematica.
In[5]:=
Flatten[Table[{i,j,k},{i,3},{j,4},{k,5}], 2]
Out[5]=
{{1,1,1},{1,1,2},{1,1,3},{1,1,4},{1,1,5},{1,2,1},{1,2,2},{1,2,3},{1
,2,4},{1,2,
5},{1,3,1},{1,3,2},{1,3,3},{1,3,4},{1,3,5},{1,4,1},{1,4,2},{1,4,3},
{1,4,
2004 Mar 22
2
regex in R
Hello
I could use some help here with trying to use perl
stype regex to extract the first group of letters
before a ( . )
so if I have a sting AACEE.adiid and wanting AACEE
i <- "AACEE.adiid"
grep(".+\..?+",i,perl=T)
I must be doing somthing wrong but don't know what it
is?
thanks
2004 Mar 27
1
building a list in loop
Hello
getdata <- function(p){
fname <- NULL; dl <- list()#build the sturcture
builddl <- function(q,s){
fname <<- c(fname,s) #where "s" is a string
dl <<- list( dl, dt2)
}
list(names = fname, data = dl)
}
data <- getdata("c:\somepath")
> data
$names
[1] "fname"
$data
$data[[1]] <--- since there is no [[1]] how can I
stop
2004 Apr 12
2
fractal calculation using fdim
Hello
I am getting this
Error in slopeopt(AllPoints, Alpha) : Object "LineP"
not found
when the dim(<data.frame>) of the data matrix for
which the fdim is being calculated hits a certain
values depending on the data set. e.g
print(dim(mat))
fd <- fdim(mat,q=2)
[1] 2743 2
[1] 2742 3
[1] 2741 4
[1] 2740 5
[1] 2739 6
[1] 2738 7
[1] 2737 8
[1] 2736 9
[1] 2735
2006 Mar 31
1
matching a given sd range
Dear R users
given a numeric array (a sequence of reals), I am interested in
finding the subsets of sequences (each with start and end index) which match a given sd range.
I read the docs on match and which and the "see also" but could not come up with a way. I could loop with a stepping window over the sequence but that would be limited to a fixed size window, I guess I as well
2004 Mar 07
6
applying data generating function
Hello
Coming from matlab background, I could use some help
on this one.
I need to generate a data set based on this equation
X(t) = 3.8x(t-1) (1-x(t-1)) + e(t), where e(t) is a
N(0,0,001) random variable
I need say 100 values.
How do I do this?
Thanks
2006 May 26
3
Vector elements and ratios
Dear useRs,
I have two different length vectors: one column (1...m) and one row
vector (1...n):
20
40
20
60
5 4 2
Now I have to calculate ratios between column vector elements and each
row vector elements:
4 5 10
8 10 20
4 5 20
15 12 30
Thank's in advance for any suggestions,
Andrej
2006 Feb 04
2
saving a character vector
Hi R users
I wrote a function that generates some character strings.
generate.index<-function(n.item){
for (i in 1:n.item)
{
for (j in ((i+1):n.item))
{
cat("i",formatC(i,digits=2,flag="0"),".",formatC(j,digits=2,flag="0"),"\n",sep="")
}
}
}
I