Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* `resources()` is soft-deprecated, please use `resource_names()` instead (#282).
* `get_schema()` is soft-deprecated, please use `schema()` instead (#282).
* `read_resource()` now supports reading from remote zip files, thanks to support in {vroom} (1.3.0) (#291).
* frictionless now relies on R >= 4.1.0 (because of an indirect {vroom} dependency) (#291).
* frictionless now relies on R >= 4.1.0 (because of an indirect {vroom} dependency) (#291) and uses base pipes (`|>` rather than `%>%`) (#292).

# frictionless 1.2.1

Expand Down
5 changes: 2 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ knitr::opts_chunk$set(
fig.path = "man/figures/README-",
out.width = "100%"
)
library(dplyr) # For %>%
```

# frictionless
Expand Down Expand Up @@ -82,13 +81,13 @@ You can also create your own Data Package, add data and **write** it to disk:
```{r write_example}
# Create a Data Package and add the "iris" data frame as a resource
my_package <-
create_package() %>%
create_package() |>
add_resource(resource_name = "iris", data = iris)

my_package

# Write the Data Package to disk
my_package %>%
my_package |>
write_package("my_directory")
```

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ disk:
``` r
# Create a Data Package and add the "iris" data frame as a resource
my_package <-
create_package() %>%
create_package() |>
add_resource(resource_name = "iris", data = iris)

my_package
Expand All @@ -128,7 +128,7 @@ my_package
#> Use `unclass()` to print the Data Package as a list.

# Write the Data Package to disk
my_package %>%
my_package |>
write_package("my_directory")
```

Expand Down
6 changes: 3 additions & 3 deletions vignettes/data-package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ Most functions have `package` as their first argument and return package. This a
```{r, message = FALSE}
library(dplyr) # Or library(magrittr)
my_package <-
create_package() %>%
add_resource(resource_name = "iris", data = iris) %>%
append(c("title" = "my_package"), after = 0) %>%
create_package() |>
add_resource(resource_name = "iris", data = iris) |>
append(c("title" = "my_package"), after = 0) |>
create_package() # To add the datapackage class again
my_package
```
Expand Down
16 changes: 7 additions & 9 deletions vignettes/frictionless.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,13 @@ Create a Data Package with `create_package()` and add your data frame as a resou


``` r
# Load dplyr or magrittr to support %>% pipes
library(dplyr, warn.conflicts = FALSE) # or library(magrittr)

my_package <-
create_package() %>%
create_package() |>
add_resource(resource_name = "iris", data = iris)
```

::: {.callout-info}
You can chain most frictionless functions together using pipes (`%>%` or `|>`), which improves readability.
You can chain most frictionless functions together using pipes (`|>`), which improves readability.
:::

`my_package` now contains one resource:
Expand All @@ -192,7 +189,7 @@ By default, `add_resource()` will create a **Table Schema** for your data frame,

``` r
iris_schema <-
my_package %>%
my_package |>
schema("iris")

str(iris_schema)
Expand Down Expand Up @@ -310,7 +307,7 @@ Let's add `iris` as a resource to your Data Package again, but this time with th

``` r
my_package <-
my_package %>%
my_package |>
add_resource(
resource_name = "iris",
data = iris,
Expand All @@ -331,7 +328,7 @@ path_2 <- system.file("extdata", "v1", "observations_2.tsv", package = "friction

# Add both TSV files as a single resource
my_package <-
my_package %>%
my_package |>
add_resource(
resource_name = "observations",
data = c(path_1, path_2),
Expand Down Expand Up @@ -369,7 +366,8 @@ The directory will contain four files: the descriptor `datapackage.json`, one CS

``` r
list.files("my_directory")
#> [1] "datapackage.json" "iris.csv" "observations_1.tsv" "observations_2.tsv"
#> [1] "datapackage.json" "iris.csv" "observations_1.tsv"
#> [4] "observations_2.tsv"
```


Expand Down
13 changes: 5 additions & 8 deletions vignettes/frictionless.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,13 @@ dplyr::as_tibble(iris)
Create a Data Package with `create_package()` and add your data frame as a resource with the name `iris`:

```{r}
# Load dplyr or magrittr to support %>% pipes
library(dplyr, warn.conflicts = FALSE) # or library(magrittr)

my_package <-
create_package() %>%
create_package() |>
add_resource(resource_name = "iris", data = iris)
```

::: {.callout-info}
You can chain most frictionless functions together using pipes (`%>%` or `|>`), which improves readability.
You can chain most frictionless functions together using pipes (`|>`), which improves readability.
:::

`my_package` now contains one resource:
Expand All @@ -110,7 +107,7 @@ By default, `add_resource()` will create a **Table Schema** for your data frame,

```{r}
iris_schema <-
my_package %>%
my_package |>
schema("iris")

str(iris_schema)
Expand Down Expand Up @@ -158,7 +155,7 @@ Let's add `iris` as a resource to your Data Package again, but this time with th

```{r}
my_package <-
my_package %>%
my_package |>
add_resource(
resource_name = "iris",
data = iris,
Expand All @@ -178,7 +175,7 @@ path_2 <- system.file("extdata", "v1", "observations_2.tsv", package = "friction

# Add both TSV files as a single resource
my_package <-
my_package %>%
my_package |>
add_resource(
resource_name = "observations",
data = c(path_1, path_2),
Expand Down