[R] read.table (again)

Chuck Cleland ccleland at optonline.net
Wed Nov 4 11:14:17 CET 2009


On 11/4/2009 5:03 AM, Sybille Wendel (Udata) wrote:
> Dear R commnuity,
> 
> Thanks a lot for your help.
> I want to read in tables, the problem is that the table is composed in a
> difficult way. In ariginal it looks like this:
> 
> 669 736 842101610481029114711811166124312081128117611221026 9581024 992
> 685 720 829 925 995 96010241057116611501104106410711092 983 908 989 904
> 924 896 882 897 909 933 928 907 916 902
> 546 734 784 868 970 954 99210061012101610481045 9821057 989 914 956 960
> 948 947 949 939 916 950
> 562 598 771 827 941 922 905 877 860 862 931 952 954 977 960 901 978 975
> 970 950 973 953 958 931 912
> 558 593 725 786 884 866 838 797 815 802 809 822 853 833 863 852 903
> 9861015 9841019 993 955 932 918 874 518 580 600 764 834 804 814 824 849
> 831 939 757 769 790 809 892 89810251028104410371018 985 932
> 478 559 585 696 812 812 811 867 854 811 814 818 793 760 814 976
> 957104510551067106410501005 948
> 465 528 567 619 703 828 824 830 851 824 823 873 826 787 787
> 9791048105710621083108910841027 944
> 
> That is, that every 4 digits there is a new number, but when the number
> is > 999, R thinks of course that the number consists of more than 4
> digits. So, R can't read in the table.
> Is there a way I can tell R, that every 4 digits, a new number begins?

?read.fwf

> I treif different things with "sep".
> data <- read.table ("RA19930101.txt",header=F,sep=)
> 
> Thanks for your help again in this topic.
> Sybille 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894




More information about the R-help mailing list