Re: [R] SAS Macro Variable in R

2009-06-23 Thread Don MacQueen
I typically do something like this: nm <- 'TEF' ## split into multiple lines only to make it easier to read dpath <- paste('http:// ichart.yahoo.com/table.csv?s=', nm, '.MC&a=00&b=1&c=2003&d=05&e=23&f=2009&g=d&ignore=.csv', sep='') download.file( dpath, 'c:\\projects\

Re: [R] SAS Macro Variable in R

2009-06-23 Thread Thomas Lumley
On Tue, 23 Jun 2009, David Young wrote: Hi I'm new to R and would like to implement a SAS-like macro variable in R. What I'd like to do is take the simple R code below and change the "=TEF" to different letters to refer to different companies' data for download. # DOWNLOADS FILES FROM YAHOO IN

Re: [R] SAS Macro Variable in R

2009-06-23 Thread David Huffer
On Tuesday, June 23, 2009 1:40 PM, David Young wrote: > ...Hi I'm new to R and would like to > implement a SAS-like macro variable in R. > What I'd like to do is take the simple R > code below and change the "=TEF" to > different letters to refer to different > c

Re: [R] SAS Macro Variable in R

2009-06-23 Thread Henrique Dallazuanna
You can use sprintf: u <- sprintf(' http://ichart.yahoo.com/table.csv?s=%s.MC&a=00&b=1&c=2003&d=05&e=23&f=2009&g=d&ignore=.csv', "TEF") download.file(u, 'c:\\projects\\stock data\\data\\test.csv',quiet=TR

[R] SAS Macro Variable in R

2009-06-23 Thread David Young
Hi I'm new to R and would like to implement a SAS-like macro variable in R. What I'd like to do is take the simple R code below and change the "=TEF" to different letters to refer to different companies' data for download. # DOWNLOADS FILES FROM YAHOO INTERNET download.file('http://ichart.yahoo.c