我正在使用R(数据科学端到端演练)'创建图表和图表。程序。
请检查链接https://msdn.microsoft.com/en-us/library/mt629162.aspx
执行时,我遇到了步骤'创建地图绘图的问题:
myplots <- rxExec(mapPlot, inDataSource, googMap, timesToRun = 1)
plot(myplots[[1]][["myplot"]])
我收到错误:
Warning: namespace 'CompatibilityAPI' is not available and has been replaced
by .GlobalEnv when processing object 'inputObject'
====== DESKTOP-PHAA5KQ ( process 1 ) has started run
at 2017-01-24 11:39:07.56 ======
Warning: namespace 'CompatibilityAPI' is not available and has been replaced
by .GlobalEnv when processing object 'inputObject'
Loading required package: ggplot2
Loading required package: maps
# ATTENTION: maps v3.0 has an updated 'world' map. #
# Many country borders and names have changed since 1990. #
# Type '?world' or 'news(package="maps")'. See README_v3. #
Error in slot(from, what) :
no slot of name "maxColWidth" for this object of class "RxSqlServerData"
Calls: source ... anyStrings -> validityMethod -> as -> asMethod -> slot
Execution halted
Error in rxCompleteClusterJob(hpcServerJob, consoleOutput, autoCleanup) :
No results available - final job state: failed
> plot(myplots[[1]][["myplot"]])
Error in plot(myplots[[1]][["myplot"]]) : object 'myplots' not found
提前感谢任何建议。
答案 0 :(得分:1)
我认为这是版本问题。
This question给了我一些背景信息。您的IDE或客户端可能没有使用与R服务相同版本的R。
使用以下命令检查IDE和R-Services中的R版本:
R.Version()
对于R-Services,导航到C:\ Program Files \ Microsoft SQL Server \ MSSQL13.YOUR_SERVER_NAME \ R_SERVICES \ bin,然后以管理员身份运行R.exe。
您可能会看到版本不同。在我的情况下,我在RStudio中运行3.3.2但在R服务中运行3.2.2。
对于RStudio,这里how to use different versions of R.按住Control键启动RStudio,允许我选择R-Services实例并成功运行代码。
您还可以更改default library path,这样无论何时打开IDE,您都可以使用服务器的R版本。
答案 1 :(得分:0)
在我的情况下,R服务和R studio都有相同的版本。并且错误消息是ggplot2是ggmap所必需的。对于我的解决方案,我卸载了ggplot2和ggmap,Closed R studio,并以管理权限重新打开它。