# NOT RUN {
# Dataframe used throughout this doc
df <- createDataFrame(cbind(model = rownames(mtcars), mtcars)[, 1:2])
tmp <- mutate(df, v1 = crc32(df$model), v2 = hash(df$model),
v3 = hash(df$model, df$mpg), v4 = md5(df$model),
v5 = sha1(df$model), v6 = sha2(df$model, 256))
head(tmp)
# }
# NOT RUN {
tmp <- mutate(df, v1 = assert_true(df$vs < 2),
v2 = assert_true(df$vs < 2, "custom error message"),
v3 = assert_true(df$vs < 2, df$vs))
head(tmp)
# }
# NOT RUN {
tmp <- mutate(df, v1 = raise_error("error message"))
head(tmp)
# }
Run the code above in your browser using DataLab