我正在尝试在 Azure ML studio 中运行以下R脚本,将数据帧从长格式转换/重新整形(example)。我的脚本在Rstudio中运行得很好。但同样不会在Azure ML工作室中运行并抛出以下错误 - 无法找到函数“rowid”。很高兴知道我怎么能摆脱这个以及究竟是什么造成了这个错误,尽管它足以在Rstudio中整齐地运行。
#loading all libraries in Azure ML environment
x <- c('plyr','reshape2','data.table','reshape')
lapply(x, library, character.only = TRUE)
#Map 1-based optional input ports to variables
cross_sell <- maml.mapInputPort(1) # class: data.frame
#sample maml.mapInputPort(1) output looke like this -
#cross_sell <- data.table(Order.number c('01234567','03221345','01234567'), Art_name = c('cheese','choc','cheese'))
xx_cross_sell <- as.data.frame(dcast(setDT(cross_sell),Order.number ~ rowid(Order.number, prefix = "Article"), value.var = "Art.name"))
cross_sell_tf <- as.data.frame(xx_cross_sell[,2:7])
#Error: Error 0063: The following error occurred during evaluation of R script:
# ---------- Start of error message from R ----------
could not find function "rowid"
# ----------- End of error message from R -----------
我已尝试过两个R版本中的代码 CRAN R 3.1.0 &amp; Microsoft R open 3.2.2 。 非常感谢你提前。
答案 0 :(得分:1)
您好我在2天前使用函数@FXML
void onCRentActionButton(ActionEvent event) throws IOException {
if(CTable.getSelectionModel().getSelectedItem()==null) {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Błąd !!!");
alert.setHeaderText("Nie możesz edytować użytkownika, jeśli żadnego"
+ "nie zaznaczyłeś w tabeli!!");
alert.showAndWait();
} else {
ReaderBorrow rb;
int id=CTable.getSelectionModel().getSelectedItem().getId();
rb = SQLController.getInstance().getReaderToBorrow(id);
borrowController.setReader(rb);
}
}
遇到了同样的问题,始终是包pull()
。
问题是Azure Machine Learning Studio支持的R版本(CRAN R 3.1.0和Microsoft R open 3.2.2)不支持包dplyr
的版本0.7.4
。
如果您阅读与程序包dplyr
相关的MVC approach,则可以看到该程序包仅适用于R版本&gt; = 3.1.2。
然后,您必须等待Azure Machine Learning Studio使用的R版本更新,或者找到您的功能的替代解决方案。