Data Types and Data Dimensions in R | Learn R
Jarad Niemi
#jaradniemi #learnr #datatypes #datastructures #numeric #character #logical #vector #matrix
This video covers the basic data types of numeric, logical, and character objects and their dimension including scalar, vector, and matrix in the statistical software R.
By default R stores all numeric quantities as a numeric using double precision in memory. There is also the ability to utilize integers, but (for data analysis purposes.
For vectors, we discuss how to construct vectors, access vector elements, and modify vector elements. We construct vectors using the c(), seq(), and rep(). We access vector elements using square brackets ( [ ] ) along with the indices, but you can also access vector elements using a logical vector. We modify vector elements by accessing those elements and using the assignment operator.
For matrices we discuss how to construct matrices, access elements, and modify matrix elements. We construct matrices using cbind(), rbind(), and matrix(). We access matrix elements using square brackets with a comma in between ( [ , ] ) with the row and column indices, but you can also access matrix elements using logical vectors. We modify matrix elements by accessing those elements and using the assignment operator.
Learn R: https://www.youtube.com/playlist?list=PLFHD4aOUZFp1wYrk8AIW0LGL4f9lBg79B
R download: https://www.r-project.org/ RStudio download: https://www.rstudio.com/products/rstudio/download/
R logo (no changes made): https://www.r-project.org/logo/
Time stamps
00:00 Introduction 00:40 class(), length(), dim() 01:22 Numeric 01:54 Character 02:34 Logical 03:51 Integers 05:40 Vectors 08:00 Construct vectors 09:04 seq() 11:50 rep() 15:30 Access vector elements 17:00 Access vector elements using logicals 18:13 Modify vector elements 19:20 Construct matrices 22:00 Access matrix elements 24:10 Arrays 24:45 Data types in matrices 25:42 Conclusion ... https://www.youtube.com/watch?v=zfP_GAmgaWM
97032588 Bytes