[R] ordering a data.frame by average rank of multiple columns

2007-08-10 Thread Tom.O
Hi I have run into a problem and i wonder if anyone has a smart way of doing this. For example i have this data frame for 5 different test groups: Res1 - c(1,5,4,-0.5,3) Res2 - c(-1,8,2,0,3) Mean - c(0.5,1,1.5,-.5,2) MyFrame - data.frame(Res1,Res2,Mean,row.names=c(G1,G2,G3,G4,G5)) where the

[R] Naming Lists

2007-08-07 Thread Tom.O
Hi Im pretty new to R and I have run in to a problem. How do I name all the levels in this list. Lev1 - c(A1,A2) Lev2 - c(B1,B2) Lev3 - c(C1,C2) MyList - lapply(TEST1,function(x){ assign(x,x,where=1) lapply(TEST2,function(y){ assign(y,y,where=1) lapply(TEST3,function(z){

Re: [R] Naming Lists

2007-08-07 Thread Tom.O
have any suggestions how I could improve the code. Felle free to pass them over, I would be glad for anything. //Tom Charles C. Berry wrote: On Tue, 7 Aug 2007, Tom.O wrote: Hi Im pretty new to R and I have run in to a problem. How do I name all the levels in this list. One way

[R] Finding multiple characters in the same string

2007-08-02 Thread Tom.O
Hi I have this problem where I need to find if there is any numbers in a string, this is no problem if theres only one number per string. I would then simply use the regexpr() funtion togheter with the substring function to exclude the number. But regexpr only picks one number per string either

Re: [R] Finding multiple characters in the same string

2007-08-02 Thread Tom.O
Thanks for the quick reply //Tom Vladimir Eremeev wrote: gregexpr([0-9],this1is2a3test) [[1]] [1] 5 8 10 attr(,match.length) [1] 1 1 1 unlist(gregexpr([0-9],this1is2a3test)) [1] 5 8 10 Tom.O wrote: I have this problem where I need to find if there is any numbers

Re: [R] Create Strings of Column Id's

2007-07-30 Thread Tom.O
Great, That did the trick,thanks. regards Tom jholtman wrote: Is this what you want: paste(-, paste(colnames(MyMatrix)[COL], collapse='-'), sep='') [1] -E-T On 7/26/07, Tom.O [EMAIL PROTECTED] wrote: Does anyone know how this is don? I have a large matrix where I extract

[R] Create Strings of Column Id's

2007-07-26 Thread Tom.O
Does anyone know how this is don? I have a large matrix where I extract specific columns into txt files for further use. To be able to keep track of which txt files contain which columns I want to name the filenames with the column Id's. The most basic example would be to use an for() loop

[R] Barplots: Editing the frequency x-axis names

2007-06-08 Thread Tom.O
Hi I have a timeSeries object (X) with monthly returns. I want to display the returns with a barplot, which I can fix easily. But my problem is labaling the x-axis, if I use the positions from the timeseries It gets very messy. I have tried rotating and changing the font size but it doesn't do

Re: [R] Barplots: Editing the frequency x-axis names

2007-06-08 Thread Tom.O
N 2006-09-30 9 Yes and so on until present Where I want to display all the returns in a barplot, but where I only want to display every quarterly date in the plot??? Tom Knut Krueger-5 wrote: Tom.O schrieb: Hi I have a timeSeries object (X

[R] Is it possible to control R with S+?

2007-05-17 Thread Tom.O
I am currently using S+, which is my company standard econometric package, but unfortunately in some areas R has a lot more to offer in nice functions/libraries. Libraries I would like to use in S+. So I would like to use the R functions by calling on R from S+. For example export the data to be