Create Vector of Zeros in R | Construct Array with 0 Values | rep, numeric, integer & c Functions

preview_player
Показать описание
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:
Рекомендации по теме
Комментарии
Автор

Thanks, Joachim!
So the L in x2 specifies an integer vector. Nice!

agsoutas
Автор

Do any of these videos present how to show category with zero frequencies in a bar chart? If not, can you make one? The category with zero in my bar chart is automatically dropped.

zioncrichlow