Skip to content

Commit

Permalink
update path
Browse files Browse the repository at this point in the history
  • Loading branch information
sannegovaert committed Aug 27, 2024
1 parent 85e97f4 commit f8b3168
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vignettes/data-package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Frictionless supports reading, manipulating and writing packages. Much of its fu

```{r}
library(frictionless)
file <- system.file("extdata", "datapackage.json", package = "frictionless")
file <- system.file("extdata", "v1", "datapackage.json", package = "frictionless")
package <- read_package(file)
```

Expand Down
10 changes: 5 additions & 5 deletions vignettes/data-resource.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ remove_resource(package, "deployments")
add_resource(package, "iris", data = iris)
# Replace a resource with one where data is stored in a tabular file
path <- system.file("extdata", "deployments.csv", package = "frictionless")
path <- system.file("extdata", "v1", "deployments.csv", package = "frictionless")
add_resource(package, "deployments", data = path, replace = TRUE)
```

Expand Down Expand Up @@ -105,7 +105,7 @@ read_resource(package, "observations")
`add_resource()` sets `path` to the path(s) provided in `data`:

```{r}
path <- system.file("extdata", "deployments.csv", package = "frictionless")
path <- system.file("extdata", "v1", "deployments.csv", package = "frictionless")
add_resource(package, "deployments", data = path, replace = TRUE)
```

Expand Down Expand Up @@ -176,7 +176,7 @@ delim | format
any other value | `"csv"`

```{r}
path <- system.file("extdata", "observations_1.tsv", package = "frictionless")
path <- system.file("extdata", "v1", "observations_1.tsv", package = "frictionless")
package <- add_resource(package, "observations", data = path, delim = "\t", replace = TRUE)
package$resources[[2]]$format
```
Expand All @@ -194,7 +194,7 @@ delim | mediatype
any other value | `"text/csv"`

```{r}
path <- system.file("extdata", "observations_1.tsv", package = "frictionless")
path <- system.file("extdata", "v1", "observations_1.tsv", package = "frictionless")
package <- add_resource(package, "observations", data = path, delim = "\t", replace = TRUE)
package$resources[[2]]$mediatype
```
Expand All @@ -208,7 +208,7 @@ package$resources[[2]]$mediatype
`add_resource()` guesses the `encoding` (using `readr::guess_encoding()`) when data are provided as file. It leaves the `encoding` undefined when data are provided as a data frame. `write_package()` sets it to `"utf-8"` when writing to disk.

```{r}
path <- system.file("extdata", "deployments.csv", package = "frictionless")
path <- system.file("extdata", "v1", "deployments.csv", package = "frictionless")
package <- add_resource(package, "deployments", data = path, delim = ",", replace = TRUE)
package$resources[[2]]$encoding
```
Expand Down
2 changes: 1 addition & 1 deletion vignettes/table-dialect.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Frictionless does not support direct manipulation of the dialect. `add_resource(
library(frictionless)
package <- example_package()
path <- system.file("extdata", "observations_1.tsv", package = "frictionless")
path <- system.file("extdata", "v1", "observations_1.tsv", package = "frictionless")
package <- add_resource(package, "observations", data = path, delim = "\t", replace = TRUE)
package$resources[[2]]$dialect$delimiter
```
Expand Down

0 comments on commit f8b3168

Please sign in to comment.