[datatable-help] fread statement for a long data table
Michael Smith
my.r.help at gmail.com
Mon Jul 28 14:42:28 CEST 2014
Does it help if you set `sep="~"`, i.e.
fread("data.txt", sep = "~")
On 07/28/2014 08:24 PM, Frank S. wrote:
> Hi all,
>
>
>
> I've a data base in txt file, which contains approximately **1.5 million
> observations and 18 variables. The aspect of two of the observations
>
> is the following:
>
>
>
> 345~X~99~30/10/1950~89000~784~ERVY LE CHATEL,
> RUE~9~AUXERRE~08500~410005~VISITE
> MEDICALE~20/03/1998~20~UROLOGIE~9~VISITES~5~
>
>
>
> 67895~J~102~28/05/1967~89000~359~CHATILLON SUR SEIENE,
> RUE~10~AUXERRE~08340~560025~ASSURANCE-CRÉDIT~15/09/1997~25~UROLOGIE~1~VISITES~5~
>
>
>
> So, as you can see, the columns are separated by "~" symbol, but there
> is also other symbols: ",", "-", written accents, ... inside some
> descriptive variables. I execute:
>
>
>
> data <- fread('data.txt',autostart=60)
>
>
>
> The R gives an error message in one row
>
>
>
> Error en fread("data.txt", autostart = 60) :
> Expected sep (',') but '' ends field 1 on line 1 when detecting types:
>
>
>
> Please, anyone can help me?
>
>
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
More information about the datatable-help
mailing list