Create and Work with Vectors and Matrices in R | R Tutorial 1.4 | MarinStatslectures

preview_player
Показать описание


In this R video tutorial we will learn to Create, Modify and Work with Vectors and Matrices in R.

▶︎▶︎Reminder: One of the important features of R is that it can handle complex statistical operations in an easy and efficient way. R handles complex computations using Vectors, Matrices, Lists, Dataframes and Datasets; In this video we focus on Vectors and Matrices in R. In R, Vector is a basic data structure that contains element of similar type (logical, integer, double, character, complex or raw). A matrix is basically a two-way generalization of a vector. Instead of a single index, we can use two indexes, one representing a row and the second representing a column.

▶︎▶︎In this R tutorial you will learn:
▶︎ How to create vectors in R for numbers or objects using the c function or concatenate function
▶︎ How to use seq function to create sequence data in R
▶︎ How to use rep function in R to create a vector of repeated numbers or characters
▶︎ How to create a matrix using matrix function in R and use square brackets to extract certain elements from a matrix in R
▶︎ How to perform basic arithmetic functions on the elements of one vector, preform arithmetic functions on the corresponding elements of two vectors and perform element-wise arithmetic functions in a matrix in R Statistical software.

This video is a tutorial for programming in R Statistical Software for beginners.

◼︎ Table of Content:

0:00:29 How to create vectors in R for both numbers or objects? By using the "c" or "concatenate" function
0:01:09 How to create a sequence of integer values in R? By using the colon (:)
0:01:20 How to create sequences in R ? We will use "seq" function in R
0:01:55 How to create a vectors of repeated numbers or characters in R ? we can use "rep" function in R
0:03:34 How to perform basic arithmetic functions on the elements of one vector in R?
0:04:02 How to preform arithmetic functions on the corresponding elements of two vectors in R?
0:04:59 How to extract elements of a vector in R? By using square brackets[] in R
0:06:08 How to create a matrix in R? we will use "matrix" function in R
0:06:21 How to set the number of rows and columns in a matrix in R? By using "nrow" and "byrow" functions in R
0:07:05 How to extract certain elements from a matrix in R? We can use the square brackets in R
0:08:06 How to perform element-wise arithmetic functions in a matrix in R?

►► Watch More:

This video is a tutorial for programming in R Statistical Software for beginners, using RStudio.

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 a course at The University of British Columbia (UBC) (SPPH400: #IntroductoryStatistics and #RTutorial for Health Science Research), although we make all videos available to the public for free.

Thanks for watching! Have fun and remember that statistics is almost as beautiful as a unicorn!
Рекомендации по теме
Комментарии
Автор

I wanna hug u. Ur explanations are so concise and straightforward. And I love how you do multiple examples to make sure we understand. Thanks.

sbk
Автор

I am a beginner at R (having done C++ in high school) and wish to learn the language for extensive data analysis that is currently undertaken in our organization. Your lessons are very straightforward and easy to comprehend.

Thank you very much for these lessons. Greetings from India.

utkarshg.bharti
Автор

You are a life saver! I have homework due in in a few days for my stats course, and they recommended we learn and use R. They did provide a lot of 'how to guides', but I couldn't understand them, it kind of felt like they expected us to already have a basic knowledge of R before starting the course.
Long story short, thanks to your videos I now understand the guides and can start my homework. I will recommend you to others on my course.

sarahw
Автор

Hello, I'm a 4th year medical student from Bangladesh. I was interested in learning R because of my interest in doing clinical research in the future. At first, I learned some basics from Thenewboston's R programming tutorials. Then I started going through your channel & your videos are damn cool got to say.

muhammadsamiul
Автор

Thank you, Marin.
Your lectures are organized and easy to learn. Your lectures are great beginning to me.

venkysk
Автор

Recommend these videos to all R beginners. Very well explained and super easy to follow. Already learning all a lot. Bravo to you sir !!

bidurpaudel
Автор

I love your videos. I am new to R programming and they are very helpful and much easier to understand . Great work.

harshakamat
Автор

Thank you Marin for simple explaination.

sivaveeramallu
Автор

Thank you - I've just started using R alongside Stata for my research and your videos are really helpful. Very clear and well-paced. Cheers!

ekarl
Автор

I love your videos. I am new to programming and they are very helpful and much easier to understand than other videos I've seen.

fatimahussain
Автор

Hi from Spain, as Deepak I enrolled in a R programming Coursera course, but your lectures are by far better!!!. Thank you very much for sharing your knowledge, surely hard-adquired, with us. I really apreciate it.

antonioj
Автор

thank you very much for your help mr Marin, your videos are very clear and helpful, am not desperate any more, it took me days and years to find someone that can remind me how to use R again, you are an angel from above

Semnyawenda
Автор

Thank you ! i just started using R. Your tutorial series is very clear and organized.. :)

JayShah_star
Автор

you're brilliant.  very simple, straight forward lessons.  thank you! (you're a part of helping millions of visitors experience a better Smithsonian.

samirbitar
Автор

Hi again, and thank you for your really good neutral pronunciation and slow speaking, for the non english people is a plus. +10!!!

antonioj
Автор

i'm biotechnology student, so i don't knw how 2 learn program.but now i'm relief, ur teaching way very nice thank you much sir.

ushagoogol
Автор

detailed easy to follow, no fluff and

IAMAtairuH
Автор

Good explanation, pretty clear thanks for the content. Around 1:13 you've mentioned that the vectors should be the same size to perform arithmetic operations which is true mathematically, but I tried messing around by applying different sizes and I noticed to run an arithmetic operation one needs to have a vector of size proportional to another one for it to operate. Am not sure if that was the flexibility introduced in a recent update but yeah the warning message did say that the size of one vector should be multiple of another.

VARUNRAJS-IMS
Автор

Mr. Marin, wonderful videos! Quick question, why does a vector yield a 'numeric' type but a sequence yields an 'integer' type? What is the difference? Also what is the 'short hand' for selecting the last element in a vector? Thank you!

zacharykirby
Автор

Thanks for uploading these videos, they are very useful for me now that I have the statistics subjects in the computer science career

Nayyrda