[R] How to strip everything after second whitespace?

2009-11-06 Thread johannes rara
How to split everything after second whitespace char using regular expression? I want to remove A, B, C and D from these names: nam - c(Smith John A, Smith David B C, Smith Ryan C D) Thanks, Johannes __ R-help@r-project.org mailing list

[R] how can I delete those columes with the same element in every row?

2009-11-06 Thread bbslover
e.g. a= a b c d e 1 1 1 3 1 1 2 1 2 3 4 5 3 1 3 3 8 3 4 1 4 3 3 5 5 1 1 3 1 1I want to delete colume a and colume c, because they have the same values in every row, then ,I want to get this data.frame . b= b d e 1 1 1 1 2 2 4 5 3 3 8 3 4 4 3 5 5 1 1 1the following

[R] another question: how to delete one of columes in two ones with high correlation(0.95)

2009-11-06 Thread bbslover
my programe is below: a=c(1,2,1,1,1); b=c(1,2,3,4,1); c=c(3,4,3,3,3); d=c(1,2,3,5,1); e=c(1,5,3,5,1) data.f=data.frame(a,b,c,d,e) origin.data-data.f cor.matrix-cor(origin.data) origin.cor-cor.matrix m-0 for(i in 1:(cor.matrix[1]-1)) { for(j in (i+1):(cor.matrix[2])) { if

[R] How to test user-defined distribution using ks.test in R?

2009-11-06 Thread Zhijiang Wang
Dear All, I defined a distribution and I want to test it by k-s test? How to input parameters for ks.test(.)? E.g., F(x,m) is user-defined function x is observation value, m is parameter of F y is observation vector value in experiment ks.test(y,F,m=0.2) error why? ' -- Best

[R] Plotting with Hebrew text

2009-11-06 Thread Tal Galili
Hello all, I imported a txt file with Hebrew column names, and wish to use them for my plots. I found that the Hebrew text is jumbled (Example: .áéèçåï.òöîé.) How do I fix it so to be able to see the characters in a correct way ? Thanks, Tal --

Re: [R] Enrolling to R help mailing list

2009-11-06 Thread Ted Harding
On 06-Nov-09 07:17:06, Julia Cairns wrote: Hi How do I enroll to this R help mailing list? Julia Please visit the R-help Info web-page: https://stat.ethz.ch/mailman/listinfo/r-help and follow the instructions there for subscribing. Best wishes, Ted.

Re: [R] new help pages in R 2.10.0

2009-11-06 Thread Peter Ehlers
Robert Baer wrote: I think the html based one works fine (even if I definitely preferred the old chtml). Only another comment: I chose html in my installation with Windows Vista, but still the help pages are opened in text files in the newly installed version. The nice thing about the

Re: [R] How to strip everything after second whitespace?

2009-11-06 Thread Linlin Yan
Try this: gsub(([a-z]*\\s[a-z]*).*, \\1, nam) [1] Smith John Smith David Smith Ryan On Fri, Nov 6, 2009 at 4:11 PM, johannes rara johannesr...@gmail.com wrote: How to split everything after second whitespace char using regular expression? I want to remove A, B, C and D from these names: nam

Re: [R] collumn error when exporting to Excel

2009-11-06 Thread Petr PIKAL
Or use write.table(object, clipboard, sep=\t, row.names=F) and press Ctrl V in empty excell sheet. Regards Petr r-help-boun...@r-project.org napsal dne 05.11.2009 14:59:19: try using 'write.csv' to create the file you want to import to EXCEL On Thu, Nov 5, 2009 at 4:56 AM, Hayes, Daniel

Re: [R] NLM OUTPUT

2009-11-06 Thread Peter Ehlers
Bob, I very strongly suggest that you do two things: 1. look at help(str); then get in the habit of using the str() function frequently. 2. peruse An Introduction to R, especially Chapter 6 which would have solved your problem. Regards, -Peter Ehlers robertag...@discover.com wrote:

Re: [R] how can I delete those columes with the same element in every row?

2009-11-06 Thread Berend Hasselman
bbslover wrote: e.g. a= a b c d e 1 1 1 3 1 1 2 1 2 3 4 5 3 1 3 3 8 3 4 1 4 3 3 5 5 1 1 3 1 1I want to delete colume a and colume c, because they have the same values in every row, then ,I want to get this data.frame . b= b d e 1 1 1 1 2 2 4 5 3 3 8 3 4

Re: [R] performing operations on a dataframe

2009-11-06 Thread Uwe Ligges
Jim Lemon wrote: On 11/06/2009 05:30 AM, Lanna Jin wrote: Hey all, I feel like the solution to this problem should be relatively simple, but for some reason I can't find answers or come up with my own solution. Given the dataframe: (SpA and SpB not important, want to look at distribution of

[R] Antw: Re: compiling R-2.9.2 or R-2.10.0 on ubuntu 9.04 (powerpc)

2009-11-06 Thread Laurin Müller
That helped! I did not knew the build-dep option. Thanks a lot. laurin Ista Zahn istaz...@gmail.com 05.11.2009 13:42 Hi, The easiest way to get everything you need is sudo apt-get build-dep r-base -Ista On Thu, Nov 5, 2009 at 4:13 AM, cremi laurin.muel...@umit.at wrote: I habe

Re: [R] partitioning chi-square statistic (g squared)

2009-11-06 Thread Peter Ehlers
christopher compeau wrote: hi all - is there a package or library that contains a function for partitioning the chi-square statistic of an I X J contingency table into its respective independent parts? Do you mean the chisquare contribution from each cell in the table? If so, just square the