Cumulative Sum in R (Example) | cumsum Function | How to Compute & Plot Vector in Graphic

Описание к видео Cumulative Sum in R (Example) | cumsum Function | How to Compute & Plot Vector in Graphic

How to calculate the cumulative sum with the cumsum function in the R programming language. More details: https://statisticsglobe.com/cumsum-r-...
R code of this video:

set.seed(456654) # Set seed for reproducibility
x <- round(runif(10, 1, 9)) # Create example vector
x # Print example vector

csx <- cumsum(x) # Apply cumsum R function

plot(x = 1:length(csx), # Plot of cumsum vector
y = csx,
main = "Cumulative Frequency Distribution",
xlab = "Length of Example Vector",
ylab = "Cumulative Sum",
type = "o")

Комментарии

Информация по комментариям в разработке