从R Script(Azure ML Studio)读取JSON [英] Read a JSON from R Script (Azure ML Studio)

查看:66
本文介绍了从R Script(Azure ML Studio)读取JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi! 

我正在尝试从R脚本模块中的JSON读取值,如下所示:

I'm trying to read values from a JSON in a R script Module as follows:


地址<-enc2utf8(粘贴(dataset1 $ street [ite],dataset1 $ number [ite],"Madrid",España"))

url     <-" https://..../json?"
url     <-URLencode(paste(url,address,"+& key =",APIkey,& sensor = false",sep =")))

output<-from JSON(URL,simple = FALSE,encoding ="UTF-8")


address <- enc2utf8(paste(dataset1$street[ite], dataset1$number[ite], "Madrid", "España"))

url     <- "https://..../json?"
url     <- URLencode(paste(url, address, "+&key=",APIkey, "&sensor=false", sep = ""))

output <- fromJSON(url, simplify = FALSE, encoding = "UTF-8")

但是我收到以下错误:

But I received the following error:

             错误0063:R脚本评估期间发生以下错误:

                            ----------来自R的错误消息的开始----------

                                       无法打开连接

              Error 0063: The following error occurred during evaluation of R script:

                            ---------- Start of error message from R ----------

                                       cannot open the connection

在Azure ML Studio中还有另一种从JSON获取数据的方法吗?

There is another way to obtain data from JSON in Azure ML Studio?


推荐答案

用于从JSON获取数据:

For obtaining data from JSON:

R和Python都支持REST API,因此请使用

Both R and Python support REST APIs, so use the Execute Python Script or Execute R Script modules to parse your data and save it as an Azure ML dataset.

或者,使用CosmosDB的SQL DB API(该数据库支持多个JSON存储,包括MongoDB)来使用 从Azure Cosmos DB导入选项.有关更多信息,请参见

Or, use the SQL DB API for CosmosDB, which supports multiple JSON stores, including MongoDB, to read your data using the Import from Azure Cosmos DB option. For more information, see Import from Azure Cosmos DB.

用于使用R脚本解析JSON:

For using R script to parse JSON:

https://stackoverflow.com/questions/2061897/parse-json-with-r

https://stackoverflow.com/questions/2061897/parse-json-with-r

问候

宇通


这篇关于从R Script(Azure ML Studio)读取JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆