Movatterモバイル変換


[0]ホーム

URL:


rdrr.io

writeLines: Write Lines to a Connection

writeLinesR Documentation

Write Lines to a Connection

Description

Write text lines to a connection.

Usage

writeLines(text, con = stdout(), sep = "\n", useBytes = FALSE)

Arguments

text

A character vector

con

A connection object or a character string.

sep

character string. A string to be written to the connectionafter each line of text.

useBytes

logical. See ‘Details’.

Details

If thecon is a character string, the function callsfile to obtain a file connection which is opened forthe duration of the function call.(tilde expansion of the file path is done byfile.)

If the connection is open it is written from its current position.If it is not open, it is opened for the duration of the call in"wt" mode and then closed again.

NormallywriteLines is used with a text-mode connection, and thedefault separator is converted to the normal separator for thatplatform (LF on Unix/Linux, CRLF on Windows). For more control, opena binary connection and specify the precise value you want written tothe file insep. For even more control, usewriteChar on a binary connection.

useBytes is for expert use. Normally (when false) characterstrings with marked encodings are converted to the current encodingbefore being passed to the connection (which might do furtherre-encoding).useBytes = TRUE suppresses the re-encoding ofmarked strings so they are passed byte-by-byte to the connection:this can be useful when strings have already been re-encoded bye.g.iconv. (It is invoked automatically for stringswith marked encoding"bytes".)

See Also

connections,writeChar,writeBin,readLines,cat


What can we improve?

R Package Documentation

Browse R Packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, readEmbedding Snippets.

Close

[8]ページ先頭

©2009-2025 Movatter.jp