In R, you can use diff() as a arugment in the transform() :
transform(df, entry = c(cum_entry[1], diff(cum_entry)))
# Day cum_entry entry
#1 1 0 0
#2 2 1 1
#3 3 2 1
#4 3 2 0
#5 4 3 1
#6 4 3 0
In dplyr, we can use lag() as an argument in the mutate function :
library(dplyr)
df %>% mutate(entry = cum_entry - lag(cum_entry, default = 0))
If you are a beginner and want to know more about R then do check out the R programming course that will help you out in a better way.