civis_platform: Evaluate an expression in Civis Platform

Description Usage Arguments Value Examples

View source: R/civis_future.R

Description

This is used as with the future API as an argument to plan.

Usage

1

Arguments

...

Arguments to CivisFuture and then scripts_post_containers

Value

The result of evaluating expr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 

 plan(civis_platform)

 # Specify required resources, image, and tag.
 fut <- future({2 + 2},
   required_resources = list(cpu = 1024, memory = 2048),
   docker_image_name = "civisanalytics/datascience-r",
   docker_image_tag = "3")

 # Evaluate the future later
 fut <- future({2 + 2}, lazy = TRUE)
 run(fut)

 # check if a future has resolved
 resolved(fut)

 # block until the future resolves, and return the value or throw error
 value(fut)

 # cancel the job
 cancel(fut)

 # grab the run logs
 fetch_logs(fut)

 # handle errors
 fut <- future({stop("Error!")})
 e <- tryCatch(value(fut), error = function(e) e)
 get_error(e)

## End(Not run)

civisanalytics/civis-r documentation built on June 27, 2020, 7:25 a.m.