Re: [R] Help with IF command strings

2013-07-12 Thread arun
Hi, Not sure I understand your question. Suppose `data1` is your real data, but if the column names are different, change V21, V2 by those in the real data. Based on your initial post, the column names seemed to be the same. mean(data1$V21[data1$V2==1|data1$V2==0]) A.K.  What values would I

Re: [R] Help with IF command strings

2013-07-12 Thread arun
Hi, Regarding the 2nd issue of mean=3.8 being too high, could you explain it. #Using the same example:  dat1$V21[dat1$V2==1|dat1$V2==0] #[1]  6  2  1 10  0  (6+2+1+10+0)/5 #[1] 3.8  mean(dat1$V21[dat1$V2==1|dat1$V2==0]) #[1] 3.8 About missing data: set.seed(55) dat2-

Re: [R] Help with IF command strings

2013-07-11 Thread arun
HI, Try this: set.seed(485) dat1- as.data.frame(matrix(sample(0:10,26*10,replace=TRUE),ncol=26)) mean(dat1$V21[dat1$V2==1|dat1$V2==0]) #[1] 3.8 #or with(dat1,mean(V21[V2==1|V2==0])) #[1] 3.8 A.K. I have data in 26 columns, I'm trying to get a mean for column 21 only for the participants that

Re: [R] Help using system() command to execute Perl script through MSDOS

2013-03-07 Thread Marc Schwartz
On Mar 6, 2013, at 8:52 PM, pdbarry pdba...@alaska.edu wrote: I am working on creating a program for some simulations I need to do and I want to execute a Perl script that I wrote using the system() command in R. I have spent a couple days trying to figure this out and it appears that my

[R] Help using system() command to execute Perl script through MSDOS

2013-03-06 Thread pdbarry
I am working on creating a program for some simulations I need to do and I want to execute a Perl script that I wrote using the system() command in R. I have spent a couple days trying to figure this out and it appears that my problem occurs when sending the perl script file path through R to

[R] Help from DOS Command Prompt

2012-07-24 Thread goss
Hi all, I am new to R. I downloaded and installed R 2.15.1 I tried typing R.exe --help at the DOS Command line C:\, but I keep receiving: [quote] R.exe is not recognized as an internal or external command [/quote] I tried many variations of R.exe --help, but roughly the same response Any ideas?

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread Pascal Oettli
Hello, If you want to do it, you can add R.exe in you Path variable. Go to Advanced System Settings, then Environment Variables. But I'm not sure whether it is the best way to use R under Windows. Regards Le 24/07/2012 13:53, goss a écrit : Hi all, I am new to R. I downloaded and

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread Prof Brian Ripley
On 24/07/2012 07:10, Pascal Oettli wrote: Hello, If you want to do it, you can add R.exe in you Path variable. Go to Advanced System Settings, then Environment Variables. But I'm not sure whether it is the best way to use R under Windows. The documentation says to put the *path to* Rterm.exe

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread Pascal Oettli
Hello, Sorry for the mistake. I don't use Windows. Regards Le 24/07/2012 15:56, Prof Brian Ripley a écrit : On 24/07/2012 07:10, Pascal Oettli wrote: Hello, If you want to do it, you can add R.exe in you Path variable. Go to Advanced System Settings, then Environment Variables. But I'm not

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread Jeff Newmiller
For beginners under Windows, running RGui.exe is advisable. I would in addition advise you to set your working directory appropriately (using the menus or setwd) before embarking on significant explorations; avoid using the default save workspace feature (save explicitly if at all); and avoid

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread goss
Thank you all, I tried adding to the path variable ...;C:\Program Files\R\R-2.15.1\bin\x64\R.exe I then entered r.exe --help at the Windows Command Prompt I received the same error message: r.exe is not recognized as an internal or external command, operable program or batch file I tried many

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread jim holtman
The PATH variable is a 'path'; you have specified an executable. Try: ...;C:\Program Files\R\R-2.15.1\bin\x64 On Tue, Jul 24, 2012 at 9:19 AM, goss winston.sny...@gmail.com wrote: Thank you all, I tried adding to the path variable ...;C:\Program Files\R\R-2.15.1\bin\x64\R.exe I then

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread goss
Thanks Jim, I tried ...;C:\Program Files\R\R-2.15.1\bin\x64 and ...;C:\Program Files\R\R-2.15.1\bin\x64\ I still receive the same error message. Thanks w -- View this message in context: http://r.789695.n4.nabble.com/Help-from-DOS-Command-Prompt-tp4637557p4637598.html Sent from the R help

Re: [R] Help from DOS Command Prompt

2012-07-24 Thread Uwe Ligges
On 24.07.2012 15:47, goss wrote: Thanks Jim, I tried ...;C:\Program Files\R\R-2.15.1\bin\x64 and ...;C:\Program Files\R\R-2.15.1\bin\x64\ I still receive the same error message. Can we close this now, please? 1. Learn to write messages to R-help, R-help is not Nabble and we need the

[R] help in paste command

2012-04-05 Thread arunkumar1111
i have a character variable tablename=DressMaterials var1=(red,blue,green,white) My output should be like select * from DressMaterialswhere colors in (red,blue,green,white) i'm not able to get the where part. my code paste(select * from , tablename , where colors in ,paste(var1,

Re: [R] help in paste command

2012-04-05 Thread mlell08
Hello Arun, paste(select * from , tablename , where colors in (,paste(var1,collapse=,),)) [1] select * from DressMaterials where colors in ( red,blue,green,white ) Regards! __ R-help@r-project.org mailing list

Re: [R] help in paste command

2012-04-05 Thread David Winsemius
On Apr 5, 2012, at 8:55 AM, arunkumar wrote: i have a character variable tablename=DressMaterials var1=(red,blue,green,white) My output should be like select * from DressMaterialswhere colors in (red,blue,green,white) i'm not able to get the where part. ?match my code

Re: [R] help in paste command

2012-04-05 Thread arunkumar1111
Thanks Lell It worked well. - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-paste-command-tp4534756p4534925.html Sent from the R help mailing list archive at Nabble.com. __

[R] help with by command

2011-08-24 Thread amalka
Hello, I am a new user of R, and I'd be grateful if someone could help me with the following: I would like to compute the mean of variable trust in dataframe foo, but separately for each level of variable V2. That is, I'd like to compute the mean of trust at each level of V2. I have done this:

Re: [R] help with by command

2011-08-24 Thread Jorge I Velez
Hi Ari, Try this instead with(foo, tapply(V2, trust, mean, na.rm = TRUE)) See ?tapply and ?with for more information. HTH, Jorge On Wed, Aug 24, 2011 at 2:51 PM, amalka wrote: Hello, I am a new user of R, and I'd be grateful if someone could help me with the following: I would like