Create Vector of Zeros in R | Construct Array with 0 Values | rep, numeric, integer & c Functions
How to create a vector of zeros in the R programming language. More details: https://statisticsglobe.com/create-vector-of-zeros-in-r R code of this video: x1 < - rep(0, 5) # Applying rep() function x1 # Printing vector to RStudio console x2 < - rep(0L, 5) # Applying rep() function x2 # Printing vector to RStudio console x3 < - numeric(5) # Applying numeric() function x3 # Printing vector to RStudio console x4 < - integer(5) # Applying integer() function x4 # Printing vector to RStudio console x5 < - c(0, 0, 0, 0, 0) # Applying c() function x5 # Printing vector to RStudio console Follow me on Social Media: Facebook: https://www.facebook.com/statisticsglobecom/ LinkedIn: https://www.linkedin.com/company/statisticsglobe/ Patreon: https://www.patreon.com/statisticsglobe Pinterest: https://www.pinterest.de/JoachimSchork Reddit: https://www.reddit.com/user/JoachimSchork Twitter: https://twitter.com/JoachimSchork
How to create a vector of zeros in the R programming language. More details: https://statisticsglobe.com/create-vector-of-zeros-in-r R code of this video: x1 < - rep(0, 5) # Applying rep() function x1 # Printing vector to RStudio console x2 < - rep(0L, 5) # Applying rep() function x2 # Printing vector to RStudio console x3 < - numeric(5) # Applying numeric() function x3 # Printing vector to RStudio console x4 < - integer(5) # Applying integer() function x4 # Printing vector to RStudio console x5 < - c(0, 0, 0, 0, 0) # Applying c() function x5 # Printing vector to RStudio console Follow me on Social Media: Facebook: https://www.facebook.com/statisticsglobecom/ LinkedIn: https://www.linkedin.com/company/statisticsglobe/ Patreon: https://www.patreon.com/statisticsglobe Pinterest: https://www.pinterest.de/JoachimSchork Reddit: https://www.reddit.com/user/JoachimSchork Twitter: https://twitter.com/JoachimSchork