Skip to content

Commit 1f3e0a9

Browse files
committed
Acrolinx fixes
1 parent c40957b commit 1f3e0a9

9 files changed

Lines changed: 38 additions & 43 deletions

docs/advanced-analytics/r/create-a-local-package-repository-using-minicran.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,24 @@ There are two ways that you can prepare R packages for installation onto a serve
2727

2828
- [Manually download and copy packages one by one](#bkmk_manual)
2929

30-
This article describes how you can create an R package repository using both methods, with particualr emphasis on the **miniCRAN** package.
30+
This article describes how you can create an R package repository using both methods, and recommends use of the **miniCRAN** package.
3131

3232
## Prepare packages using miniCRAN
3333

3434
The goal of creating a local package repository is to provide a single location that a server administrator or other users in the organization can use to install new R packages on a server that does not have internet access.
3535

36-
The miniCRAN package for R was written by Andre de Vries to make it easier to create a consistent, managed set of R packages for an organization.
37-
38-
After creating the repository, you can modify it by adding new packages or upgrading the version of existing packages.
39-
40-
- For details, see [miniCRAN](https://cran.r-project.org/web/packages/miniCRAN/index.html)
41-
42-
- For a walkthrough of the repository creation process, see [How to install R packages on an off-line SQL Server 2016 instance](http://blog.revolutionanalytics.com/2016/05/minicran-sql-server.html)
43-
36+
The [miniCRAN](https://cran.r-project.org/web/packages/miniCRAN/index.html) package for R was written by [Andre de Vries](http://blog.revolutionanalytics.com/2016/05/minicran-sql-server.html) to make it easier to create a consistent, managed set of R packages for an organization.
4437

4538
There are many advantages to using miniCRAN to create the repository:
4639

47-
- **Security**: Many R users are accustomed to downloading and installing new R packages at will, from CRAN or one of its mirror sites. However, for security reasons, production servers running [!INCLUDE[ssNoVersion_md](file:///C:\includes\ssnoversion-md.md)] typically do not have internet connectivity.
40+
- **Security**: Many R users are accustomed to downloading and installing new R packages at will, from CRAN or one of its mirror sites. However, for security reasons, production servers running [!INCLUDE[ssNoVersion_md](..\..\includes\ssnoversion-md.md)] typically do not have internet connectivity.
4841

4942
- **Easier offline installation**: To install package to an offline server requires that you also download all package dependencies, Using miniCRAN makes it easier to get all dependencies in the correct format.
5043

5144
- **Improved version management**: In a multiuser environment, there are good reasons to avoid unrestricted installation of multiple package versions on the server.
5245

46+
After creating the repository, you can modify it by adding new packages or upgrading the version of existing packages.
47+
5348
### Step 1. Install the miniCRAN package
5449

5550
You begin by creating a miniCRAN repository to use as a source. You should create this repository on a computer that has internet access.
@@ -83,7 +78,7 @@ You begin by creating a miniCRAN repository to use as a source. You should creat
8378
8479
1. After miniCRAN is installed, create a list that specifies the additional packages you want to download.
8580
86-
Do not include dependencies; the **igraph** package used by miniCRAN generates the list of dependencies for you. For more information about how to use this graph, see [Using miniCRAN to identify package
81+
Do not add dependencies to this initial list; the **igraph** package used by miniCRAN generates the list of dependencies for you. For more information about how to use this graph, see [Using miniCRAN to identify package
8782
dependencies](https://cran.r-project.org/web/packages/miniCRAN/vignettes/miniCRAN-dependency-graph.html).
8883
8984
The following R script demonstrates how to get the target packages, "zoo"
@@ -105,7 +100,7 @@ You begin by creating a miniCRAN repository to use as a source. You should creat
105100
makeRepo(pkgs_expanded, path = local_repo, repos = CRAN_mirror, type = "win.binary", Rversion = "3.3")
106101
```
107102
108-
From this information, the miniCRAN package creates the folder structure that you need to copy the packages to the [!INCLUDE[ssNoVersion_md](file:///C:\includes\ssnoversion-md.md)] later.
103+
From this information, the miniCRAN package creates the folder structure that you need to copy the packages to the [!INCLUDE[ssNoVersion_md](..\..\includes\ssnoversion-md.md)] later.
109104
110105
4. At this point you should have a folder containing the packages you needed, and any additional packages that were required.
111106
@@ -192,7 +187,7 @@ After downloading the packages, you install the R packages from the zipped file
192187

193188
1. Download the packages zip files, and save them in a local folder
194189

195-
2. Copy that folder to the [!INCLUDE[ssNoVersion_md](file:///C:\includes\ssnoversion-md.md)] computer.
190+
2. Copy that folder to the [!INCLUDE[ssNoVersion_md](..\..\includes\ssnoversion-md.md)] computer.
196191

197192
3. Install the packages into the SQL Server instance library.
198193

docs/advanced-analytics/r/determine-which-packages-are-installed-on-sql-server.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ manager: "jhubbard"
1717
---
1818
# Determine which R packages are installed on SQL Server
1919

20-
When you install Machine Learning Services with the R language option, or install
21-
[!INCLUDE[rsql_productname](file:///C:\includes\rsql-productname-md.md)], setup creates an R package library associated with the instance. Each instance has a separate package library. Package libraries are **not** shared across instances, so it is possible for different packages to be installed on different instances.
20+
When you install machine learning in SQL Server with the R language option, setup creates an R package library associated with the instance. Each instance has a separate package library. Package libraries are **not** shared across instances, so it is possible for different packages to be installed on different instances.
2221

23-
This article describes how you can determine which R packages are installed for a specific the [!INCLUDE[ssNoVersion](file:///C:\includes\ssnoversion-md.md)] instance.
22+
This article describes how you can determine which R packages are installed for a specific instance.
2423

2524
## Generate R package list using a stored procedure
2625

27-
The following example uses the base R function `installed.packages()` in a [!INCLUDE[tsql](file:///C:\includes\tsql-md.md)] stored procedure to get a matrix of packages that have been installed in the R_SERVICES library for the current instance. To avoid parsing the fields in the DESCRIPTION file, only the name is returned.
26+
The following example uses the R function `installed.packages()` in a [!INCLUDE[tsql](..\..\includes\tsql-md.md)] stored procedure to get a matrix of packages that have been installed in the R_SERVICES library for the current instance. To avoid parsing the fields in the DESCRIPTION file, only the name is returned.
2827

2928
```SQL
3029
EXECUTE sp_execute_external_script
@@ -52,7 +51,7 @@ GO
5251

5352
This example looks for and loads the RevoScaleR library.
5453

55-
+ If the package is found, the message returned should be something like "Commands completed successfully".
54+
+ If the package is found, the message returned should be something like "Commands completed successfully."
5655

5756
+ If the package cannot be located or loaded, you get an error like this: "An external script error occurred: Error in library("RevoScaleR"): there is no package called RevoScaleR"
5857

docs/advanced-analytics/r/install-additional-r-packages-on-sql-server.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ The process differs slightly depending on the version of SQL Server you are runn
3030

3131
See [Getting the correct package version and format](#packageVersion) for details.
3232

33-
2. If the server does not have internet access, you'll need to download the binaries in zipped format in advance.
33+
2. If the server does not have internet access, download the binaries in advance.
34+
3435
See [Download zip files](#bkmk_zipPreparation) for details.
3536

36-
3. If installing offline, check for package dependencies and get any related packages that might be needed during installation. Using the [miniCRAN package](#bkmk_packageDependencies) is an easy way to prepare a collection of packages and their dependeicnies.
37+
3. If installing offline, check for package dependencies and get any related packages that might be needed during installation. Using the [miniCRAN package](#bkmk_packageDependencies) is an easy way to prepare a collection of packages and their dependencies.
3738

3839
4. Package installation methods differ depending on whether the server has internet access, and on your version of SQL Server. The recommended methods are as follows:
3940

@@ -59,7 +60,7 @@ The process differs slightly depending on the version of SQL Server you are runn
5960

6061
There are multiple sources for R packages, the best known among them being CRAN and Bioconductor. The official site for the R language (<https://www.r-project.org/>) lists many of these resources. Many packages are also published to GitHub, where you can obtain the source code. However, you may also have been given R packages that were developed by someone in your company.
6162

62-
Regardless of the source, you must ensure that the package you want to install has a binary format for the Windows platform. Otherwise the downloaded package will not run in the SLQ Server environment.
63+
Regardless of the source, you must ensure that the package you want to install has a binary format for the Windows platform. Otherwise the downloaded package cannot run in the SQL Server environment.
6364

6465
You should also determine whether the package is compatible with the version of R that is running in SQL Server.
6566

@@ -91,7 +92,7 @@ If you need to install multiple packages, or want to ensure that everyone in you
9192

9293
If you are an experienced R user, you might be accustomed to installing packages from the command line without special permissions, or without downloading them in advance. However, most servers do not have an internet connection and access to file shares or storage might be restricted.
9394

94-
This section describes the different level of permissions required for installing pckages in SQL Server 2016 and SQl Server 2017. Installation can be done using either R tools or SQL Server, but the process and permissions differ slightly.
95+
This section describes the different level of permissions required for installing packages in SQL Server 2016 and SQl Server 2017. Installation can be done using either R tools or SQL Server, but the process and permissions differ slightly.
9596

9697
- SQL Server 2016
9798

@@ -107,7 +108,7 @@ This section describes the different level of permissions required for installin
107108

108109
> [!IMPORTANT]
109110
>
110-
> Experienced R users are accustomed to installing packages in a user library, and then referencing the package in that folder as part of the R solution, by specifying a file path. This practice will not work in SQL Server. For more information and workarounds, see [How to use packages in user libraries](packages-installed-in-user-libraries.md).
111+
> Experienced R users are accustomed to installing packages in a user library, and then referencing the package in that folder as part of the R solution, by specifying a file path. This practice is not supported in SQL Server. For more information and workarounds, see [How to use packages in user libraries](packages-installed-in-user-libraries.md).
111112
112113
### Comparing package management methods
113114

docs/advanced-analytics/r/installing-and-managing-r-packages.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,29 @@ Installation of R in SQL Server 2016 and SQL Server 2017 also includes the **Rev
6363

6464
## Permissions required for installing R packages
6565

66-
In SQL Server 2016, an administrator had to istall new R packages on an instance-wide basis. In SQL Server 2017, new database features were added that give the database administrator the ability to delegate package management to selected users.
66+
In SQL Server 2016, an administrator had to install new R packages on an instance-wide basis. In SQL Server 2017, new database features were added that give the database administrator the ability to delegate package management to selected users.
6767

6868
This section describes the permissions required to install and manage packages per version.
6969

7070
+ SQL Server 2016 R Services (In-Database)
7171

72-
To install a new R package on a computer that is running [!INCLUDE[ssCurrent](file:///C:\includes\sscurrent-md.md)], you must have administrative rights to the computer. It is the task of the database administrator or other administrator on the server to ensure that all required packages are installed on the [!INCLUDE[ssNoVersion_md](file:///C:\includes\ssnoversion-md.md)] instance.
72+
To install a new R package on a computer that is running [!INCLUDE[ssCurrent](..\..\includes\sscurrent-md.md)], you must have administrative rights to the computer. It is the task of the database administrator or other administrator on the server to ensure that all required packages are installed on the [!INCLUDE[ssNoVersion_md](..\..\includes\ssnoversion-md.md)] instance.
7373

74-
If you do not have administrative privileges on the computer that hosts the [!INCLUDE[ssNoVersion_md](file:///C:\includes\ssnoversion-md.md)] instance, you can provide to the administrator information about how to install R packages, and provide access to a secure package repository where packages requested by users can be obtained.
74+
If you do not have administrative privileges on the computer that hosts the [!INCLUDE[ssNoVersion_md](..\..\includes\ssnoversion-md.md)] instance, you can provide to the administrator information about how to install R packages, and provide access to a secure package repository where packages requested by users can be obtained.
7575

7676
+ SQL Server 2017 Machine Learning Services
7777

78-
This release includes package management functions that let database administrator delegate package installation rights to selected users. If this feature has been enabled, request that your database administrator add you to one of the new pakcage roles. For more information, see [R package management for SQL Server](r-package-management-for-sql-server-r-services.md).
78+
This release includes package management functions that let database administrator delegate package installation rights to selected users. If this feature has been enabled, request that your database administrator add you to one of the new package roles. For more information, see [R package management for SQL Server](r-package-management-for-sql-server-r-services.md).
7979

80-
If you are an administrator on the SQL Server instance, you can install new packages at will. Just be sure to use the default library that is associated with the instance, or the package might not run when called from a stored procedure, or as part of a remote SQL Server compute context.
80+
If you are an administrator on the SQL Server instance, you can install new packages at will. Just be sure to use the default library that is associated with the instance. Packages installed to other locations cannot run when called from a stored procedure. Any R code that runs using the SQL Server as a compute context also requires that packages be available in the instance library.
8181

8282
+ R Server (Standalone)
8383

8484
You need administrative rights to the computer to install new R packages.
8585

8686
+ Other client environments
8787

88-
If you are installing a new R package on a computer that is being used as an R workstation and the computer does **not** have an instance of [!INCLUDE[ssNoVersion_md](file:///C:\includes\ssnoversion-md.md)] installed, you still need administrative rights to the computer to install the package. After you have installed the package, you can run it locally.
88+
If you are installing a new R package on a computer that is being used as an R workstation and the computer does **not** have an instance of [!INCLUDE[ssNoVersion_md](..\..\includes\ssnoversion-md.md)] installed, you still need administrative rights to the computer to install the package. After you have installed the package, you can run it locally.
8989

9090
## Managing or viewing installed packages
9191

docs/advanced-analytics/r/package-install-uninstall-and-sync.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Before you can use package synchronization, you must have the appropriate versio
4646

4747
This feature is available in SQL Server 2017 CTP 2 or later.
4848

49-
Because this feature uses R functions in Microsoft R version 9.1.0, you can add this feature to a instance of SQL Server 2016 by upgrading the instance to use the latest version of Microsoft R. For more information, see [Use SqlBindR.exe to Upgrade SQL Server R Services](use-sqlbindr-exe-to-upgrade-an-instance-of-sql-server.md).
49+
Because this feature uses R functions in Microsoft R version 9.1.0, you can add this feature to an instance of SQL Server 2016 by upgrading the instance to use the latest version of Microsoft R. For more information, see [Use SqlBindR.exe to Upgrade SQL Server R Services](use-sqlbindr-exe-to-upgrade-an-instance-of-sql-server.md).
5050

5151
### Enable the package management feature
5252

@@ -63,7 +63,7 @@ Whenever you add a new package using the package management functions, both the
6363
> You cannot use package synchronization if you have been installing R packages the traditional way, using R tools to install packages directly into the file system.
6464
### Permissions
6565

66-
+ The person who executes the package snchronization function must be a security principal on the SQL
66+
+ The person who executes the package synchronization function must be a security principal on the SQL
6767
Server instance and database that has the packages.
6868

6969
+ The caller of the function must be a member of one of these package management roles: **rpkgs-shared** or **rpkgs-private**.
@@ -103,13 +103,13 @@ rxSyncPackages(computeContext=computeContext, verbose=TRUE)
103103

104104
### Example 2. Restrict synchronized packages by scope
105105

106-
The following examples synchonize only the packages in the specified scope.
106+
The following examples synchronize only the packages in the specified scope.
107107

108108
```R
109109
#Shared scope
110110
rxSyncPackages(computeContext=computeContext, scope="shared", verbose=TRUE)
111111

112-
#Private scope**
112+
#Private scope
113113
rxSyncPackages(computeContext=computeContext, scope="private", verbose=TRUE)
114114
```
115115

docs/advanced-analytics/r/packages-installed-in-user-libraries.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ manager: "jhubbard"
1717
---
1818
# Avoiding errors on R packages installed in user libraries
1919

20-
Experienced R users are accustomed to installing R packages in a user library, if the default library is blocked or not available. However, this approach is not supported in SQL Server, and installation to a user library usually ends in a “package not found” error.
20+
Experienced R users are accustomed to installing R packages in a user library, whenever the default library is blocked or not available. However, this approach is not supported in SQL Server, and installation to a user library usually ends in a “package not found” error.
2121

2222
This topic provides workarounds to help you avoid this error. It explains how you can modify your R code, and suggests the correct R package installation process for using R packages from a SQL Server instance.
2323

2424
## Why R user libraries cannot be accessed from SQL Server
2525

26-
R developers who need to install new R packages are accustomed to installing packages at will, and using a private, user library whenever the default library is not available, or if the developer is not an administrator on the computer.
26+
R developers who need to install new R packages are accustomed to installing packages at will, and using a private, user library whenever the default library is not available, or when the developer is not an administrator on the computer.
2727

2828
For example, in a typical R development environment, the user would add the location of the package to the R environment variable `libPath`, or reference the full package path, like this:
2929

3030
```R
3131
library("c:/Users/<username>/R/win-library/packagename")
3232
```
3333

34-
However, this can never work when running R solutions in SQL Server, because R packages must be installed to a specific default library that is associated with the instance.
34+
However, this can never work when running R solutions in SQL Server, because R packages must be installed to a specific default library that is associated with the instance.
3535

3636
If the package is not installed in the default library, you might get this error when you try to call the package:
3737

38-
*Error in library(xxx) : there is no package called 'xxx'*
38+
*Error in library(xxx) : there is no package called 'package-name'*
3939

4040
It is also a bad development practice to install required R packages to a custom user library, as it can lead to errors if a solution is run by another user who does not have access to the library location.
4141

0 commit comments

Comments
 (0)