Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Oct 8, 2024
1 parent 3ab6611 commit cb18635
Show file tree
Hide file tree
Showing 4 changed files with 2,328 additions and 8 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(global_search)
export(universe_ls)
export(universe_package)
export(universe_packages)
Expand Down
7 changes: 3 additions & 4 deletions R/universe.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' All packages in an universe
#'
#' @param universe Name of the universe (character of length 1)
#' @inheritParams universe_search
#'
#' @return A character vector of all packages in the universe.
#' @export
Expand All @@ -25,8 +25,7 @@ universe_ls <- function(universe) {

#' Info on all packages in an universe
#'
#' @param universe Name of the universe (character of length 1)
#' @param limit Number of results to return (integer of length 1)
#' @inheritParams universe_search
#'
#' @return A list with information on all packages in the universe.
#' @export
Expand All @@ -51,7 +50,7 @@ universe_packages <- function(universe, limit = 100) {

#' Info on a single packages in an universe
#'
#' @param universe Name of the universe (character of length 1)
#' @inheritParams universe_search
#' @param package Name of the package (character of length 1)
#'
#' @return A list with information on the package.
Expand Down
27 changes: 25 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,35 @@ You can install the development version of starchart from [GitHub](https://githu
pak::pak("ropenscilabs/starchart")
```

## Example
## Examples

This is a basic example which shows you how to solve a common problem:
### All packages in an universe

```{r example}
library(starchart)
universe_ls("jeroen")
```

### Info on all packages in an universe

```{r}
universe_packages("jeroen", limit = 1)
```

### Info on a single package in an universe

```{r}
universe_package("jeroen", package = "curl")
```

### Search within a single universe

```{r}
universe_search("ropensci", query = 'needs:httr2', limit = 1)
```

### Search among all universes

```{r}
global_search(query = '"weather data"', limit = 1)
```
Loading

0 comments on commit cb18635

Please sign in to comment.