This video contains an introduction on how to use the R programming language. The tutorial provides examples for beginners and advanced users. More details: https://statisticsglobe.com/r-program...
00:00 Introduction
01:20 Data Manipulation in R
29:18 Creating Graphics in R
46:26 Data Analysis & Descriptive Statistics
57:03 Advanced Techniques in R
R code of this video:
vec_1 <- c(1, 1, 5, 3, 1, 5) # Create vector object
vec_1 # Print vector object
data_1 <- data.frame(x1 = c(7, 2, 8, 3, 3, 7), # Create data frame
x2 = c("x", "y", "x", "x", "x", "y"),
x3 = 11:16)
data_1 # Print data frame
list_1 <- list(1:5, # Create list
vec_1,
data_1)
list_1 # Print list
class(vec_1) # Check class of vector elements
vec_2 <- c("a", "b", "a", "c") # Create character vector
vec_2 # Create character vector
class(vec_2) # Check class of vector elements
vec_3 <- factor(c("gr1", "gr1", "gr2", "gr3", "gr2")) # Create factor vector
vec_3 # Print factor vector
class(vec_3) # Check class of vector elements
vec_4 <- as.character(vec_3) # Convert factor to character
vec_4 # Print updated vector
class(vec_4) # Check class of updated vector elements
data_2 <- data_1 # Create duplicate of data frame
data_2$x4 <- vec_1 # Add new column to data frame
data_2 # Print updated data frame
data_3 <- data_2[ , colnames(data_2) != "x2"] # Remove column from data frame
data_3 # Print updated data frame
data_4 <- data_3 # Create duplicate of data frame
colnames(data_4) <- c("col_A", "col_B", "col_C") # Change column names
data_4 # Print updated data frame
data_5 <- rbind(data_3, 101:103) # Add new row to data frame
data_5 # Print updated data frame
data_6 <- data_5[data_5$x1 > 3, ] # Remove rows from data frame
data_6 # Print updated data frame
data_7 <- data.frame(ID = 101:106, # Create first data frame
x1 = letters[1:6],
x2 = letters[6:1])
data_7 # Print first data frame
data_8 <- data.frame(ID = 104:108, # Create second data frame
y1 = 1:5,
y2 = 5:1,
y3 = 5)
data_8 # Print second data frame
data_9 <- merge(x = data_7, # Merge two data frames
y = data_8,
by = "ID",
all = TRUE)
data_9 # Print merged data frame
vec_5 <- vec_1 # Create duplicate of vector
vec_5[vec_5 == 1] <- 99 # Replace certain value in vector
vec_5 # Print updated vector
data_10 <- data_1 # Create duplicate of data frame
data_10$x2[data_10$x2 == "y"] <- "new" # Replace values in column
data_10 # Print updated data frame
getwd() # Get current working directory
setwd("C:/Users/Joach/Desktop/my directory")
getwd() # Get current working directory
...
Please find the remaining code here: https://statisticsglobe.com/wp-conten...
Social Media:
Facebook – Statistics Globe Page: / statisticsglobecom
Facebook – Group for Discussions & Questions: / statisticsglobe
LinkedIn – Statistics Globe Page: / statisticsglobe
LinkedIn – Group for Discussions & Questions: / 12555223
Twitter: / joachimschork
Music by bensound.com
On this page of the site you can watch the video online R Programming Tutorial for Beginners (Examples) | Learn Basics | Statistics & Data Science Course with a duration of hours minute second in good quality, which was uploaded by the user Statistics Globe 13 January 2022, share the link with friends and acquaintances, this video has already been watched 8,576 times on youtube and it was liked by 269 viewers. Enjoy your viewing!