vesko
vesko

Reputation: 11

Create Graphs and Plots Using R in Microsoft R Server

I am going over 'Create Graphs and Plots Using R (Data Science End-to-End Walkthrough)' procedure.

Please check link https://msdn.microsoft.com/en-us/library/mt629162.aspx

I have issue with step 'Create a Map Plot', when executing:

myplots <- rxExec(mapPlot, inDataSource, googMap, timesToRun = 1)  
plot(myplots[[1]][["myplot"]])

I am getting error:

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

Thanks in advance for any suggestion.

Upvotes: 1

Views: 229

Answers (2)

Michael Gyekye
Michael Gyekye

Reputation: 1

In my case both R services and R studio had same version. And the error message was ggplot2 is required by ggmap. For my solution I uninstalled both ggplot2 and ggmap, Closed R studio and reopened it with administrative rights.

Upvotes: 0

mmmiiiiiikkkeee
mmmiiiiiikkkeee

Reputation: 51

I think this is a version issue.

This question gave me some context. Your IDE or client may not be using the same version of R as R-Services.

Check the version of R in your IDE and R-Services using:

R.Version()

For R-Services, navigate to C:\Program Files\Microsoft SQL Server\MSSQL13.YOUR_SERVER_NAME\R_SERVICES\bin then run R.exe as admin.

You might see that the versions are different. In my case I was running 3.3.2 in RStudio but have 3.2.2 in R-Services.

For RStudio, here's how to use different versions of R. Starting RStudio with the Control key held down allowed me to select the R-Services instance and run the code successfully.

You can also change your default library path so that whenever you open your IDE you're working with the server's version of R.

Upvotes: 1

Related Questions