@@ -4,12 +4,13 @@ titleSuffix: Azure Machine Learning
44description : ' Learn how to work with R interactively on Azure Machine Learning'
55ms.service : azure-machine-learning
66ms.subservice : core
7- ms.date : 06/01/2023
7+ ms.date : 03/21/2025
88ms.topic : how-to
99author : sdgilley
1010ms.author : sgilley
1111ms.reviewer : mavaisma
1212ms.devlang : r
13+ # customer intent: As a data scientist, I want to use R interactively in Azure Machine Learning so that I can develop and test my models.
1314---
1415
1516# Interactive R development
@@ -107,42 +108,6 @@ For data stored in a data asset [created in Azure Machine Learning](how-to-creat
107108
108109 [! Notebook - r [](~ / azureml - examples - mavaisma - r - azureml / tutorials / using - r - with - azureml / 02 - develop - in - interactive - r / work - with - data - assets.ipynb ?name = read - uri )]
109110
110- You can also use a Datastore URI to access different files on a registered Datastore , and read these resources into an R `data.frame`.
111-
112- 1 . In this format , create a Datastore URI , using your own values :
113-
114- `` `r
115- subscription <- ' <subscription_id>'
116- resource_group <- ' <resource_group>'
117- workspace <- ' <workspace>'
118- datastore_name <- ' <datastore>'
119- path_on_datastore <- ' <path>'
120-
121- uri <- paste0(" azureml://subscriptions/" , subscription , " /resourcegroups/" , resource_group , " /workspaces/" , workspace , " /datastores/" , datastore_name , " /paths/" , path_on_datastore )
122- ```
123-
124- > [! TIP ]
125- > Instead of remembering the datastore URI format , you can copy - and - paste the datastore URI from the Studio UI , if you know the datastore where your file is located :
126- > 1 . Navigate to the file / folder you want to read into R
127- > 1 . Select the elipsis (** ... ** ) next to it.
128- > 1 . Select from the menu ** Copy URI ** .
129- > 1 . Select the ** Datastore URI ** to copy into your notebook / script.
130- > Note that you must create a variable for `<path>` in the code.
131- > ::: image type = " content" source = " media/how-to-r-interactive-development/datastore-uri-copy.png" alt - text = " Screenshot highlighting the copy of the datastore URI." :::
132-
133- 2 . Create a filestore object using the previously mentioned URI :
134- `` `r
135- fs <- azureml.fsspec $ AzureMachineLearningFileSystem(uri , sep = " " )
136- ```
137-
138- 3 . Read into an R ` data.frame ` :
139- ``` r
140- df <- with(fs $ open(" <path>)" , " r" ) %as % f , {
141- x <- as.character(f $ read(), encoding = " utf-8" )
142- read.csv(textConnection(x ), header = TRUE , sep = " ," , stringsAsFactors = FALSE )
143- })
144- print(df )
145- ```
146111
147112# # Install R packages
148113
@@ -188,7 +153,3 @@ Beyond the issues described earlier, use R as you would in any other environment
188153> [!NOTE]
189154> - From an interactive R session, you can only write to the workspace file system.
190155> - From an interactive R session, you cannot interact with MLflow (such as log model or query registry).
191-
192- ## Next steps
193-
194- * [ Adapt your R script to run in production] ( how-to-r-modify-script-for-production.md )
0 commit comments