Search code examples
rcsvgoogle-colaboratory

How download a dataframe with R syntax in Google Colab?


I am using the R syntax in Google Colab. I have a dataframe that I want to download to a csv file. This is how I am using R in Google Colab %load_ext rpy2.ipython


Solution

  • In R you can export a dataframe to a csv by executing

    write.csv(df,"filename.csv", row.names = FALSE)
    

    The execution of this command will result in the creation of the csv file named filename.csv in your colab environment.

    I hope I answered your question, provide more details for further help.