You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by np...@apache.org on 2021/08/18 12:38:49 UTC

[arrow-cookbook] 01/01: [R] Remove unnecessary head()s

This is an automated email from the ASF dual-hosted git repository.

npr pushed a commit to branch nealrichardson-patch-2
in repository https://gitbox.apache.org/repos/asf/arrow-cookbook.git

commit dc21112001e2fda3a519953ce31e6d5fedb611d2
Author: Neal Richardson <ne...@gmail.com>
AuthorDate: Wed Aug 18 08:38:45 2021 -0400

    [R] Remove unnecessary head()s
---
 r/content/reading_and_writing_data.Rmd | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/r/content/reading_and_writing_data.Rmd b/r/content/reading_and_writing_data.Rmd
index 89d25c7..abbc21a 100644
--- a/r/content/reading_and_writing_data.Rmd
+++ b/r/content/reading_and_writing_data.Rmd
@@ -60,11 +60,11 @@ Given a Parquet file, it can be read back in by using `arrow::read_parquet()`.
 
 ```{r, read_parquet}
 parquet_tbl <- read_parquet("my_table.parquet")
-head(parquet_tbl)
+parquet_tbl
 ```
 ```{r, test_read_parquet, opts.label = "test"}
 test_that("read_parquet works as expected", {
-  expect_equivalent(dplyr::collect(parquet_tbl), tibble::tibble(group = c("A", "B", "C"), score = c(99, 97, 99)))
+  expect_identical(as.data.frame(parquet_tbl), tibble::tibble(group = c("A", "B", "C"), score = c(99, 97, 99)))
 })
 ```
 
@@ -82,7 +82,7 @@ If you set `as_data_frame` to `FALSE`, the file will be read in as an Arrow Tabl
 
 ```{r, read_parquet_table}
 my_table_arrow_table <- read_parquet("my_table.parquet", as_data_frame = FALSE)
-head(my_table_arrow_table)
+my_table_arrow_table
 ```
 
 ```{r, read_parquet_table_class}
@@ -115,7 +115,7 @@ write_parquet(dist_time, "dist_time.parquet")
 
 # Read in only the "time" column
 time_only <- read_parquet("dist_time.parquet", col_select = "time")
-head(time_only)
+time_only
 ```
 ```{r, test_read_parquet_filter, opts.label = "test"}
 test_that("read_parquet_filter works as expected", {