Import Data, Copy Data from Excel to R CSV & TXT Files | R Tutorial 1.5 | MarinStatsLectures
HTML-код
- Опубликовано: 22 авг 2024
- Import Data, Copy Data from Excel (or other spreadsheets) to R: CSV & TXT Files with Free Practice Dataset: (bit.ly/2rOfgEJ) 👍🏼Best Statistics & R Programming Language Tutorials: ( goo.gl/4vDQzT )
►► Like to support us? You can Donate (bit.ly/2CWxnP2), Share our Videos, Leave us a Comment and Give us a Like! Either way We Thank You!
How to Import CSV data into R or How to Import TXT files into R from Excel or other spreadsheets using function in R
►How to import CSV data into R? We will be using "read.table" function to import comma separated data into R
► How to import txt data file into R? You will learn to use "read.delim" function to import the tab-delimited text file into R
► You will also learn to use "file.choose" argument for file location, "header" argument to let R know the data has headers or variable names and "sep" argument to let R know how the data values are separated.
►►Download the dataset here: statslectures....
►►Like to support us? You can Donate bit.ly/2CWxnP2 or Share the Videos!
►► Watch More:
► Intro to Statistics Course: bit.ly/2SQOxDH
►R Tutorials for Data Science bit.ly/1A1Pixc
►Getting Started with R (Series 1): bit.ly/2PkTneg
►Graphs and Descriptive Statistics in R (Series 2): bit.ly/2PkTneg
►Probability distributions in R (Series 3): bit.ly/2AT3wpI
►Bivariate analysis in R (Series 4): bit.ly/2SXvcRi
►Linear Regression in R (Series 5): bit.ly/1iytAtm
►ANOVA series bit.ly/2zBwjgL
►Linear Regression Concept and with R bit.ly/2z8fXg1
►Puppet Master of Statistics: bit.ly/2RDAAv4
►Hypothesis Testing: Concepts in Statistics bit.ly/2Ff3J9e
◼︎ Table of Content
0:00:17 What are the two main file types for saving a data file (CSV and TXT)
0:00:36 How to save an Excel file as a CSV file (comma-separated value)
0:01:10 How to open a CSV data file in Excel
0:01:20 How to open a CSV file in a text editor
0:01:36 How to import CSV file into R? using read.csv function
0:01:44 How to access the help menu for different commands/functions in R
0:02:04 How to specify file location for R? using file.choose argument on read.csv function
0:02:31 How to let R know our data has headers or variable names when importing the data into R? By using the “header” argument on read.csv function
0:03:22 How to import CSV file into R? using read.table function
0:03:38 How to specify the file location for the read.table function in R? using file.choose argument
0:03:46 How to specify how variables/columns are separated when importing data into R? the "sep" argument on read.table function will do that; for example if you don't specify that your data is comma separated, R ends up reading it all in as one variable
0:04:10 How to save a file in Excel as tab-delimited text (TXT) file
0:04:50 How to open a tab-delimited (.TXT) data file in a text editor
0:05:07 How to open a tab-delimited (.TXT) data file in excel
0:05:20 How to import tab-delimited (.TXT) data file into R? using read.delim function
0:05:44 How to specify the file path for read.delim function in R? using file.choose argument
0:06:06 How to import tab-delimited (.TXT) data file into R? using read.table function
0:06:23 How to specify that the data has headers or variable names when importing the data into R? using header argument on read.table function
This video is a tutorial for programming in R Statistical Software for beginners, using RStudio.
Follow MarinStatsLectures
Subscribe: goo.gl/4vDQzT
website: statslectures.com
Facebook:goo.gl/qYQavS
Twitter:goo.gl/393AQG
Instagram: goo.gl/fdPiDn
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!
In this R video tutorial, you will learn step by step how to import CSV data file or TXT data file into R from Excel or other spreadsheets using different functions and arguments of R. For example, you will learn to use "read.table" and "read.delim" functions and "file.choose", "header" and "sep" arguments. All these and more will help you import your data into R very easily. For example, if you don't specify that your data is comma separated, R ends up reading it all as one variable so using (sep=",") will help avoid this issue. Make sure to Download the datasets for practice: statslectures.com/r-scripts-datasets and if you Like to support us, you can donate here bit.ly/2CWxnP2 or share our videos with others!
Ok thank u👍
When I input the data class always shows object not found
pls help me
Trust me sir. After trying various various online tutorials and e-books, I am writing this review. These videos are the most amazing videos on R one could ever discover and it is almost impossible for anyone to not praise you for this awesome help you are doing to people who cannot afford to take courses. You will always be blessed for this help you are doing to thousands of people. I will make sure that all my friends in my college will watch these videos and get benefited.
Thanks a ton again sir. Keep up the good work going. You are truly loved by all of us here who are on your page.
Vamsi Krishna.
Hi +vamsi24791 , thanks, we really appreciate you saying that! it's hearing things like this that help motivate us to keep producing these videos, so thank you for that!
Thanks, glad to know you're finding them useful...we've put a lot of work into them. Thanks for watching ;-)
Finally handy videos extremely helpful for a guy aged 58 wanting to fill the technological gap and for the first time ever seriously considering investin time and energy in R and progressevely make the transition from Excel
Without having any background knowledge about r, I could analyze my data for MSc thesis really well by following your amazing videos. You high quality tutorials are really helpful, thank you very much.
happy to hear that!
I know this video was posted years ago but I just wanted to say thank you! My professor at uni said that R was much better than excel once you got to grips with the coding language but unfortunately the uni only offers courses on using excel for data analysis. I'm so excited to start using these skills for writing papers and not having to deal with the whole messiness of excel.
This is the first excel datasheet I ever read in R. After 7 years with R, I thought I would visit Marinstats....It was a great start. Thanks.
How good did you get in R?
Thank you a bunch been screaming at the PC for hours only to find the header= TRUE would fix all my class issues.
Hello good sir! I would like to personally thank you on the behalf of graduate students everywhere, who are being introduced to R for the very first time. You are a life saver.
Cheers sir!
Thanks 1917cutlass , we really appreciate hearing you say that! We've put a lot of work into producing these, and happy to hear that they are having such an impact!
Wow, high quality lectures, very thouroughly designed, covering everything, easily understood by beginners + free?! You have a new subscriber, keep making these!
all the things крипто-анархисты said plusTHANK YOUUU. WAS HELPFUL. keep doing this videos of R so i can learn more and MOORE
Thanks крипто-анархисты and Lissette Rodriguez , we appreciate you saying that! and yes, our goal is to provide the best tutorials available online, and free! this summer we are hoping to create a series of videos teaching general statistical concepts, so keep your eyes out for those! thanks for the support!
Hi ***** , you have your youtube settings set so that i can not reply to your comment, so i hope you see this message here. the reason that your data appears as one column is that you have not specified how variables are separated correctly. (e.g.) if the data is separated using commas: 5,15,female,smoke,... and you don't tell R that it is comma separated, using *sep=","*, the R ends up reading it all in as one variable...as it does not know what separates each of the variables/columns. so yo need to check how your data is separated, and make sure to specify that correctly.
the problem with the rows, is most likely not a problem. the data viewer in RStudio only shows at most 1000 rows, so it is likely that all of the rows have been read in, but that RStudio only shows 1000 of them. you can type *dim(data)*, replacing data with the name you've given your data, so see the # of rows/columns in it, or look in the top-right corner of RStudio in the workspace, and it will show the name of the data, along with the number of observations and number of variables.
Thank you for this!!! Spent 2 hours googling and getting irritated at all the patronising "help" blogs and the help sites full of computer jargon but finally cracked it.
happy to help TheMadKaz
You're way more that a teacher! I'm really really grateful : D
you are the father of my kids
Thank you so much. For someone like me with zero programming/coding background, you gave me an eureka moment.
Thanks for sharing your knowledge with us!!!! The World needs more people like you. Greetings from Brazil.
thanks +Lukas Iohan , we appreciate that!
You make it so easy. Thanks, that's the second time I watch your videos. The first time I saw it all, after that I couldn't find anyone that explains like you do, I left it and I forgot it all. Now I'm back and you have even more videos :D
I've tried so hard finding why I couldn't input my csv data, since I just started R Studio. Thank you very much!!! Especially the first half part already solved my problem! Thanks!
Hi Jianzhe Liu , glad to hear your problem is solved!
Thanks a million for making R tutorials without JARGON!!!! Yay!!
you're welcome +Kelly Lyons ! and i agree with you sentiment...while jargon is important in a discipline, it often only means something to one who already understands the concept...and gets in the way of learning for those who don't yet know the concept!
best R tutorials on RUclips...
for someone like me you are an angel i struggled so much with it.
Congratulations to MarinStatsLectures Your presentation is very clear. The explanations are direct, very simple to use Thanks a lot From Paris Thursday 4 June 2020 15h26
Thanks for watching Gustavo!! We use many different softwares to put them together. Mainly Camtasia and Snaggit to do the screen captures and some of the editing. Then a bit of iMovie for editing as well as photoshop and powerpoint for creating some of the visuals, and a few other programs here and there when little specific things are needed.
Hi Marin, Most straight forward and easy approach
Your lectures and teaching style have left me speechless. Thank you very much..!!
great to hear, thanks!
Dude I want to thank you so much. You are helping me learn so much that my uni lecturers miss out
great to hear +299redd , and you're welcome!
you are literally a grade saver. I'm so happy I found your channel. Thank you very very much :)
Madelina Nowak-Roddy you're welcome, glad you've found our videos helpful!
This is just Excellent. After some traumatic experiences trying to learn to program, you made me have a bit of hope. You got a new subscriber!
glad to hear you're finding them helpful Xavier Haro !
Hey Mike,huge fan of your videos .Just for FYI the data sets you have attached has 725 obs.of 6 variables.(probably duplication of data)This is trivial information with no impact whatsoever on the steps to retrieve an excel file. First time viewers may be wondering about the large nature of the data set. Cheers
Thanks. Glad to hear you’re enjoying them :)
Mike, You are awesome. Thanks buddy for such a succinct demonstration. Really plausible.
most straight forward and easy approach
thank you so much
Best channel for R tutorials
thanks +Kushal Miglani , we appreciate that!
Thanks....by far it is the best ..simple and effective....others kept on talking about getwd and setwd...which i found quite difficult...so it really helped...thank you marin
Excellent! Thank you for all your great tutorials. I'm new to this and you keep it simple enough for beginners to understand. Much appreciated.
You're welcome ***** , glad you find them useful!
May Allah bless you in abundance, you are a HERO for saving my life.
love his channel so much, you helped me a lot, I was having a hard time using statistic with R, not a lot of courses about it,keep up the good work.
one of the best tutorials I found on the subject. Thank you very much.
thanks. and you're welcome :)
oh my god !!! these are best collection of R tutorials !!!
thanks +puja khunti , e appreciate that!
You rock. Thank you for making this straightforward.
Best tutorial ever, you certainly have a teaching soul... congrats. Wish you all the best.
thanks +Gabriel Barros , appreciate that!
great video, I spend hours on importing basic matrices. This video explains it in 5 minutes
Thanks Tom Hermans , glad to hear you're finding our videos useful! Thanks for watching!
Great job with the videos Mike! There are only few things in this world for which you can say "Can't make it better".
I love these! Thank you for making them freely available. You got yourself a new subscriber.
You're welcome Olsjon Baxhija !
All the things крипто-анархисты said plusTHANK YOUUU. WAS HELPFUL. keep doing this videos of R so i can learn more and MOORE
Hey Marin, You Rock.. You made easy to learn some thing diff from books..Kudos for your effort.. You are a grt faculty/Teacher..
Thanks sanjeeb kumar ! Our goal was to provide the best resource for an intro to R on RUclips! We plan on making general stats educational videos as well, once we have the time, so keep your eyes out for those when we get to making them. thanks for your support!
God bless you for simplifying this.
Thanks Mike. Your video really makes my life simple!
good to hear :)
you are a life saver! thank you for these videos, you cover so many commands and make it so simple and easy to follow. thank you thank you.
You're welcome +I Bee !
totally forgot how to do some of these simple things very quick and helpful video, thank you!
You're very welcome treescully , thanks for watching!
very helpful! the best explained tutorials i've seen yet on R in youtube.
Thanks +Nicolas Balmaceda we appreciate that!
Nice illustration, thanks Marin for keeping it very simple.
You're welcome vs123 !
Thank you thank you! Your a life saver! Was struggling so much with my stats assignment but now I finally understand it!
Thanks a lot for making such an amazing video. It was very easy. God bless you.
Thank you so much! Your tutorial helped me a lot. Once again THANK YOU!
Thank you very much. It is very helpful. This is what I have been looking for since most of my data are in Excel sheets.
Thanks Dyokoto , glad to hear it has been helpful!
Thanks for explaining in the simplest way.I am looking for other videos for processing data.
Best Regards
Partha
You're welcome Hassan Parthasarathy !
Thank you for sharing stuff of such quality for free . God bless!
You're welcome Oh! Nyx
Great instructions for a R Programming newbie.
Thanks Wisdom and Peace !
THIS. IS. SO. HELPFUL.
god bless you as you spread the knowledge for needy people god will enhance your courage and do more in depth of r
Very, very helpful - thank you MarinStatsLectures!
You're welcome Matthew Ott , glad you found them helpful!
Very helpful! Thank you, Mike and Ladan.
Awesome and very useful. I subscribed to your channel! The command you introduced to open a data file directly into R was great! Thank you!
you're welcome +Nd_1115773
You made fabulous lectures. Thanks a lot.
you're welcome +Wenfang Liu !
very straightforward and helpful. Thank you
Thank you +庞广来 !
Thanks!! Great explanation!
Wow!!!!! Amazing help. God bless you!
Thank you so much!! Great tutorial. I have been struggling for hours
You're welcome Isha Sookharee , glad you found it helpful!
Thank u so much
Wonderful
I can learn r software
Small such vedio help to learn faster
Thank u
I like the way you are teaching
Thanks a lot! You explained everything so easily!
Hey this video was amazingly helpful!!!!! You made R much less intimidating! Thank you!!!!!
You're welcome Alexander Woods , glad you found it useful!
Thank you so much. Really like your tutorial~
Very good work Marin.. thanks for this wonderful series.
you're welcome +mpgrewal00 !
i learn import excel file to r so easily thank u sir
you're welcome
this is very helpful to me, thank you very much sir.
I found this very helpful, thanks for posting this.
wonderful experience through your tuitorials
Thanks +rodgers closec !
THANK YOU. You are my savior.
you're welcome +Megan McCarthy !
Great Tutorials..found really informative to get grounds in R to solve some optimization problems
Thanks Bhattarai Manish , happy to hear you found them useful!
Dankeschön , Thank you so much for your Videos form germany
This was so helpful. Thank you!
the first time I came across file.choose() and it is very helpful,
thanks a lot Mr. Marin , sir didnt get about comma(,)...actully i am a beginner in R.
+Swati Thakkar csv is coma separated values. whatever we hav it in excel sheet are nothing bt csv s.. saved in the extension .csv . so if we want to import those values in csv file to R as data frames we need to specify the separator in csv file which is nothing but ","
Amazing work Marin.. Loving it :)
thanks +Saptharishi L G , we appreciate you saying that!
Thank you very clear explanation I do not know nothing about R programming analysis but that’s helps me to get knack of it. Btw how can I bring workplace sheet? I don’t have (can’t see) the right window in front.
Thanks for sharing it. That is a very informative video
Since the most current .csv file for this example has 726 rows (including headers), I had to run this corrected code:
options(max.print = 20000)
data1
file.chose is pretty cool. *** but you can do this by doing to 'import dataset' icon ***; the benefit to this is that it loads the global variables and objects. It will allow you to set proper parameters on import such as Tab delimiter. and its a visual menu that ```{r} writes the code for you ```. you can copy/paste the code later. Now you can refer to the imported files by their 'file names' for all future needs.
Amazing channel! Really useful!
very good lectures, thank you. and beautiful desktop background picture :)
Thank you, very easy to understand.
very good, great, awesome, excellent Video!
thanks for your videos (I use it for self-study).
Especially for subtitles (my level of English basic only)!
You're very welcome Marat Sadykov! We've tried to make them accessible to as many people as possible, so its very encouraging to hear your comment, thanks!
Also Super Important; Go to "Session" - - > Set working directory -- ; set to a folder you typically save your Excel files in. Now in the bottom right window under "Files tab" you can Browse all the files in that folder You can click on any file an import, delete, rename, and more, all with mouse clicks no code needed.
amazing person doing stunning thing, what a man
Uau...It's hard to find great videos like this! Thank you.
Thanks Layza Segurasso , and thanks for watching!
Very helpful video for my stats class. Thank you!! Subscribed :)
You're welcome, glad you're finding them useful!
one of the best tutorials I have ever watched..Thank you very much.. Just wanted to check if you told any decision tree videos using R...
thanks +swathi ganji , we appreciate that! we haven't prepared anything for decision trees yet.
Really helpful. Thank you very much.
very useful) and very good sound! thanks
Thank you! These videos are awesome!
you're welcome :)