Skip to content

Commit d421b54

Browse files
Use native pipe in R integration tests
1 parent f91593d commit d421b54

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
library(pins)
2-
args <- commandArgs(trailingOnly=TRUE)
2+
args <- commandArgs(trailingOnly = TRUE)
33

44
board <- board_folder(args[1])
5-
board %>% pin_write(mtcars, "mtcars", type="csv")
5+
board |> pin_write(mtcars, "mtcars", type = "csv")
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
library(pins)
22

3-
args <- commandArgs(trailingOnly=TRUE)
3+
args <- commandArgs(trailingOnly = TRUE)
44

55

66
# create board ----
@@ -13,13 +13,13 @@ board_r <- board_folder(args[2])
1313

1414
cat("Checking mtcars pin\n")
1515

16-
res_mtcars <- board_py %>% pin_read("mtcars")
17-
stopifnot(all.equal(res_mtcars, datasets::mtcars, check.attributes=FALSE))
16+
res_mtcars <- board_py |> pin_read("mtcars")
17+
stopifnot(all.equal(res_mtcars, datasets::mtcars, check.attributes = FALSE))
1818

19-
meta_mtcars_py <- board_py %>% pin_meta("mtcars")
19+
meta_mtcars_py <- board_py |> pin_meta("mtcars")
2020
cat("\nPython meta:\n\n")
2121
print(meta_mtcars_py)
2222

23-
meta_mtcars_r <- board_r %>% pin_meta("mtcars")
23+
meta_mtcars_r <- board_r |> pin_meta("mtcars")
2424
cat("\nR meta:\n\n")
2525
print(meta_mtcars_r)

script/stage_r_pins.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ library(pins)
33
df <- data.frame(x = 1:2, y = c("a", "b"))
44
df_v2 <- data.frame(x = 1:2, y = c("a", "b"), z = 3:4)
55

6-
#board <- board_s3("ci-pins", prefix = "r-pins-test")
7-
board <- board_folder("pins/tests/pins-compat", versioned=TRUE)
6+
# board <- board_s3("ci-pins", prefix = "r-pins-test")
7+
board <- board_folder("pins/tests/pins-compat", versioned = TRUE)
88

9-
all_pins <- board %>% pin_list()
10-
board %>% pin_delete(all_pins)
9+
all_pins <- board |> pin_list()
10+
board |> pin_delete(all_pins)
1111

1212
# write two versions of df as CSV ----
13-
board %>% pin_write(df, "df_csv", type="csv")
13+
board |> pin_write(df, "df_csv", type = "csv")
1414
Sys.sleep(2)
15-
board %>% pin_write(df_v2, "df_csv", type="csv")
15+
board |> pin_write(df_v2, "df_csv", type = "csv")
1616

1717
# write two versions of df as arrow ----
18-
board %>% pin_write(df, "df_arrow", type="arrow")
18+
board |> pin_write(df, "df_arrow", type = "arrow")
1919

2020
# write two versions of df as RDS ----
21-
board %>% pin_write(df, "df_rds", type="rds")
21+
board |> pin_write(df, "df_rds", type = "rds")
2222

2323
# write unversioned pin as CSV
24-
board %>% pin_write(df, "df_unversioned", versioned=FALSE)
24+
board |> pin_write(df, "df_unversioned", versioned = FALSE)

0 commit comments

Comments
 (0)