j_get: Get data from archive

Description Usage Arguments Value See Also Examples

View source: R/j_get.R

Description

Get data from archive. This can be (i) data, (ii) meta data or (iii) object holding both.

Usage

1
2
3
j_get(index, type, version, scenario = james.env$j_root$scenario,
  project = james.env$j_root$project, what = c("data", "meta",
  "object"))

Arguments

index

unique id of your data in j_ls()

type

data type you want to get

version

version you want to get (default is active (c.q. newest) version)

scenario

scenario from which you want to get the data (default is active scenario)

project

project from which you want to get the data (default is active project)

what

data type you want to get is one from c("data", "meta", "object") (default "data")

Value

data, or list with meta data, or JData object (NULL if not present)

See Also

j_put, j_ls, j_init

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
index <- j_put("hi", type = "greeting") # Store "hi" as a type of greeting
j_ls() # see it is stored (in memory). If you want: j_save() stores it to disc, too.
j_get(index)  # get it back; the index is unique and persistent
j_put("hello", type = "greeting") # put another greeting
j_get(type = "greeting") # And get the last greeting back
j_ls() # shows all greetings
j_ls(collapse = TRUE) # shows only the most recent one
j_get(type = "greeting", version = 1) # gets the first greeting back
# Store greeting as part of a project and a scenario:
j_put("bye", type = "greeting", scenario = "English words", project = "language courses")
# Add another data type to this scenario:
j_put("bread", type = "food", scenario = "English words", project = "language courses")
# Shows most recent versions of data types for active project and scenario:
j_ls(collapse = TRUE, filter_active = TRUE)

data-science-made-easy/james documentation built on Dec. 4, 2019, 1:05 p.m.