I am using dbplyr/dplyr to query a redshift database.
I have a query that looks like this:
tbl(con, "table") %>%
mutate(random_number = sql("RANDOM()"))
or this
tbl(con, "table") %>%
mutate(random_number = random())
How can I set a seed so that the results are returned predictably? I see in the redshift documentation I would write:
set seed to .25;
select cast (random() * 100 as int);
int4
Is there a straightforward way to incorporate this into my dplyr chain?
thanks!