Histograms in R | R Tutorial 2.4 | MarinStatsLectures

preview_player
Показать описание
Histograms in R: How to Create and Modify Histograms with R

►In this R video tutorial, we will learn how to produce histograms in R and add a density curve to the plot using the "hist" and "lines" functions. We will also explain how to modify the histogram by adding titles, changing axes labels, changing the line colour or width and many more by using "main", "xlab", "xlim", "col", "lwd" arguments and more .

Table of Content:

0:00:05 What is a histogram and when is it appropriate to use a histogram for your data
0:00:25 how to produce a histogram in R using the "hist" function
0:00:30 how to access the help menu for histogram in R
0:00:42 What are the default options for histogram plots in R

"Modifying a histogram in R":

0:01:03 how to change the y-axis of a histogram to represent a "probability density" rather than "frequencies" using "freq" argument or "prob" argument
0:01:45 how to change the x or y limits of a histogram in R using the "xlim" or "ylim" argument
0:02:01 how to change the "bin width" of a histogram using the "breaks" argument
0:03:08 how to add a title to a histogram in R using the "main" argument
0:03:18 how to add labels to the x-axis or y-axis of a histogram in R using "xlab" or "ylab" arguments
0:03:31 how to rotate the values on the y-axis of a histogram in R using the "las" argument
0:03:39 how to add a "density curve" to a histogram in R using the "lines" command
0:04:00 how to change the color of the density curve in a histogram in R using the "col" argument
0:04:07 how to change the width of the density curve in a histogram in R using the "lwd" argument

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

► ► Watch More:

Follow MarinStatsLectures

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!
Рекомендации по теме
Комментарии
Автор

I love your baby step tutorial.For more than a decade, I have been in denial of understanding R .You have revived the passion and now I love the flow of it.Keep the good work.

beatricekinyua
Автор

Im binge watching this playlist, dude is underrated, simple and clear

mbmathematicsacademic
Автор

i have watched many mentors but i will highly recommend your videos . so easy to understand and very very comprehensive. thank u.

muhammadtalha
Автор

Just started working with R at my study, this greatly helps me with it, thanks for uploading

PierreBezemer
Автор

Mike is saving many academic lives haha, thanks Mike.

florajane
Автор

It helped me so much! Your tutorial is so simple and so nice! Congrats.

euclidesneto
Автор

Thanks a million sir, for ALL your value adding tutorials and contents

Adeyeye_seyison
Автор

Thanks so much!! This helped me with my BSc Honours project!

chelseafort
Автор

You, sir, are worth your weight in gold!

michaelrecycle
Автор

Thank you sir, you provide all material which i need.

rohitkolpe
Автор

You are just awesome man!! every tutorial is so simple and effective...

funnfun
Автор

Thank you so much. Your videos are really easy to follow and understand.

jababnamgay
Автор

great job, i was blind but now cured!

explosivedonuts
Автор

Thank you. I found your channel so helpful.

MinukuuTutorials
Автор

Thanks a lot friend!! Very Helpfull tutorial!!

ΓιωργοςΓαλάρης-ψβ
Автор

Hi Marin, thanks for the carefully broken down videos. With those one one screen, R and RStudio on the other I can realy and finally start practicing R. Very encouraging, can't wait to get going!

Krop
Автор

Dear Mike,
Your tutorial is absolutely amazing and easy to comprehend.
Thank you for those beneficial videos.
However, do you have any tutorials about time-series regression in R?

taimourboughannam
Автор

I have watched all your R videos till this one and I loved them all. I work as a data analyst so I was wondering if you have a video where you analyse data by connecting R to SQL Server or Oracle?

MrKocharrohit
Автор

Hi Mike, how are you?  I have a question about the LOGIT function.  How do you using?  The syntax.  I trying to answer a question with the information give - The logit transformation is often useful for the proportion between 0 and 1.  If p is the proportion then the logit is log[p/(1-p)]  This is the log of the ratio of the amount of pollen removed to the amount not removed.

michaelwhitaker
Автор

Hi, I am trying to do a Hist as well but I seem to encounter an issue that states "Error in hist.default(HW9Data) : 'x' must be numeric" not sure what I need to do. I also tested it on the data you have for lung capacity, "> hist(LungCapData)
Error in hist.default(LungCapData) : 'x' must be numeric"

saadmanasterli