To export a list as a CSV file in R, you can use the write.csv()
function. Here's an example:
main.r237 chars8 lines
In this example, we first create a list called my_list
that contains three vectors: names
, ages
, and colors
. We then use the write.csv()
function to write this list to a CSV file called "my_list.csv"
.
Note that the resulting CSV file will have each vector of the list as a separate column, and the row names of the list will become the first column of the CSV file.
gistlibby LogSnag