Skip to content

Commit bec5783

Browse files
committed
Tweak
1 parent fa37c7c commit bec5783

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

docs/machine-learning/r/r-libraries-and-data-types.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,27 @@ This section lists the implicit conversions that are provided, and lists unsuppo
3333

3434
The following table shows the changes in data types and values when data from [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is used in an R script and then returned to [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
3535

36-
| SQL type | R class | RESULT SET type | Comments |
37-
|----------------------------------|-------------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36+
| SQL type | R class | RESULT SET type | Comments |
37+
|----------------------------------|-------------|--------------------|---------------------|
3838
| **bigint** | `numeric` | **float** | Executing an R script with `sp_execute_external_script` allows bigint data type as input data. However, because they are converted to R's numeric type, it suffers a precision loss with values that are very high or have decimal point values. R only support up to 53-bit integers and then it will start to have precision loss. |
39-
| **binary(n)**<br /> n <= 8000 | `raw` | **varbinary(max)** | Only allowed as input parameter and output |
40-
| **bit** | `logical` | **bit** | |
39+
| **binary(n)**<br /> n <= 8000 | `raw` | **varbinary(max)** | Only allowed as input parameter and output |
40+
| **bit** | `logical` | **bit** | |
4141
| **char(n)**<br /> n <= 8000 | `character` | **varchar(max)** | The input data frame (input_data_1) are created without explicitly setting of *stringsAsFactors* parameter so the column type will depend on the *default.stringsAsFactors()* in R |
42-
| **datetime** | `POSIXct` | **datetime** | Represented as GMT |
43-
| **date** | `POSIXct` | **datetime** | Represented as GMT |
42+
| **datetime** | `POSIXct` | **datetime** | Represented as GMT |
43+
| **date** | `POSIXct` | **datetime** | Represented as GMT |
4444
| **decimal(p,s)** | `numeric` | **float** | Executing an R script with `sp_execute_external_script` allows decimal data type as input data. However, because they are converted to R's numeric type, it suffers a precision loss with values that are very high or have decimal point values. `sp_execute_external_script` with an R script does not support the full range of the data type and would alter the last few decimal digits especially those with fraction. |
45-
| **float** | `numeric` | **float** | |
46-
| **int** | `integer` | **int** | |
45+
| **float** | `numeric` | **float** | |
46+
| **int** | `integer` | **int** | |
4747
| **money** | `numeric` | **float** | Executing an R script with `sp_execute_external_script` allows money data type as input data. However, because they are converted to R's numeric type, it suffers a precision loss with values that are very high or have decimal point values. Sometimes cent values would be imprecise and a warning would be issued: *Warning: unable to precisely represent cents values*. |
4848
| **numeric(p,s)** | `numeric` | **float** | Executing an R script with `sp_execute_external_script` allows numeric data type as input data. However, because they are converted to R's numeric type, it suffers a precision loss with values that are very high or have decimal point values. `sp_execute_external_script` with an R script does not support the full range of the data type and would alter the last few decimal digits especially those with fraction. |
49-
| **real** | `numeric` | **float** | |
50-
| **smalldatetime** | `POSIXct` | **datetime** | Represented as GMT |
51-
| **smallint** | `integer` | **int** | |
52-
| **smallmoney** | `numeric` | **float** | |
53-
| **tinyint** | `integer` | **int** | |
54-
| **uniqueidentifier** | `character` | **varchar(max)** | |
55-
| **varbinary(n)**<br /> n <= 8000 | `raw` | **varbinary(max)** | Only allowed as input parameter and output |
56-
| **varbinary(max)** | `raw` | **varbinary(max)** | Only allowed as input parameter and output |
49+
| **real** | `numeric` | **float** | |
50+
| **smalldatetime** | `POSIXct` | **datetime** | Represented as GMT |
51+
| **smallint** | `integer` | **int** | |
52+
| **smallmoney** | `numeric` | **float** | |
53+
| **tinyint** | `integer` | **int** | |
54+
| **uniqueidentifier** | `character` | **varchar(max)** | |
55+
| **varbinary(n)**<br /> n <= 8000 | `raw` | **varbinary(max)** | Only allowed as input parameter and output |
56+
| **varbinary(max)** | `raw` | **varbinary(max)** | Only allowed as input parameter and output |
5757
| **varchar(n)**<br /> n <= 8000 | `character` | **varchar(max)** | The input data frame (input_data_1) are created without explicitly setting of *stringsAsFactors* parameter so the column type will depend on the *default.stringsAsFactors()* in R |
5858

5959
## Data types not supported by R

0 commit comments

Comments
 (0)