The R Project SVN R

Rev

Rev 24331 | Rev 30193 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24331 Rev 24396
Line 1704... Line 1704...
1704
    file = zz, sep = "\n")
1704
    file = zz, sep = "\n")
1705
cat("One more line\n", file = zz)
1705
cat("One more line\n", file = zz)
1706
close(zz)
1706
close(zz)
1707
 
1707
 
1708
## convert decimal point to comma in output, using a pipe (Unix)
1708
## convert decimal point to comma in output, using a pipe (Unix)
-
 
1709
## both R strings and (probably) the shell need \ doubled
1709
zz <- pipe(paste("sed s/\\./,/ >", "outfile"), "w")
1710
zz <- pipe(paste("sed s/\\\\./,/ >", "outfile"), "w")
1710
cat(format(round(rnorm(100), 4)), sep = "\n", file = zz)
1711
cat(format(round(rnorm(100), 4)), sep = "\n", file = zz)
1711
close(zz)
1712
close(zz)
1712
## now look at the output file:
1713
## now look at the output file:
1713
file.show("outfile", delete.file = TRUE)
1714
file.show("outfile", delete.file = TRUE)
1714
 
1715