Make it list from 1:desired number and then divide everything by 1000.
Best,
Han He
Harvard College Class of 2013
614-329-1324
On Mon, May 10, 2010 at 12:23 PM, Gavinlertvatana, Poj
<pgavinlertvatana at hbs.edu> wrote:
Viral,
This should work, yet get a vector of texts
a<-1:150
b<-ifelse(a<100,ifelse(a<10,"00","0"),"")
paste(b,a,sep="")
Best regards,
Joseph
Joseph Poj Gavinlertvatana
Doctoral student, Marketing
Harvard Business School
Wyss Hall, Soldiers Field, Boston, MA 02163
Ph?? 617.230.5907
Fx?? 617.496.4397
Txt/Vm 617.910.0563
Em pgavinlertvatana at
hbs.edu
From: gov2001-l-bounces at
lists.fas.harvard.edu
[mailto:gov2001-l-bounces at
lists.fas.harvard.edu] On Behalf Of Viral Gandhi
Sent: Monday, May 10, 2010 9:20 AM
To: Class List for Gov 2001/E-2001
Subject: [gov2001] 3 digit numbers
Hi guys,
Does anyone know how to make R write a list like this:
001 002 003 ... 099 100 101 102
i.e. make all the numbers in the sequence have 3 digits.
Thanks,
Viral
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l