[R] for loop and if problem

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jan 12 17:26:35 CET 2009


There is write.csv2 on the same help page as write.csv!

      'write.csv' uses '"."' for the decimal point and a comma for the
      separator.

      'write.csv2' uses a comma for the decimal point and a semicolon
      for the separator, the Excel convention for CSV files in some
      Western European locales.

I've never seen a CSV file with ; that used . for the decimal point, 
so check out if you really want write.csv2.

On Mon, 12 Jan 2009, jim holtman wrote:

> Try using:
>
> write.table(..., sep=";")
>
> write.csv just calls write.table
>
> On Mon, Jan 12, 2009 at 6:38 AM, Sake <tlep.nav.ekas at hccnet.nl> wrote:
>>
>> I have one final question...
>> How can I save a CSV ifile with ; separation in stead of , separation?
>> I know the write.csv(file="filename.csv") an that you can use sep=";" when
>> you open a .csv file, but that doesn't work with the write.csv command.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list