create_frame: Create a New Frame in Stack

Description Usage Arguments Value Examples

View source: R/stack.R

Description

Frame is kind of revision of data user is going to publish. It consists of one or more views. Views are usually plots with some parameters to distinguish one plot from another. This function creates a frame and by default it checks permission to publish to this stack.

Usage

1
2
3
4
5
6
7
8
create_frame(
  stack,
  profile = "default",
  auto_push = FALSE,
  protocol = NULL,
  encryption = NULL,
  check_access = TRUE
)

Arguments

stack

A name of stack to use.

profile

A profile refers to credentials, i.e. username and token. Default profile is named 'default'. The system is looking for specified profile as follows: it looks into working directory to find a configuration file (local configuration), if the file doesn't exist it looks into user directory to find it (global configuration). The best way to manage profiles is to have dstack CLI tools installed. These tools are written in Python 3, so you have to install dstack support. In the case of PyPI you should type

$ pip install dstack

or

$ conda install -c dstack.ai dstack

We recommend to use local (virtual) environment to install the package. You can use this command in console:

$ dstack config list

to list existing profiles or add or replace token by following command

$ dstack config add <PROFILE>

or simply

$ dstack config add

if profile is not specified 'default' profile will be created. The system asks you about token from command line, make sure that you have already obtained token from the site.

auto_push

Tells the system to push frame just after commit. It may be useful if you want to see result immediately. Default is FALSE.

protocol

Protocol to use, usually it is NULL it means that json_protocol will be used.

encryption

This is a ecryption method. By default is NULL and no encryption will be used.

check_access

Check access to specified stack, default is TRUE.

Value

New frame.

Examples

1
2
3
4
5
6
library(ggplot2)
library(dstack)
image <- qplot(clarity, data = diamonds, fill = cut, geom = "bar")
frame <- create_frame(stack = "diamonds")
frame <- commit(frame, image, "Diamonds bar chart")
print(push(frame)) # print actual stack URL

dstack documentation built on Aug. 12, 2020, 5:08 p.m.