download.datasets: Download one or more datasets from an AzureML workspace.

Description Usage Arguments Value Note See Also Examples

View source: R/datasets.R

Description

Download one or more datasets from an AzureML workspace into local R data frame or raw binary objects.

Usage

1

Arguments

dataset

Either one or more rows from a datasets data frame in a workspace, or just a workspace from workspace. When source is a workspace, then the name parameter must also be specified.

name

Optional character vector of one or more dataset names to filter the datasets parameter list by.

...

Optional arguments to pass to read.table for CSV or TSV DataTypeIds or to readBin for the ZIP DataTypeId. For example, specify stringsAsFactors=TRUE if you wish, or any other valid argument to read.table.

Value

If one dataset is specified (that is, one row from a workspace datasets data frame), then a single data frame is returned. If more than one dataset is specified (more than one row), then a list of data frames is returned.

Note

TSV- and CSV-formatted datasets return data frame results with stringsAsFactors=FALSE by default (independently of the global stringsAsFactors option).

This function can download datasets with various CSV and TSV "DataTypeIds", or "DataTypeId" of "ARFF", "PlainText" or "ZIP". Other "DataTypeIds" return an error. See the AzureML Data Format Conversion modules to convert data to a supported format. Data with DataTypeId "ZIP" are returned in a raw binary R vector, which could then be passed through unzip, for example.

See Also

workspace, datasets, read.table, download.intermediate.dataset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
  library(AzureML)
  
  name <- "Blood donation data"
  
  ws <- workspace()
  
  # The following three alternatives produce the same output:
  frame1 <- download.datasets(ws, name)
  frame2 <- download.datasets(datasets(ws), name)

  # Note that one can examine all the names, sizes, etc. of the datasets
  # in ws by examining d:
  d <- datasets(ws)
  frame3 <- download.datasets(subset(d, Name == name))

  head(frame1)

## End(Not run)

AzureML documentation built on July 28, 2019, 1:02 a.m.