Creates a new attachment.
addAttachment(name = NULL, file = NULL, data = NULL)
file
is specified,
the name can be omitted and the basename of the file
is used.
If name
is a string pointing to a file and file
is not
specified, the content of the file pointed by name
is used as
attachment data.data
is a list in which
names(data)
is not empty, the data is first converted to csv.An attachment object suitable for use with methods of
DOcplexcloudClient
and DOcplexcloudJob
.
# Creates an attachment whose content is the content of this file, # and whose name is "model.lp" (the 3 expressions are equivalent): a <- addAttachment(file = "/home/joe/models/model.lp") a <- addAttachment(name = "/home/joe/models/model.lp") a <- addAttachment("/home/joe/models/model.lp") # Creates an attachment whose content is the specified file, and # whose name is "model.lp" a <- addAttachment(name = "model.lp", file = "/home/joe/models/model_1231.lp") # Create an attachment whose data is stored in memory model <- "Minimize obj: x + y Subject To Bounds 3 <= x <= 17 2 <= y End" a <- addAttachment(name="model.lp", data=charToRaw(model)) ## Not run: ------------------------------------ # # Submits and runs the specified model.lp: # job <- client$submitJob(addAttachment("/home/joe/models/model.lp")) ## ---------------------------------------------