oo <- options(onetime.dir = tempdir(check = TRUE))
id <- sample(10000L, 1)
onetime_message("will be shown", id = id)
onetime_message("won't be shown", id = id)
onetime_reset(id = id)
onetime_message("will be shown", id = id)
onetime_reset(id = id)
options(oo)
Run the code above in your browser using DataLab