Steven Kang
2009-Sep-18 05:46 UTC
[R] Suppressing script commands in R console when executing long program
Hi R users, I have a script composing of more than 1000 lines and would like suppress the R codes from the console when executing the script (to reduce the physical processing time) I have tried options(echo=T) but no luck.. *Q1. Are there any way of suppressing the commands in the R console?* Also, when importing spreadsheet consisting of numbers with 1,000 separator commas (i.e 10000 as 10,000) into R and performing basic arithmetic, R does not seem to recognise these separators.. *Q2. Is R capable of reading numbers that are represented with 1,000 separator commas?* ** Many thanks for your expertise in resolving these problems. Steven [[alternative HTML version deleted]]
Ishwor
2009-Sep-18 08:03 UTC
[R] Suppressing script commands in R console when executing long program
Steve. Hi.> I have a script composing of more than 1000 lines and would like suppress > the R codes from the console when executing the script (to reduce the > physical processing time) > > I have tried options(echo=T) but no luck.. > > *Q1. Are there any way of suppressing the commands in the R console?* > > Also, when importing spreadsheet consisting of numbers with 1,000 separator > commas (i.e 10000 as 10,000) into R ?and performing basic arithmetic, R does > not seem to recognise these separators.. > > *Q2. Is R capable of reading numbers that are represented with 1,000 > separator commas?* > ** > Many thanks for your expertise in resolving these problems.You can try putting this in your Rprofile options("keep.source=F") This will work in the R cmd but it will not work in the RGui Goodluck! :-) -- Regards, Ishwor Gurung
Philipp Pagel
2009-Sep-18 10:59 UTC
[R] Suppressing script commands in R console when executing long program
On Fri, Sep 18, 2009 at 03:46:27PM +1000, Steven Kang wrote:> *Q1. Are there any way of suppressing the commands in the R console?*I think this has been answered already.> *Q2. Is R capable of reading numbers that are represented with 1,000 > separator commas?*I am not aware of an option to read.table and freinds that does this but you can recover easily:> foo <- read.delim('foo.tbl') > fooA B 1 1 12,300 2 2 256,001.01 3 3 900.1 4 4 80> str(foo)'data.frame': 4 obs. of 2 variables: $ A: int 1 2 3 4 $ B: Factor w/ 4 levels "12,300","256,001.01",..: 1 2 4 3> foo$B <- as.numeric(sub(',', '', as.character(foo$B))) > fooA B 1 1 12300.0 2 2 256001.0 3 3 900.1 4 4 80.0> str(foo)'data.frame': 4 obs. of 2 variables: $ A: int 1 2 3 4 $ B: num 12300 256001 900 80 cu Philipp -- Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan 85350 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/