I don't want to write a csv into a file, but to get a string representation of the dataframe with a csv format (to send it over the network).
I'm using R.NET, if it helps to know.
If you are not limited to base functions, you may try readr::format_csv.
library(readr)
format_csv(iris[1:2, 1:3])
# [1] "Sepal.Length,Sepal.Width,Petal.Length\n5.1,3.5,1.4\n4.9,3.0,1.4\n"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With