Description Usage Arguments Examples
These functions provide a reasonably automatic way of preserving the row names of data frame during back-and-forth translation to a SQL table. By default, row names will be converted to an explicit column called "row_names", and any query returning a column called "row_names" will have those automatically set as row names.
1 2 3 | rownamesToColumn(df, row.names = NA)
columnToRownames(df, row.names = NA)
|
df |
A data frame |
row.names |
Either If A string is equivalent to For backward compatibility, |
1 2 3 4 5 6 7 8 9 | # If have row names
rownamesToColumn(head(mtcars))
rownamesToColumn(head(mtcars), FALSE)
rownamesToColumn(head(mtcars), "ROWNAMES")
# If don't have
rownamesToColumn(head(iris))
rownamesToColumn(head(iris), TRUE)
rownamesToColumn(head(iris), "ROWNAMES")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.