Working with Variables and Data in R | R Tutorial 1.8 | MarinStatslectures

  Рет қаралды 352,338

MarinStatsLectures-R Programming & Statistics

MarinStatsLectures-R Programming & Statistics

Күн бұрын

Пікірлер: 262
@09Nipz
@09Nipz 6 жыл бұрын
I know these were uploaded in 2013 but they feel more relevant than the confusing tutorials they have us doing in postgrad, this year! Saved my life. I was so stuck in stats, getting behind and struggling to progress. Not because I didn't understand the concepts of statistics, but because I couldn't figure out where I was going wrong in R. Thank you!
@retearwqtaet
@retearwqtaet 6 жыл бұрын
You're better than explaining this than my professor...Thanks for putting this into a format people can actually understand. You knocked out in 10 minutes what he hadn't adequately demonstrated in over an hour.
@郭宝淇-p4w
@郭宝淇-p4w 9 жыл бұрын
I JUST BEGAN LEARNING THIS R STUFF AND IT WAS SOOOO HARD. THE TUTORIAL VIDS ARE SO GOOD AND REALLY HELPED ME OUT! THANK YOU!
@marinstatlectures
@marinstatlectures 9 жыл бұрын
you're welcome +郭宝淇 , glad we could help!
@Oggygroggy1
@Oggygroggy1 7 жыл бұрын
Yeah, me to!
@TheJojolapatates
@TheJojolapatates 7 жыл бұрын
Help me a lot as well ! Thank you !
@simonambat
@simonambat 11 жыл бұрын
Your videos are excellent! I was into R for some time. Your videos gave me good clarity of R and its usage in a very systematic way. It helps a lot in my research work. Thank you so much!!
@marinstatlectures
@marinstatlectures 11 жыл бұрын
You're very welcome simon EK , thanks for the compliments, and thanks for watching!
@rogerrosewall6
@rogerrosewall6 5 ай бұрын
Your videos are excellent. In addition to the high quality content, your clear and focused voice track enhance the learning experience. Many thanks!
@MrKocharrohit
@MrKocharrohit 10 жыл бұрын
You have explained R in a very simple way. I loved it.
@marinstatlectures
@marinstatlectures 10 жыл бұрын
Thanks Rohit Kochar , we appreciate that!
@warpenator
@warpenator 9 жыл бұрын
Mike, your tutorials are wonderful. They are so straightforward and easy to follow. A lot of tutorials I find online deliver the content in a somewhat 'look how much smarter than you I am' kind of way. I don't get that from you. You clearly love what you do, and I thank you for putting these videos together. I think I am finally understanding this stuff.
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks warpenator , that's great to hear! and you are correct, i have always loved teaching!!
@batchrocketproject4720
@batchrocketproject4720 3 жыл бұрын
Thanks for these videos. I've been using R for about a year and found many of its quirks frustrating until I found your videos which work through things in much the same way a user needs. Really useful, thanks.
@vyshakkakkat2990
@vyshakkakkat2990 8 жыл бұрын
You have some badass tutoring skills! Really appreciate all the effort you have put into making these. Awesome and easy to understand, helped me a lot.
@marinstatlectures
@marinstatlectures 8 жыл бұрын
Thanks +Vyshak Kakkat , teaching is my passion (and my job). and my wife loves the video editing and annotating, etc, so we make a good team, and each bring our own unique set of skills ;)
@TJ-gp6to
@TJ-gp6to 10 жыл бұрын
You're tutorials are truly the best. I'm taking a programming course and your tutorials are lifesavers. I only learn through hands on and visual teaching methods. This is really driving the materials home, not to mention saving me from a lot of wasted time and a ton of headaches! :)
@marinstatlectures
@marinstatlectures 10 жыл бұрын
That's great to hear ***** !
@sharnalunn1970
@sharnalunn1970 5 жыл бұрын
Thank you so much! Tried learning R at least 4 times over the past few years and each time lose faith as it's assumed you already understand the principles of coding. I couldn't even get my data to read. You've saved me a lot of pain, THANK YOU!!!!!
@marinstatlectures
@marinstatlectures 5 жыл бұрын
great to hear! you're welcome :)
@DL-fl5ul
@DL-fl5ul 5 жыл бұрын
You're a hero man. This is only thing in a new job I don't know and your tutorials are the only way I think I can be completely covered on R.
@marinstatlectures
@marinstatlectures 5 жыл бұрын
that's great to hear!
@MaschlNES
@MaschlNES 9 жыл бұрын
All of your videos are so helpful for me. I used to use my PC for listening to musik, but now I have to deal with R in connection with my master thesis. I´ve watched many R tutorial videos, since I found yours and I just want to tell you, that your doing a great job. Thank you so much! Kind regards from Germany
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks +Mienchen Sto , we appreciate that! good luck with your studies!
@markkennedy9767
@markkennedy9767 4 ай бұрын
For once an R tutorial that starts from the beginning and explains the details of R and its idiosyncrasies. Thanks
@sizhuhicks1775
@sizhuhicks1775 9 жыл бұрын
This is the best R tutorials I found on youtube so far. thank you
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks +Sizhu Hicks , we appreciate that!
@IamJustinYoung
@IamJustinYoung 8 жыл бұрын
Thank you! Just getting started but this is making me feel more comfortable with the language
@marinstatlectures
@marinstatlectures 8 жыл бұрын
great to hear +Justin Young
@TheArabari
@TheArabari 10 жыл бұрын
Thank you Dear Marin, with your easy way of lecturing method you turned the dark to light, I was confused before i got your tube. No words to express how your tutorial is useful in my life.
@marinstatlectures
@marinstatlectures 10 жыл бұрын
We're very happy to hear that, thanks Amir Mohammed !
@goldy5858
@goldy5858 10 жыл бұрын
I don't have words to show gratitude for how much the videos are helping me to learn R. :) Thanks and respect for the great work.
@marinstatlectures
@marinstatlectures 10 жыл бұрын
you're welcome Avishek Raha , and we appreciate you saying that!
@CollMomo1
@CollMomo1 9 жыл бұрын
Thanks for the tutorial. At 1.5x speed, its perfect :P
@김중백사회학과
@김중백사회학과 8 жыл бұрын
I am teaching statistics at University; I am using STATA for individual research, but it is too expensive to use in Undergraduate STAT class. Your lecture or R is just awesome. You just use a minimal explanation for lecturing R and it really helps. I plan to suggest this website for students who take my course in advance to be familiar with R, It will really save time and make us happier.Sincerely appreciate your effort !!!
@marinstatlectures
@marinstatlectures 8 жыл бұрын
you're welcome +김중백(정경대학 사회학과) ­. yes, please share these with your students. the start of creating these videos was to use for my class (i teach an intro stats course for graduate students in public health), so they are built to work with most standard intro stats courses.
@bernardmartinelli268
@bernardmartinelli268 9 жыл бұрын
These videos are the god for my R assignment. I am going to put these video links as a playlist to my references at the end. Thank you so much.
@marinstatlectures
@marinstatlectures 9 жыл бұрын
you're welcome +Bernard Martinelli , glad to hear you're finding them helpful!
@bettys7298
@bettys7298 4 жыл бұрын
Thanks for introducing attach() detach() function in R! Very helpful!
@ndriunitedagbians5949
@ndriunitedagbians5949 4 жыл бұрын
Your tutorials are easy to understand, learn the concepts sir. Thank you for teaching students like me across the globe virtually.
@christiananwogu2808
@christiananwogu2808 8 жыл бұрын
thanks for this tutorial, i finally have a good start to learning r
@marinstatlectures
@marinstatlectures 8 жыл бұрын
you're welcome +Christiana Nwoko
@tingtingli6158
@tingtingli6158 8 жыл бұрын
Hello,Mike,by learning from your video about RStudio, i find it is very easy to get the knowledge of R language.Thank you and your team very much.Wish you have a good day! I will try my best to get the points.
@marinstatlectures
@marinstatlectures 8 жыл бұрын
thanks +tingting li , we appreciate that!
@emelytja8838
@emelytja8838 6 жыл бұрын
Thank you you helped me a lot with this video. Even though it is already 5 years old. Everything still works.
@marinstatlectures
@marinstatlectures 6 жыл бұрын
glad you find them helpful!
@marinstatlectures
@marinstatlectures 6 жыл бұрын
Learn how to work with variables in R, check variable names for the dataset that you imported into R (kzbin.info/www/bejne/p4HOYYx7gM2keJo ), check variable types (numeric or categorical), extract a variable from a dataset and produce summaries for data in R. Use the dataset to practice along (bit.ly/2rOfgEJ)! Like to support us? You can Donate statslectures.com/support-us or Share the Videos.
@peaceandlove6389
@peaceandlove6389 6 жыл бұрын
And 5 years later this still saves our grades. I just started with this. THANK YOU! :)
@angleeas
@angleeas 3 жыл бұрын
I have just started learning r language < thank you so much for this amazing vids, I will let you know updates
@soundsofsoul7389
@soundsofsoul7389 4 жыл бұрын
Dear Marin, you're a lifesaver! Thank you :)
@sushantchinchkar8042
@sushantchinchkar8042 8 жыл бұрын
Sir, you are doing an awesome job. Videos are proving far better than reading manuals for beginners. Please keep it up. _/\_
@sarahlucan1832
@sarahlucan1832 5 жыл бұрын
THANK YOU! Assignment due in minus 24hrs and now i can actually create graphs!
@marinstatlectures
@marinstatlectures 5 жыл бұрын
great to hear :)
@MermaidLolly
@MermaidLolly 8 жыл бұрын
Thank you so much for this! I'm studying a Masters degree in Linguistics and now have to use this software for my dissertation. I found it so difficult until I found your videos!
@marinstatlectures
@marinstatlectures 8 жыл бұрын
good to hear +Mermaid Lolly !
@vjrobs09
@vjrobs09 7 жыл бұрын
Great Explanation of very useful stuff in R... Thanks a ton!!!
@wessamahmed4266
@wessamahmed4266 8 жыл бұрын
finally, I were able to find a tutorial which is not long and I can understand
@marinstatlectures
@marinstatlectures 8 жыл бұрын
happy to help +wessam ahmed . we've got 60+ more of them...
@lesterraynanjala3875
@lesterraynanjala3875 6 жыл бұрын
Am working wit R to analyse my bird Data in the first place it was so had at the point of giving up on R until i discover MARINSTATSLECTURES thanks to you
@marinstatlectures
@marinstatlectures 6 жыл бұрын
great to hear Ray Nanjala!
@puneetohri6256
@puneetohri6256 6 жыл бұрын
a man's amazing , love you marin
@8retnuoc
@8retnuoc 11 жыл бұрын
Very useful so far. Thank you
@marinstatlectures
@marinstatlectures 11 жыл бұрын
You're very welcome, thanks for watching!
@muhammadsaif5626
@muhammadsaif5626 6 жыл бұрын
Excellent! Thank you
@godsonchikelu6024
@godsonchikelu6024 8 жыл бұрын
Thank you for teaching me the attach command. you are awesome!
@marinstatlectures
@marinstatlectures 8 жыл бұрын
you're welcome +Godson Chikelu , glad you're finding our videos helpful!
@rajeshchouhan9016
@rajeshchouhan9016 7 жыл бұрын
kudos to you sir..For your valuable efforts.. Thanx a lot..these lectures helped me a lot as a beginner..❤👌🙏🙌
@ramkaushikpochiraju4550
@ramkaushikpochiraju4550 10 жыл бұрын
Thanks a lot Marin! Your lectures are great .. :)
@marinstatlectures
@marinstatlectures 10 жыл бұрын
You're welcome Ram Kaushik Pochiraju
@retrosak1977
@retrosak1977 5 жыл бұрын
Excellent videos! Thank you very much for the great job!
@marinstatlectures
@marinstatlectures 5 жыл бұрын
you're welcome!
@weerachonsawangproh8738
@weerachonsawangproh8738 7 жыл бұрын
Fantastic R tutorials :)
@alberto6888
@alberto6888 7 жыл бұрын
Very very good! Thank you so much!
@RandolphAbelardo
@RandolphAbelardo 9 жыл бұрын
is there a command to print / view the classes of all the variables (timeframe 4:30)? really like your channel! it's as if you're conversing with me, unlike others that sounds robotic or sound as if they're just reading from the powerpoint deck : ) thanks in advance.
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Thanks +Randolph Abelardo ! sure, if you enter the command *sapply(data, class)*, R will "apply" the "class" function (asking the class of a variable) to all of the columns of *data*. and it is worth mentioning that the "apply" family of functions (apply, sapply, lapply,.) can be used for much more than this...then can 'apply' a function to rows/columns of a data frame, etc.
@kathyqing212
@kathyqing212 8 жыл бұрын
Your video is so amazing. Thank you a LOT!!
@marinstatlectures
@marinstatlectures 8 жыл бұрын
you're welcome +Xiaoqing Zhang
@nevinpicard5988
@nevinpicard5988 7 жыл бұрын
If you are have an issue with some of the "Factor" type Names being listed as "Characters" you can change them when importing your Data. When importing, go to the data preview window and click "Character" under the [Gender, Caesarean and Smoke] categories and a drop down list should appear allowing you to change them to "Factors". Please thumbs this up for visibility.
@TomTomDam
@TomTomDam 7 жыл бұрын
Where is Factor? In the dropdown list I only see Character, Numeric, Date, Include, Skip. Im using Windows 10 RStudio 3.3.3.
@ringatingting
@ringatingting 6 жыл бұрын
Thank you!!!
@pranavgarimella8987
@pranavgarimella8987 3 жыл бұрын
Thanks, i think this explains why i have the following output > summary(LungCapData$Smoke) Length Class Mode 725 character character
@nl7247
@nl7247 3 жыл бұрын
Thank you. I'm using RStudio 2021.09.2+382 "Ghost Orchid" version. In "Import Dataset" pop-up, select "Strings as factors", then Import.
@bandhanjotkdhiman6130
@bandhanjotkdhiman6130 2 жыл бұрын
@@nl7247 I did not understand, I m also using the latest R version
@mdyeasinarafath4450
@mdyeasinarafath4450 6 жыл бұрын
Thanks a lot, Sir! These are all useful videos. I have one question at this point. Do we work only in console in R?
@junhuijiang6107
@junhuijiang6107 9 жыл бұрын
I love your tutorial video records!
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks +Junhui Jiang !
@ramikashef
@ramikashef 8 жыл бұрын
Thank you for this very helpfull tutorials! veeeeerry nice
@gosiama480
@gosiama480 4 жыл бұрын
Why the heck tutors at uni dont teach like you!!!
@Kawiibear101
@Kawiibear101 6 жыл бұрын
Thank you so much I can finally use R!
@marinstatlectures
@marinstatlectures 6 жыл бұрын
great to hear!
@jafarnamdar6
@jafarnamdar6 6 жыл бұрын
Appreciated, great videos!
@inf3rno691
@inf3rno691 4 жыл бұрын
Mate you save me... Critical explanations on commands...Please make a video for Bayesian Logistic Regression! :P
@pedrokobler6555
@pedrokobler6555 3 жыл бұрын
Hi, Mike! There is a difference between working with an attached data frame and using '$'. While using an attached data frame, the command does not change the content of the data frame. Smoke
@marinstatlectures
@marinstatlectures 3 жыл бұрын
That’s correct. Your first command there will change the “attached” smoke variable to a factor but the smoke variable inside the data frame will remain as it originally is. In general it is better to work without attaching data, but since my videos are geared more towards beginners with R (at least the earlier series videos), I try to reduce the amount of syntax necessary and make it a bit more simple visually
@mohamedouzarf
@mohamedouzarf 9 жыл бұрын
thanks for tutorial video and dataset
@marinstatlectures
@marinstatlectures 9 жыл бұрын
you're welcome +MOHAMED OUZARF !
@kerumble
@kerumble 8 жыл бұрын
These are excellent, thank you very much!
@marinstatlectures
@marinstatlectures 8 жыл бұрын
you're welcome +kerumble !
@deepakkota9480
@deepakkota9480 8 жыл бұрын
Really good lecture. But I think it's not the personal preference to use attach, detach, but it is a precaution, because if you are working with a variable "Age"(for instance Age = 8) in this example, it neglects the "Age" column in the working file even though it is attached. For instance if you type mean(Age), it gives 8 instead of mean(LungCapData$Age).
@McLighthawk
@McLighthawk 9 жыл бұрын
Thank you for this very helpfull tutorials!
@marinstatlectures
@marinstatlectures 9 жыл бұрын
you're welcome +McLighthawk !
@abbas8646
@abbas8646 10 жыл бұрын
another great video, thank you
@marinstatlectures
@marinstatlectures 10 жыл бұрын
thanks abbas8646 !
@ravikrishnarpan
@ravikrishnarpan 10 жыл бұрын
U r a Gem , really appreciate ur training
@marinstatlectures
@marinstatlectures 10 жыл бұрын
you're welcome Ravi Krishnarpan
@aperson1181
@aperson1181 6 жыл бұрын
thank you for the video, I'm getting Smoke Length:725 Class :character, Mode :character; and Gender is the same, R doesn't break down male/female, just gives me Length, Class and Mode
@alexisthibo7988
@alexisthibo7988 3 жыл бұрын
Thank you so much🙏
@nageshgoud721
@nageshgoud721 8 жыл бұрын
Hi Marin, the classes are really awesome... These are really helpful.. .. Do you have any videos where I can read/Learn statistics.
@marinstatlectures
@marinstatlectures 8 жыл бұрын
thanks +nagesh goud , unfortunately we haven't really had time to dive into a set of videos like that yet. we'd like to create those at some point, but at the moment we haven't had much time to work on more videos, and when we do find small chunks of time, we've been using it to add to our R video library.
@alighadami2519
@alighadami2519 3 жыл бұрын
Hi, thank you very much for the video. I have a question about the class of the Gender, Smoke, Caesarean. In you tutorial it shows them as a "factor", however in my R studio it's shown as a "character". And when I use Levels() command on them it returns "NULL". Also in summary () results for example for gender, it doesn't show me how many how many "males" and how many "females" separately, it only show the total number. I would appreciate it if someone has an answer for this.
@oliviaglass137
@oliviaglass137 Жыл бұрын
I also have this outcome!
@mohamedkhalil8468
@mohamedkhalil8468 9 жыл бұрын
Love your videos sir :)
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks +Mellal Mohamed Khalil !
@behnam2534
@behnam2534 9 жыл бұрын
Hello I just started learning R. You are amazing and lessons are so clear and awesome. I was wondering if there is a way that I can download the " Longcap data?" so that I can compare my results with yours. Thanks again. Good job Behnam
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Hi +Behnam AliMohammadi , thanks, we appreciate that! yes, just click on "SHOW MORE" under the video, and you will see a link there to download a copy of the data. in some of our later videos, we also have the R Script there for download as well.
@xueqizhang8112
@xueqizhang8112 8 жыл бұрын
Helle, Mike! I have a problem with the class of variables Smoke, Gender and Caesarean. When I 'm loading the data into RStudio, it presumably sets these variables to be character. I want to change the class to factor by choosing the factor option from the drop down menu alongside the variable. Then there's a pump showing "please enter the format string". So what should I enter? I've googled online and found no answer. RStudio 1.0.44, MAC 10.11.4 . Thank you.
@artarz9542
@artarz9542 4 жыл бұрын
Hi, I just begin using R statistic and learn from the very basic. You're video truly helpful. However, I found issues, when I typed class(), it revealed "character" instead of factor. I attempted to use as.factor(), it wasn't working still. Moreover, in levels() function, it then revealed "NULL", do you have an idea what is going wrong here?
@ryanr2986
@ryanr2986 2 жыл бұрын
any one reading this i am having the same problem
@foyzih
@foyzih 7 жыл бұрын
superb!
@2003budisu
@2003budisu 9 жыл бұрын
nice and very helpful... :)
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks buditsu !
@geetharaghukumar4929
@geetharaghukumar4929 7 жыл бұрын
Hi Mike, Your lectures are so clear and easy to follow. I am still at the early stages and when I am trying to start working with the data in LungCapData2, my R Studio is reading the categorical variables gender and smoke etc as character, but when I put in the command for levels of these, it returns it as "NULL" and when I try to summarize, it does not put out the frequencies of the categorical variables. Could you, please, explain, what might be going wrong? Thanks, GR
@Valky1988
@Valky1988 7 жыл бұрын
You have to convert the column format from character to factor, for example: LungCapData$Gender
@geetharaghukumar4929
@geetharaghukumar4929 7 жыл бұрын
Thanks.
@ravinduabeygunasekara833
@ravinduabeygunasekara833 9 жыл бұрын
sir these tutorial are pretty awesome!! thanks alot! are there any exercies available so that we can try these other than 'lungcapdata" , or any kind of question paper in R??
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Thanks +Ravindu Abeygunasekara ! at the moment i don't have other material i can recommend. we are working on putting together an eText, but that will take a bit of time to complete. in the meantime, id recommend just searching around online. on the web you can find lots of datasets and examples of analysis done on them. you can then just save a copy of the data for yourself, and try to repeat their analysis. hope that helps you out!
@ravinduabeygunasekara833
@ravinduabeygunasekara833 9 жыл бұрын
+MarinStatsLectures thanks a lot sir
@paulinalewandowska6390
@paulinalewandowska6390 7 жыл бұрын
Thank you very much for your great videos! They are a HUGE help for me, struggling to learn statistics in a right way :) I wonder if you could advise me something on one problem. I keep getting 'NULL' for all columns after calling the 'levels()' function, and all materials on R in internet sound like a foreign language to me, I simply don't know how to solve this :( I tried to attach levels on my own, but then the 'summary()' doesn't reveal more detailed information about the data (like the number of "female" and "male" in "Gender", etc.). I wonder if there's something to do about this?
@sujeetkushwaha4791
@sujeetkushwaha4791 6 жыл бұрын
can we meet sujeetkuwh@gmail.com
@shyamshankarh.r9762
@shyamshankarh.r9762 3 жыл бұрын
We should have converted those columns to factors (if not done automatically). Use: LungCapData$Smoke
@joohojeong6261
@joohojeong6261 9 жыл бұрын
Thanks for the lectures. Without your lectures, I would not be able to keep up with my statistics classes. By the way, I tried to Import the dataset but it keeps failing to do so. What can I do to keep this from happening?
@marinstatlectures
@marinstatlectures 9 жыл бұрын
thanks +doe john , good to hear that! you'll have to elaborate on the error a bit in order for me to help. knowing that the data is failing to import isn't enough for me to troubleshoot you error and let you know what you're doing wrong. if you explain a bit more about what you're doing, and the error you are getting, i can try to help you out...
@joohojeong6261
@joohojeong6261 9 жыл бұрын
okay its like this : Error in file(con, "r") : cannot open the connection In addition: Warning message: In file(con, "r") : cannot open file 'C:/Users/二쇳샇/Desktop/MarinLectures/LungCapData.prn': No such file or directory
@joohojeong6261
@joohojeong6261 9 жыл бұрын
when I try to import the dataset
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Hi doe john , ok, it sounds like it's probably because the file extension is .prn . I'm not sure exactly what format that is, or what info it contains with it, but i don't think R can handle that format of file. it's better to save the file as a .txt or as a .csv file. it may also be that the path to the file is incorrect, as the error is saying that the file or directory don't exist. id suggest to save the file as a .csv or .txt file , and id also suggest either instead of specifying the path to the file, you use *file=file.choose()* in the read.tale command when reading in the data, or just use the *"import dataset"* tab in RStudio, as both of these avoid having to specify the path to the file.
@joohojeong6261
@joohojeong6261 9 жыл бұрын
okay thanks.
@endospore1
@endospore1 9 жыл бұрын
Thank you so much for these tutorials! I just need a little help, I tried the attach command and I am getting a message saying the object is masked by GlobalEnv. I have tried to detach and the help function but I keep getting plus signs. What did I do wrong? Thank you again.
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Hi +endospore1 that's because you have either 1) attached it multiple times, or 2) have read in and attached 2 different datasets that have at least one same variable name (and have not detached them). what this error mean is that, for example, you have attached a dataset with a variable "Age" and then you have attached again something that has a variable "Age", and one of them is overwritten (masked) by the other. each time you attach data, when your done working, you should detach it. id suggest to start by detaching the data that you've used, and enter this command over and over until you get an error. (e.g.) detach(data), then again detach(data), and so on. once you get an error message, this means that there are no more versions of 'data' attached. for example if you enter that command 3 times with no error, and then on the fourth you get an error, that means that the "data" was attached 3 times, and you removed all 3 of those, and on the fourth try R is telling you that "there is nothing called data to detach", and so it gives you an error. this will most likely solve your problem. and in the future, make it a habit to detach data that you've attached when you are done working. and just attach the next time you start up again. on a side note, this is what from a programming/coding point of view, it is better to work with $ and not attach. (e.g.) *data$variable* , not *attach(data)* and then just call on *variable*. but for introduction to a beginner, it is easier to avoid the use of the $, and just work with attached data.
@Avangelis
@Avangelis 5 жыл бұрын
OMG Life Saver
@marinstatlectures
@marinstatlectures 5 жыл бұрын
Always nice to hear the kind words 😊
@andreannebenidir7765
@andreannebenidir7765 9 жыл бұрын
Hello Mike, have to say great explanations for working with these variable types of data. Simple question I'm sure but still thoughts I'd throw it out here for peace of mind. I'm getting the data classes integer as distinct from numeric and factor. Unclear as to what the difference really is between integer vs. numeric rather than numeric having decimal places...I would have thought however that is would all be coded as numeric. R gives similar type of summary for both so I'm not being too concerned with this distinction at the moment. Is there something more sensitive that I should know about this distinction in R? Thanks so much.
@marinstatlectures
@marinstatlectures 9 жыл бұрын
***** , someone asked this question before, so I'm just going to copy/paste my reply from there: there's not much difference from the user-point of view. what happens with R internally will be a little bit different depending on if the object is of class "numeric" or "integer", but from a practical point of view, when using R, it wont make much difference to you if you have the 0/1's as numeric or integer. unless your data set is extremely large, it wont matter much either way. you can always do some reading about data types in computer languages if you want to understand the subtle differences. but from the point of view of analyzing some data, it wont make much difference to you (externally, the two classes are treated pretty much the same)
@andreannebenidir7765
@andreannebenidir7765 9 жыл бұрын
MarinStatsLectures Thank you for your response. Much appreciated
@mohamedyehia1077
@mohamedyehia1077 8 жыл бұрын
Hi, I have a question..... I get "Character" when asking about the class of each of "Smoke, Gender, Caesarian".... in accordance, I did not get summary for each..... why is that happening?...thx
@marinstatlectures
@marinstatlectures 8 жыл бұрын
Hi +mohamed ahmed , what has happened is that R has seen the "letters" and interpreted those as being "characters" rather than labels for categories/factors. what you should do is tell R they are factors using *Smoke
@terraflops
@terraflops 7 жыл бұрын
thank you for the help, i was wondering how to fix this.
@byvc
@byvc 6 жыл бұрын
Hi, Marin! First of all, thank you very much for the videos. They are reeaally helpfull. One question: why is it that when I attach the LungCapData and than ask R to treat them as a factor, when I ask a summary of LungCapData [eg. summary(LungCapData)] the program still don't give me the summary (still showing them as a character and not as factors)... he doesn't change the variables in the data, he creates it as another value... and then when I ask the summary of the variable [eg. summary(Smoke)], that's when he summarizes as factors.. but since the LungCapData is already attached, shouldn't it change it in the dataset?
@drsweety8289
@drsweety8289 Жыл бұрын
Hi. I am using Windows. I think I missed the categorical defining variables. So when I am asking for values for gender or Smoke - it comes as NULL and when I ask for summarize the dataset - it summarizes the whole date - just showing character and not the frequency for the categorical tables. Can you help me sort out where I went wrong? Thanks
@mayanbriller655
@mayanbriller655 7 жыл бұрын
while attaching the dataset, I did not see the new variables appear in the "workspace" area. why? are they not local variables now?
@nehapachpande7556
@nehapachpande7556 7 жыл бұрын
Hello Make, I am beginner of R and this are very good lectures for beginners. Thanks for sharing such valuable stuff. I have question can you please Ans it: AS shown in lecture number 7 I found that "types of Class" (Variable type). Its shows Age as "Interger" and LungCap & Height as "Numeric" but when I tried with Rstudio with same example it show me "numeric" for all three variable (LungCap, Age,Height). Why?
@thienyle6411
@thienyle6411 2 жыл бұрын
Hi! How come when I try to find the mean of my data, it says "NA"? Thank you!
@easydatascience2508
@easydatascience2508 Жыл бұрын
You can watch mine. Playlist for Python and R offer most of the fundamental tutorials with downloadable source files.
@julianvermeersch6341
@julianvermeersch6341 10 жыл бұрын
Hi Mike, i have some data, and 3 variables to it, yes no and NA, how can I recall the variable without the NA responses?
@marinstatlectures
@marinstatlectures 10 жыл бұрын
Hi Jn Vermeersch , you can use the *na.omit()* command. for example, suppose you have the following variable: *x
@pranavgarimella8987
@pranavgarimella8987 3 жыл бұрын
thank you for the great tutorials. I have been following along so far and it has been excellent. I was trying some of the code you were showing and for some reason, I am receiving a diffent output for the yes/no variables and was wondreing if you can tell me why? I have pasted the outpout for the variable 'smoke' below after running the summary command. Thanks for your great videos > summary(LungCapData$Smoke) Length Class Mode 725 character character
@marinstatlectures
@marinstatlectures 3 жыл бұрын
It is because the smoke variable is “character” while for me it is a “factor”. Character is essentially R seeing this as words rather than categories. You can change smoke to a factor when importing the data, or by using LungCapData$Smoke
@pranavgarimella8987
@pranavgarimella8987 3 жыл бұрын
@@marinstatlectures Thanks, yes. I watched until the end of your 'Handling variables lecture' and did just that :D thanks for the great tutorials.
@edhava
@edhava 8 жыл бұрын
Sorry, if this is a dumb question. I am just getting started with R. Qsn: What are the disadvantages of working with data 'attached' . Does it takes up RAM space and slows down the process of certain functions?
@soham6649
@soham6649 8 жыл бұрын
If the data is small, it wont take up much of the systems memory. However if you have loads of rows (really only applicable to industrial level application) then your computation time will be slower
@davitoshioinada2977
@davitoshioinada2977 10 жыл бұрын
Loving :)
@SiddharthSharma21
@SiddharthSharma21 7 жыл бұрын
can we put AGE in a variable and use it as and when required ? Personally, it's convenient than what is already stated. Isn't it ?
@yuvenmuniandy8202
@yuvenmuniandy8202 9 жыл бұрын
Hi Your videos are awesome! By the way I want to know how to save the console outputs to html, Rmd, and Rproj files. Kindly could you please help
@Erqin
@Erqin Жыл бұрын
Hi Mike. Thanks for the video. For levels command, I just get 'null'. What is the problem? Thanks.
@marinstatlectures
@marinstatlectures Жыл бұрын
It sounds most likely like your variable is a ‘character’ not a factor. You need to classify it as a factor on import, or use the as.factor() command to change it to a factor once imported
@anasbafaqeeh4193
@anasbafaqeeh4193 6 жыл бұрын
Hello... although along of time with this video, but still great reference for learning R... if you do not mind, i have a question that have bothered me.. what the differences between typeof(), class(), mode(), str()?
@marinstatlectures
@marinstatlectures 6 жыл бұрын
it is quite confusing, and difficult to explain...this may help... stats.stackexchange.com/questions/3212/mode-class-and-type-of-r-objects
@Shahada2012
@Shahada2012 8 жыл бұрын
awesome
@gabymoonfairy1014
@gabymoonfairy1014 9 жыл бұрын
Hi! I was wondering how do you use control variables in R. How do you integrate them to panel data functions??
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Hi gabymoonfairy1014 , i believe panel data functions are something used in econometrics? I'm not very familiar with that area. i know there is a package called *plm* that you may find useful. sorry i can't help more than this, but panel functions are a topic I'm not familiar with.
@gabymoonfairy1014
@gabymoonfairy1014 9 жыл бұрын
No problem, thank you so much for your help. Really appreciate it! And thank you for your prompt response as well.
@Trafficfromsky
@Trafficfromsky 7 жыл бұрын
Hey! I need a help! I was trying to use levels attribute, but it says "NULL" my code is: levels(LungCapData$Gender) What should I do in order to fix this problem? Thanks
@malluk4127
@malluk4127 7 жыл бұрын
I got the same issue.
@ksairamreddy5540
@ksairamreddy5540 7 жыл бұрын
R studio is showing class(caesarean) is a character and not a factor. Can you please say me the difference between character and the factor
@pedromrfernandes
@pedromrfernandes 7 жыл бұрын
Hi Mike I've not been able to find out how to create lag variables in R. Can you help me? Thanks
@rakeshreddy4827
@rakeshreddy4827 4 жыл бұрын
Hello Martin, When I am using levels for the same data set , I am getting NULL. Can you help with this please
@syedrezwankabir1070
@syedrezwankabir1070 9 жыл бұрын
Thank you for these videos, very helpful. I have a question, when I am dealing with a data set of about 57000 rows and try to do the same thing like calculating age, an error pops up. it says-[reached getoption("max.print)--omitted 47000 entries]. What does it mean? How do I solve this problem?
@marinstatlectures
@marinstatlectures 9 жыл бұрын
Hi +Syed Rezwan Kabir , the error is because you are trying to "print" (or show) all of the observation in the console in R, and R will only show the first 10000 observations. so R is jut telling you that beyond the first 10000 observations, it will not how anymore. this isn't really an error thought. you can still do everything with your data, you just ant view all of it in the console. but you can still do everything else, like *mean(age)* will calculate the mean of age, etc. hope that clears it up for you
@joaoguilhermegiancursitedd8988
@joaoguilhermegiancursitedd8988 4 жыл бұрын
Nice video! I'm just having troubles when applying the function "levels". In my version of R 3.6.3 the variable "Gender" of your dataset appears as "character". So whenever I call "levels(Gender)", it returns "NULL". What is the correspondent function for a character variable? Or, how can I turn a character variable into a factor variable? thanks!
@jaymanhire
@jaymanhire 4 жыл бұрын
I had the same problem. I discovered using the as.factor command. > LungCapData$Gender = as.factor(LungCapData$Gender). You can do this to the other variables that are not working as well: > LungCapData$Caesarean = as.factor(LungCapData$Caesarean)
@jaymanhire
@jaymanhire 4 жыл бұрын
Then run the summary again.
@joaoguilhermegiancursitedd8988
@joaoguilhermegiancursitedd8988 4 жыл бұрын
@@jaymanhire Thanks for your help!
@jaymanhire
@jaymanhire 4 жыл бұрын
@@joaoguilhermegiancursitedd8988 I fixed only half of the problem. This showed me the data but I still got NULL. This works!: > levels(LungCapData$Gender)
@jaymanhire
@jaymanhire 4 жыл бұрын
I Found out more! It's because the dataset is Not attached! Repeatedly execute this over and over until it works: > detach(LungCapData), then > attach(LungCapData), then we can simply do this: > levels(Gender) and it works.
Subsetting (Sort/Select) Data in R with Square Brackets | R Tutorial 1.9| MarinStatsLectures
4:39
MarinStatsLectures-R Programming & Statistics
Рет қаралды 294 М.
Importing , Checking and Working with Data in R | R Tutorial 1.7 | MarinStatsLectures
8:46
MarinStatsLectures-R Programming & Statistics
Рет қаралды 460 М.
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
Как Ходили родители в ШКОЛУ!
0:49
Family Box
Рет қаралды 2,3 МЛН
Variables and Types of Variables | Statistics Tutorial | MarinStatsLectures
13:13
MarinStatsLectures-R Programming & Statistics
Рет қаралды 241 М.
Scatterplots and regression lines in R
15:00
Equitable Equations
Рет қаралды 11 М.
R vs Python
7:07
IBM Technology
Рет қаралды 349 М.
Linear Regression in R, Step by Step
5:01
StatQuest with Josh Starmer
Рет қаралды 95 М.
Stanford's FREE data science book and course are the best yet
4:52
Python Programmer
Рет қаралды 715 М.
tApply Function in R | R Tutorial 1.16 | MarinStatsLectures
4:54
MarinStatsLectures-R Programming & Statistics
Рет қаралды 55 М.
Importing/Reading Excel data into R using RStudio (readxl) | R Tutorial 1.5b | MarinStatsLectures
8:12
MarinStatsLectures-R Programming & Statistics
Рет қаралды 208 М.
R tutorial - Using Factors in R
5:40
DataCamp
Рет қаралды 211 М.
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН