Exporting R data frame variable

Brave
New Contributor II

Hi all.

I am trying to export R data frame variable as csv file.

I am using this formula:

df<- data.frame(VALIDADOR_FIM)

df.coalesce(1).write.format("com.databricks.spark.csv").option("header", "true").save("dbfs:/FileStore/df/df.csv")

But isn´t working. How can this as export a csv file?