Export Data from R (csv , txt and other formats) | R Tutorial 1.6 | MarinStatsLectures



Export data out of R: How to Export Data out of R and Save in Various Formats: csv, tab-delimited, space-delimited. Find the Practice Dataset(DataToExport) and R Script: ( 👍🏼Best Statistics & R Programming Language Tutorials: ( )

►► Like to support us? You can Donate ( Share our Videos, Leave us a Comment and Give us a Thumbs up! Either way We Thank You!

How to export data out of R and save in various formats such as csv, tab-delimited, space-delimited:
▶︎ In this R programming video tutorial, you will learn to use various R functions such as “write.table”, “write.csv”, “write.csv2”, “write.command” and “write.delim” to export data out of R.
▶︎ In this tutorial, you will learn to use “sep” argument to specify the file format or separator for the values, “row.names” argument to include or exclude the row names.

◼︎ Table of Content:

0:00:34 Introducing the ‘write. table’ command for exporting data out of R.
0:00:39 How to access the help menu for a command in R
0:00:53 How to use the ‘write.table’ command in R Software
0:01:08 How to use “sep” argument to specify the file format or separator for the values in R
0:01:50 How to include or exclude the row names while exporting data out of R Programming software using ‘row.names’ argument
0:02:21 How to save file exported from R to a folder other than the current working directory:
0:03:01 How to use the “write.csv” command to export data from R (this will not require using “sep” argument as it is implied in the write.csv that we would like this to be saved as a comma separated value file)
0:03:22 a quick overview of “write.csv2” command that is used in Western Europe and would use a comma for a decimal point and a semicolon for a separator rather than a comma
0:03:33 How to use write.command in for saving in other file formats for example a tab delimited text file

These video tutorials are useful for anyone interested in learning data science and statistics with R programming language using RStudio.

► ► Watch More:

► Intro to Statistics Course:
►Data Science with R
►Getting Started with R (Series 1):
►Graphs and Descriptive Statistics in R (Series 2):
►Probability distributions in R (Series 3):
►Bivariate analysis in R (Series 4):
►Linear Regression in R (Series 5):
►ANOVA Concept and with R
►Hypothesis Testing:
►Linear Regression Concept and with R Lectures

Follow MarinStatsLectures

Subscribe:
website:
Facebook:
Twitter:
Instagram:

Our Team:
Content Creator: Mike Marin (B.Sc., MSc.) Senior Instructor at UBC.
Producer and Creative Manager: Ladan Hamadani (B.Sc., BA., MPH)

These videos are created by #marinstatslectures to support some courses at The University of British Columbia (UBC) (#IntroductoryStatistics and #RVideoTutorials for Health Science Research), although we make all videos available to the everyone everywhere for free.

Thanks for watching! Have fun and remember that statistics is almost as beautiful as a unicorn!

source

43 Comments

  1. In this R stats video, we learn to use various R functions such as "write.table", "write.csv", "write.csv2", “write.command” and "write.delim" to export data out of R and save in various formats such as csv, tab-delimited, space-delimited. Make sure to practice with the free Dataset(‘DataToExport’) and R Script here: (https://bit.ly/2rOfgEJ); ) If Like to support us you can Donate (https://bit.ly/2CWxnP2), Share our Videos, Leave us a Comment, Give us a Like 👍🏼 or write us a review! Either way We Thank You!

  2. i have a data imported using GetSymbols (quantmod), and tried to export it in excel sheet. Yet, using write.table command, the date column is left out. Please suggest what best to do.. thank you!

  3. Many thanks. Your students are very previliged and lucky to have you as their professor. You are such a wonderful instructor capable of making complex topics so easy to understand. God bless you and your entire team behind these videos including your little son whose voice appears at the end of some of stats /R these videos.

  4. I exported data using the write.csv function, but the table gets truncated. The original table has 4,073,561 rows, but the csv file has about 700,000 rows. Please how do I rectify this?

  5. Cool, very nice and to the point, I wasted half hour trying to do it using websites and blogs, they all overcomplicated things, this is so much easier, R is easy if some wankers don't try to make it look difficult (ps. sorry that I said it like that).

  6. The 2nd step where you attempt to set row.names = f does not work. It produces an error message "Error in isTRUE(row.names) : object 'f' not found"

  7. Hi Marin, I'd like calculate the odds radio with library "finalfit", buy I can't open my data set, which is .sav (spss file). Do you now a form to open this file and calculate the odds radio?, please. Thank you

  8. Hello thanks for the tutorial, do you know the best way to export data produced with lavaan? I created a df with the summary of cfa but it came up all wrangled up, no headers or nothing.

  9. Hello, I'm trying to export a table by Power Query using R, I tried the following code

    # 'dataset' has input data for this script

    write.table (dataset, file = paste0 ("C: / Users / Acer / OneDrive / ALLPARTS / VIN_", Sys.time (), ".csv"))

    I want to save it with the date so I don't overlap my files, can you help me? Do you have another suggestion? I wanted a date format that was yyyymmdd. It's possible?

    Thank's for your time!

  10. Hello Mike,
    When I export my data as .csv and open it in Excel, all data are fit in only one column and data in the same row are seperated by commas. How can I solve this problem? Thanks for the videos by the way.

Leave a Reply

Your email address will not be published. Required fields are marked *

You might like

© 2026 Cantinho do Vídeo - WordPress Video Theme by WPEnjoy