Question: I have a lambda function which can take longer to complete than 5 mins. It uses a scheduled cron trigger but in the event it doesn't complete, I would like the lambda to run again unless the callback provided to the handler is called to mark it complete. Is there a way to do this with scheduled triggers?

Answer: 
`y` is a tibble, but diff expects a vector. Subsetting a tibble will keep it a tibble. You can use `pull` or `$` to access the data as a vector:

```
library(dplyr)
y <- pull(Sample_Data, 2)
diff(y)

```
This what you want? A quick example.

```
day <- as.POSIXct(c("01-01-2017", "02-01-2017", "03-01-2017", "04-01-2017",
                    "05-01-2017", "06-01-2017", "07-01-2017", "08-01-2017"),
                  format = "%m-%d-%Y")
amount <- c(1400, 1500, 1200, 1300, 800, 900, 500, 1400)
df <- data.frame(Day = day, Amount = amount)
df <- cbind(df, c(0, Diff = diff(df$Amount, lag = 1)))
print(df)

```