You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced-analytics/r/create-a-local-package-repository-using-minicran.md
+30-23Lines changed: 30 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Create a local package repository using miniCRAN | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "09/29/2017"
4
+
ms.date: "01/04/2018"
5
5
ms.reviewer:
6
6
ms.suite: sql
7
7
ms.prod: machine-learning-services
@@ -30,7 +30,12 @@ There are two ways that you can prepare R packages for installation onto a serve
30
30
31
31
-[Manually download and copy packages one by one](#bkmk_manual)
32
32
33
-
This article describes how you can create an R package repository using both methods, and recommends use of the **miniCRAN** package.
33
+
You can find the list of dependent packages in the DESCRIPTION file for the downloaded package.
34
+
35
+
However, packages listed in **Imports** might have second-level dependencies. For this reason, we recommend use of the **miniCRAN** method.
36
+
37
+
> [!TIP]
38
+
> Did you know that you can use miniCRAN to prepare packages for use in Azure Machine Learning? For more information, see this blog: [Using miniCRAN in Azure ML, by Michele Usuelli](https://www.r-bloggers.com/using-minicran-in-azure-ml/)
34
39
35
40
## Prepare packages using miniCRAN
36
41
@@ -48,6 +53,9 @@ There are many advantages to using miniCRAN to create the repository:
48
53
49
54
After creating the repository, you can modify it by adding new packages or upgrading the version of existing packages.
50
55
56
+
> [!NOTE]
57
+
> The miniCRAN package itself is dependent on 18 other CRAN packages, among which is the RCurl package, which has a system dependency on the curl-devel package. Similarly, package XML has a dependency on libxml2-devel. We recommend, therefore, that you build your local repository initially on a machine with full Internet access, so that you can easily satisfy all these dependencies. After created, you can move the repository to a different location.
58
+
51
59
### Step 1. Install the miniCRAN package
52
60
53
61
You begin by creating a miniCRAN repository to use as a source. You should create this repository on a computer that has internet access.
@@ -67,9 +75,11 @@ You begin by creating a miniCRAN repository to use as a source. You should creat
2.Indicatealocalfolderinwhichtostorethecollectedpackages.Youneedn't name the folder miniCRAN; it could be a more descriptive name like "GeneticsPackages" or "ClientRPackages1.0.2".
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
94
+
Donotadddependenciestothisinitiallist; the**igraph**packageusedbyminiCRANgeneratesthelistofdependenciesforyou.Formoreinformationabouthowtousethegenerateddependencygraph, see [UsingminiCRANtoidentifypackage
- Upload packages to a SQL database and install packages on a per-database basis, using the CREATE EXTERNAL LIBRARY statement. See [Install additional R packages on SQL Server](install-additional-r-packages-on-sql-server.md).
Copy file name to clipboardExpand all lines: docs/advanced-analytics/r/determine-which-packages-are-installed-on-sql-server.md
+24-16Lines changed: 24 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Determine which R packages are installed on SQL Server | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "10/09/2016"
4
+
ms.date: "01/04/2018"
5
5
ms.reviewer:
6
6
ms.suite: sql
7
7
ms.prod: machine-learning-services
@@ -20,7 +20,7 @@ ms.workload: "Inactive"
20
20
---
21
21
# Determine which R packages are installed on SQL Server
22
22
23
-
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.
23
+
When you install machine learning in SQL Server with the R language option, an R package library is created and associated with the instance. Each instance has its own package library. Package libraries cannot be shared across instances.
24
24
25
25
This article describes how you can determine which R packages are installed for a specific instance.
26
26
@@ -30,37 +30,35 @@ The following example uses the R function `installed.packages()` in a [!INCLUDE[
30
30
31
31
```SQL
32
32
EXECUTE sp_execute_external_script
33
-
@language=N'R'
34
-
,@script = N'str(OutputDataSet);
35
-
packagematrix <- installed.packages();
36
-
NameOnly <- packagematrix[,1];
37
-
OutputDataSet <- as.data.frame(NameOnly);'
38
-
,@input_data_1 = N'SELECT 1 as col'
39
-
WITH RESULT SETS ((PackageName nvarchar(250) ))
33
+
@language=N'R'
34
+
,@script = N'str(OutputDataSet);
35
+
packagematrix <- installed.packages();
36
+
NameOnly <- packagematrix[,1];
37
+
OutputDataSet <- as.data.frame(NameOnly);'
38
+
,@input_data_1 = N''
39
+
WITH RESULT SETS ((PackageName nvarchar(250) ))
40
40
```
41
41
42
-
For more information about the optional and default fields for the R package DESCRIPTION file, see
42
+
For more information about the optional and default fields for the R package DESCRIPTION field, see
## Verify whether a package is installed with an instance
46
46
47
-
If you have installed a package and want to make sure that it is available to a particular SQL Server instance, you can execute the following stored procedure call to load the package and return only messages.
47
+
If you have installed a package and want to make sure that it is available to a particular SQL Server instance, you can execute the following stored procedure call to load the package and return only messages. This example looks for and loads the RevoScaleR library, if available.
48
48
49
49
```SQL
50
50
EXEC sp_execute_external_script @language =N'R',
51
51
@script=N'library("RevoScaleR")'
52
52
GO
53
53
```
54
54
55
-
This example looks for and loads the RevoScaleR library.
55
+
+ If the package is found, a message is returned: "Commands completed successfully."
56
56
57
-
+ If the package is found, the message returned should be something like "Commands completed successfully."
58
-
59
-
+ 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"
57
+
+ If the package cannot be located or loaded, you get an error containing the text: "there is no package called 'MissingPackageName'"
60
58
61
59
## Get a list of installed packages using R
62
60
63
-
There are multiple ways to get a list of installed or loaded packages using R tools and R functions. Many R development tools provide an object browser or a list of packages that are installed or that are loaded in the current R workspace.
61
+
There are multiple ways to get a list of installed or loaded packages using R tools and R functions. Many R development tools provide an object browser or a list of packages that are installed or that are loaded in the current R workspace. This section provides some short commands that you can use from any R command line or in sp\_execute\_external\_script.
64
62
65
63
+ From a local R utility, use a base R function, such as `installed.packages()`, which is included in the `utils` package. To get a list that is accurate for an instance, you must either specify the library path explicitly, or use the R tools associated with the instance library.
0 commit comments