fillLines | R Documentation |
Fill delimited lines with NA values
fillLines(object, format = c("csv", "tsv"))
object |
|
format |
|
character
.
Modified character vector, with consistent number of delimited values.
Updated 2023-09-27.
textConnection
: For import approach after modification.
## character ====
## CSV format.
object <- c(
"\"aaa\",\"bbb\",\"ccc\",\"ddd\"",
"\"eee\",\"fff\",\"ggg\"",
"\"hhh\",\"iii\""
)
print(object)
object <- fillLines(object, format = "csv")
print(object)
con <- textConnection(object)
object <- import(con, format = "csv")
print(object)
close(con)
## TSV format.
object <- c(
"aaa\tbbb\tccc\tddd",
"eee\tfff\tggg",
"hhh\tiii"
)
print(object)
object <- fillLines(object, format = "tsv")
print(object)
con <- textConnection(object)
object <- import(con, format = "tsv")
print(object)
close(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.