You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Nic Crane (Jira)" <ji...@apache.org> on 2021/09/03 15:04:00 UTC

[jira] [Updated] (ARROW-13891) [R] Docs should be more explicit about why float32 objects report type as "float" and float64 objects report type as "double"

     [ https://issues.apache.org/jira/browse/ARROW-13891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nic Crane updated ARROW-13891:
------------------------------
    Description: 
There is a discrepancy between how fields created via {{float32()}} and {{float64}} report their data types.
{code:java}
tbl <- tibble::tibble(a = c(1:3), b = c(4:6))
Table$create(tbl, schema = schema(a = float32(), b = float64()))
## Table
## 3 rows x 2 columns
## $a <float>
## $b <double>
{code}
Whilst this canonical (see [https://github.com/apache/arrow/pull/10327#discussion_r640240623),] this is confusing, especially as our docs (see {{?float64()}} say:

> "When called inside an arrow function, such as schema() or cast(), double() also is supported as a way of creating a float64()"

We should either rephrase this part of our docs to swap {{double()}} and {{float64()}}, or add another sentence to explain this in more detail.

As well as the function docs, we should also mention it in the vignette {{arrow.Rmd}}

  was:
There is a discrepancy between how fields created via {{float32()}} and {{float64}} report their data types.
{code:java}
tbl <- tibble::tibble(a = c(1:3), b = c(4:6))
Table$create(tbl, schema = schema(a = float32(), b = float64()))
## Table
## 3 rows x 2 columns
## $a <float>
## $b <double>
{code}
Whilst this canonical (see [https://github.com/apache/arrow/pull/10327#discussion_r640240623),] this is confusing, especially as our docs (see \{{?float64()}} say:

> "When called inside an arrow function, such as schema() or cast(), double() also is supported as a way of creating a float64()"

We should either rephrase this part of our docs to swap {{double()}} and {{float64()}}, or add another sentence to explain this in more detail.


> [R] Docs should be more explicit about why float32 objects report type as "float" and float64 objects report type as "double"
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-13891
>                 URL: https://issues.apache.org/jira/browse/ARROW-13891
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Nic Crane
>            Priority: Major
>
> There is a discrepancy between how fields created via {{float32()}} and {{float64}} report their data types.
> {code:java}
> tbl <- tibble::tibble(a = c(1:3), b = c(4:6))
> Table$create(tbl, schema = schema(a = float32(), b = float64()))
> ## Table
> ## 3 rows x 2 columns
> ## $a <float>
> ## $b <double>
> {code}
> Whilst this canonical (see [https://github.com/apache/arrow/pull/10327#discussion_r640240623),] this is confusing, especially as our docs (see {{?float64()}} say:
> > "When called inside an arrow function, such as schema() or cast(), double() also is supported as a way of creating a float64()"
> We should either rephrase this part of our docs to swap {{double()}} and {{float64()}}, or add another sentence to explain this in more detail.
> As well as the function docs, we should also mention it in the vignette {{arrow.Rmd}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)