[R] For Loop Syntax

2009-04-27 Thread Bronagh Grimes
Hi there, Just wondering if someone can help me with the correct syntax to use with for loops? I have split my original file by count, & wish to first of all assign new tables based on the splits. Then I just want to create a new variable. Please see code below. This code works outsid

Re: [R] Array

2009-04-24 Thread Bronagh Grimes
Thanks for this, will have a look now. Much appreciated, -Original Message- From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk] Sent: 24 April 2009 11:40 To: Bronagh Grimes Cc: r-help@r-project.org Subject: Re: [R] Array Bronagh Grimes wrote: > Just wondering if anyone has any t

[R] Array

2009-04-24 Thread Bronagh Grimes
Hi there, Just wondering if anyone has any tips for using arrays? I am trying to convert the following SAS code to R: data A2; set A1; by subject_id; retain BX1-BX10i; array b(1:10) BX1-BX10 ; if first.subject_id then do ; do j=1 to 10; b(j) =

Re: [R] Running Scripting on Linux Machine

2009-04-23 Thread Bronagh Grimes
Hi there, I am working in SLES / SLED 10. I use ALT+X then SHIFT+R? Many thanks, Bronagh -Original Message- From: Gavin Simpson [mailto:gavin.simp...@ucl.ac.uk] Sent: 23 April 2009 11:44 To: Bronagh Grimes Cc: r-help@r-project.org Subject: RE: [R] Running Scripting on Linux Machine

Re: [R] Aggregate Function

2009-04-23 Thread Bronagh Grimes
Thanks a mil, will try that. -Original Message- From: Petr PIKAL [mailto:petr.pi...@precheza.cz] Sent: 23 April 2009 12:18 To: Bronagh Grimes Cc: r-help@r-project.org Subject: Odp: [R] Aggregate Function Try to set scipen in options. ?options e.g. options(scipen=12) Regards Petr r

[R] Aggregate Function

2009-04-23 Thread Bronagh Grimes
Hi all, I am currently carrying out the following aggregate function: D2 <- with(D1,aggregate(COST, list(FRUIT, VEG),FUN="sum")) The function is working fine but I am getting "sum" output in the following format: 1.750623e+09 How can I re-format the output to look like 1750622640.7? Many than

Re: [R] Running Scripting on Linux Machine

2009-04-23 Thread Bronagh Grimes
iginal Message- From: Gavin Simpson [mailto:gavin.simp...@ucl.ac.uk] Sent: 23 April 2009 09:47 To: Bronagh Grimes Cc: r-help@r-project.org Subject: Re: [R] Running Scripting on Linux Machine On Thu, 2009-04-23 at 09:31 +0100, Bronagh Grimes wrote: > Hi all, > > > > I am new to

[R] Running Edit() or Fix() on Linux Machine

2009-04-23 Thread Bronagh Grimes
Hi all, As I am new to using R on a Linux machine I have another question if that's ok. I am trying to use the fix() or edit() function on this Linux machine but I get the following error message: Error in dataentry(datalist, modes) : invalid device In addition: Warning message: In ed

Re: [R] Running Scripting on Linux Machine

2009-04-23 Thread Bronagh Grimes
Gavin, This is great, thank you. I will have a look at downloading this now. Much appreciated, Bronagh -Original Message- From: Gavin Simpson [mailto:gavin.simp...@ucl.ac.uk] Sent: 23 April 2009 09:47 To: Bronagh Grimes Cc: r-help@r-project.org Subject: Re: [R] Running Scripting on

[R] Running Scripting on Linux Machine

2009-04-23 Thread Bronagh Grimes
Hi all, I am new to using R on a Linux machine & I have a few questions on set-up. If anyone has experience in this area any advice would be greatly appreciated. - When I open R I have the option to do the following: o 'Run in Terminal' o 'Display' o 'Cancel' o 'Run'

Re: [R] Count Code

2009-04-23 Thread Bronagh Grimes
Many thanks for this, I will try this code. Much appreciated. -Original Message- From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk] Sent: 22 April 2009 22:05 To: David Winsemius Cc: Bronagh Grimes; r-help@r-project.org Subject: Re: [R] Count Code David Winsemius wrote: > >

[R] Count Code

2009-04-22 Thread Bronagh Grimes
Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subject_id; if first.subject_id then count = 1; run;

[R] Fix/Edit Error

2009-04-21 Thread Bronagh Grimes
Hi, I am wondering if anyone can help me with the following error. I am using R on a Linux machine and wish to use either the edit or fix function to look at the data. However, we I try to run either of these commands I get the following error Error in data entry(datalist, modes) :