Skip to content

Latest commit

 

History

History
513 lines (477 loc) · 27.7 KB

machine-learning-extend-your-experiment-with-r.md

File metadata and controls

513 lines (477 loc) · 27.7 KB
title description services documentationcenter author manager editor ms.assetid ms.service ms.workload ms.tgt_pltfrm ms.devlang ms.topic ms.date ms.author
Extend your experiment with R | Microsoft Docs
How to extend the functionality of Azure Machine Learning Studio through the R language by using the Execute R Script module.
machine-learning
garyericson
jhubbard
cgronlun
2c038a45-ba4d-42ea-9a88-e67391ef8c0a
machine-learning
data-services
na
na
article
12/12/2016
garye

Extend your experiment with R

You can extend the functionality of Azure Machine Learning Studio through the R language by using the Execute R Script module.

This module accepts multiple input datasets and yields a single dataset as output. You can type an R script into the R Script parameter of the Execute R Script module.

You access each input port of the module by using code similar to the following:

dataset1 <- maml.mapInputPort(1)

Listing all currently-installed packages

The list of installed packages can change. A list of currently installed packages can be found in R Packages Supported by Azure Machine Learning.

You also can get the complete, current list of installed packages by entering the following code into the Execute R Script module:

out <- data.frame(installed.packages(,,,fields="Description"))
maml.mapOutputPort("out")

This sends the list of packages to the output port of the Execute R Script module. To view the package list, connect a conversion module such as Convert to CSV to the left output of the Execute R Script module, run the experiment, then click the output of the conversion module and select Download.

Download output of "Convert to CSV" module

Importing packages

You can import packages that are not already installed by using the following commands in the Execute R Script module:

install.packages("src/my_favorite_package.zip", lib = ".", repos = NULL, verbose = TRUE)
success <- library("my_favorite_package", lib.loc = ".", logical.return = TRUE, verbose = TRUE)

where the my_favorite_package.zip file contains your package.

[!INCLUDE machine-learning-free-trial]