ianmcook commented on a change in pull request #1:
URL: https://github.com/apache/arrow-cookbook/pull/1#discussion_r674966598



##########
File path: r/content/creating_arrow_objects.Rmd
##########
@@ -0,0 +1,86 @@
+# Creating Arrow Objects
+
+## Build an Arrow Table from native language types
+
+### Manually create a table from an R object
+
+You may want to convert an existing data frame in R to an Arrow Table object.
+
+```{r, table_create}
+# Create an example data frame
+my_tibble <- tibble::tibble(group = c("A", "B", "C"), score = c(99, 97, 99))
+# Convert to Arrow Table
+my_table <- Table$create(my_tibble)
+# View table
+my_table
+```
+```{r, test_table_create, opts.label = "test"}
+test_that("table_create works as expected", {
+  expect_s3_class(my_table, "Table")
+  expect_identical(dplyr::collect(my_table), my_tibble)
+})
+```
+#### View the contents of an Arrow Table
+
+You can view the contents of an Arrow table using `dplyr::collect()`
+
+```{r, table_collect}
+# View Table
+dplyr::collect(my_table)
+```
+```{r, test_table_collect, opts.label = "test"}
+test_that("table_collect works as expected", {
+  expect_identical(dplyr::collect(my_table), my_tibble)
+})
+```
+
+### Manually create a RecordBatch
+
+You may want to convert an existing data frame in R to an Arrow Record Batch 
object.

Review comment:
       ```suggestion
   You may want to convert an existing data frame in R to an Arrow RecordBatch 
object.
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to