[R] multiple instance learning

2011-04-17 Thread zem
Hi all,

know somebody a package for R where are implemented multiple instance
learning algos? 
I've just checked the forum, but couldnt find anythink... 

thanks in advance

--
View this message in context: 
http://r.789695.n4.nabble.com/multiple-instance-learning-tp3455505p3455505.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] grouping and counting in dataframe

2011-02-27 Thread zem
have nobody any idea? 
i have already try with tapply(d,gr, ... ) but i have problems with the
choose of the function ...  also i am not really sure if that is the right
direction with tapply ... 
it'll be really great when somebody comes with new suggestion..

10x

-- 
View this message in context: 
http://r.789695.n4.nabble.com/grouping-and-counting-in-dataframe-tp3325476p3327240.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] grouping and counting in dataframe

2011-02-26 Thread zem
sry, 
new try: 

tm<-c(12345,42352,12435,67546,24234,76543,31243,13334,64562,64123) 
gr<-c(1,3,1,2,2,4,2,3,3,3) 
d<-data.frame(cbind(time,gr))

where tm are unix times and gr the factor grouping by
i have a skalar for example k=500
now i need to calculate in for every row how much examples in the group are
in the interval [i-500;i+500] and i is the active tm-element, like this: 

>d
time gr ct
1  12345  1  2
2  42352  3  0
3  12435  1  2
4  67546  2  0
5  24234  2  0
6  76543  4  0
7  31243  2  0
8  13334  3  0
9  64562  3  2
10 64123  3  2

i hope that was a better illustration of my problem

-- 
View this message in context: 
http://r.789695.n4.nabble.com/grouping-and-counting-in-dataframe-tp3325476p3326338.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] grouping and counting in dataframe

2011-02-25 Thread zem

hi all,

i have a little problem, i have some code writen, but it is to slow... 

i have a dataframe with a column of time series and a grouping column,
really there is no metter if in the first col what kind of data is, it can
be a random number like this
x<-rnorm(10)
gr<-c(1,3,1,2,2,4,2,3,3,3)
x<-cbind(x,gr)

now i have to look for every row i , for this group, how much from the x[,1]
is in a range from x[1,i] such x[1,i] (+/-) k (k is a another number) 

thanks in advance 

-- 
View this message in context: 
http://r.789695.n4.nabble.com/grouping-and-counting-in-dataframe-tp3325476p3325476.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] means, SD's and tapply

2011-02-25 Thread zem

Hi Christopher,

i think you have the same problem like me today :) 
see this  
http://r.789695.n4.nabble.com/group-by-in-data-frame-tc3324240.html post 
i think you can find there the solution

zem
-- 
View this message in context: 
http://r.789695.n4.nabble.com/means-SD-s-and-tapply-tp3325158p3325191.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] group by in data.frame

2011-02-25 Thread zem

ok, i have it - match() 

10x all again! :)
-- 
View this message in context: 
http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3325269.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] group by in data.frame

2011-02-25 Thread zem

hi guys,

many many thanks for all the solutions! :-D they are working great!
i have another "little" question: 
i would like to save these groups in a new column with serial number like
the solution from David, but wit integer values: 1,2,3... 
i do this allready but with my 1. solution and there is to much temp-data,
that i dont realy nead ... 
if you have any idea, that'll be really great! 

thanks a lot ! 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3325199.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] group by in data.frame

2011-02-25 Thread zem

Yeah, you are right
i want to post an short example what i want to do .. and in the meantime i
solved the problem ... 
but here is: 
i have something like this dataframe: 
c1<-c(1,2,3,2,2,3,1,2,2,2)
c2<-c(5,6,7,7,5,7,5,7,6,6)
c3<-rnorm(10)
x<-cbind(c1,c2,c3)
> x
  c1 c2  c3
 [1,]  1  5  0.08279036
 [2,]  2  6  0.59135988
 [3,]  3  7  1.45520468
 [4,]  2  7 -1.70094640
 [5,]  2  5  0.13065228
 [6,]  3  7 -1.12080980
 [7,]  1  5  0.42779354
 [8,]  2  7 -1.53111972
 [9,]  2  6  0.29299987
[10,]  2  6 -0.01602095

#whith aggregate i receive this:
>aggregate(x[,3],list(x[,1],x[,2]),mean)
  Group.1 Group.2  x
1   1   5  0.2552920
2   2   5  0.1306523
3   2   6  0.2894463
4   2   7 -1.6160331
5   3   7  0.1671974


and the problem was that i was grouping by 2 columns, so i couldn't copy the
result to x.

the solution was i made another column with paste(x[,1],x[,2],sep="_")
and then i used the solution from this link:
http://tolstoy.newcastle.edu.au/R/help/06/07/30184.html
so i solved my problem

Ivan, many thanks for your support and quik responses! :) 

-- 
View this message in context: 
http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3324608.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] group by in data.frame

2011-02-25 Thread zem

10x i solved it ... mein problem was that i had 2 column by them i have to
group, i just "pasted" the values together so that at the end i have one
column to group and then was easy ... 
here is the script that i used:
http://tolstoy.newcastle.edu.au/R/help/06/07/30184.html
Ivan thanks for the help too :) 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3324469.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] group by in data.frame

2011-02-25 Thread zem

Hi Ivan,

thanks for your replay!
but the problem is there that the dataframe has 2 rows and  ca. 2000
groups, but i dont have the column with the groupnames, because the groups
are depending on 2 onother columns ... 
any other idea or i didnt understand waht are you posted ... :( 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3324327.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] select element from vector

2011-02-25 Thread zem

Hi Jessica,

try this: Q[k:c(k+3)]
-- 
View this message in context: 
http://r.789695.n4.nabble.com/select-element-from-vector-tp3323725p3324286.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] group by in data.frame

2011-02-25 Thread zem

Hi all,

i have a little problem, and i think it is really simple to solve, but i
dont know exactly how to.
here is the "challange": 
i have a data.frame with n colum, i have to group 2 of them and calculate
the mean value of the 3. one. so far so good, that was easy - i used
aggregate function to do this:
group<-aggregate(x[,1],list(x[,2],x[,3]),mean) 
and now i have to copy the calculated mean value to every row of the
date.frame (in a new column in the dataframe), ofcourse by copying should be
the value  adequate to the group

it will be great if someone can help me
thanx in advance! 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3324240.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] regex

2011-02-15 Thread zem

10x Henrique! 

it works great bur i need tha same with gsub, i want to replace the matched
string... :/ 
another idea?
-- 
View this message in context: 
http://r.789695.n4.nabble.com/regex-tp3306635p3307114.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] regex

2011-02-15 Thread zem

OK I have strings like these:

AGDHA!jdbsah/dsgadg#dasdwq*dsad

and 



etc.

the first one must be mathced and these in the <> not
-- 
View this message in context: 
http://r.789695.n4.nabble.com/regex-tp3306635p3306858.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] regex

2011-02-15 Thread zem

HI all,

i know that isn't the typically regex-forum but i need help to create one
regex in R . it will be great when someone can help me. 
ok, i need a regex that match [:graph:] but ignores that strings they starts
off with "<" and ends in ">"

thanx in advance
-- 
View this message in context: 
http://r.789695.n4.nabble.com/regex-tp3306635p3306635.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.