-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathtar_resources_future.Rd
89 lines (85 loc) · 3.47 KB
/
tar_resources_future.Rd
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tar_resources_future.R
\name{tar_resources_future}
\alias{tar_resources_future}
\title{Target resources: \code{future} high-performance computing}
\usage{
tar_resources_future(
plan = NULL,
resources = targets::tar_option_get("resources")$future$resources
)
}
\arguments{
\item{plan}{A \code{future::plan()} object or \code{NULL},
a \code{target}-specific \code{future} plan. Defaults to \code{NULL}.}
\item{resources}{Named list, \code{resources} argument to
\code{future::future()}. This argument is not supported in
some versions of \code{future}. For versions of \code{future}
where \code{resources} is not supported, instead supply \code{resources}
to \code{future::tweak()} and assign the returned plan to the \code{plan} argument
of \code{tar_resources_future()}.
The default value of \code{resources} in \code{tar_resources_future()}
is an empty list.}
}
\value{
Object of class \code{"tar_resources_future"}, to be supplied
to the \code{future} argument of \code{tar_resources()}.
}
\description{
Create the \code{future} argument of \code{tar_resources()}
to specify optional high-performance computing settings
for \code{tar_make_future()}.
This is how to supply the \code{resources}
argument of \code{future::future()} for \code{targets}.
Resources supplied through
\code{future::plan()} and \code{future::tweak()} are completely ignored.
For details, see the documentation of the \code{future} R package
and the corresponding argument names in this help file.
}
\section{Resources}{
Functions \code{\link[=tar_target]{tar_target()}} and \code{\link[=tar_option_set]{tar_option_set()}}
each takes an optional \code{resources} argument to supply
non-default settings of various optional backends for data storage
and high-performance computing. The \code{tar_resources()} function
is a helper to supply those settings in the correct manner.
In \code{targets} version 0.12.2 and above, resources are inherited one-by-one
in nested fashion from \code{tar_option_get("resources")}.
For example, suppose you set
\code{tar_option_set(resources = tar_resources(aws = my_aws))},
where \code{my_aws} equals \code{tar_resources_aws(bucket = "x", prefix = "y")}.
Then, \verb{tar_target(data, get_data()} will have bucket \code{"x"} and
prefix \code{"y"}. In addition, if \code{new_resources} equals
\verb{tar_resources(aws = tar_resources_aws(bucket = "z")))}, then
\code{tar_target(data, get_data(), resources = new_resources)}
will use the new bucket \code{"z"}, but it will still use the prefix \code{"y"}
supplied through \code{tar_option_set()}. (In \code{targets} 0.12.1 and below,
options like \code{prefix} do not carry over from \code{tar_option_set()} if you
supply non-default resources to \code{tar_target()}.)
}
\examples{
# Somewhere in you target script file (usually _targets.R):
tar_target(
name,
command(),
resources = tar_resources(
future = tar_resources_future(resources = list(n_cores = 2))
)
)
}
\seealso{
Other resources:
\code{\link{tar_resources}()},
\code{\link{tar_resources_aws}()},
\code{\link{tar_resources_clustermq}()},
\code{\link{tar_resources_crew}()},
\code{\link{tar_resources_custom_format}()},
\code{\link{tar_resources_feather}()},
\code{\link{tar_resources_fst}()},
\code{\link{tar_resources_gcp}()},
\code{\link{tar_resources_network}()},
\code{\link{tar_resources_parquet}()},
\code{\link{tar_resources_qs}()},
\code{\link{tar_resources_repository_cas}()},
\code{\link{tar_resources_url}()}
}
\concept{resources}