An open API service indexing awesome lists of open source software.

https://github.com/moodymudskipper/datasearch

Find Datasets Observing Specific Conditions
https://github.com/moodymudskipper/datasearch

Last synced: 2 days ago
JSON representation

Find Datasets Observing Specific Conditions

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# datasearch

*{datasearch}* is a one function package that can be used to find datasets
observing specific conditions, either in a specific package,
a list of packages, or all installed packages.

## Installation

Install with:

``` r
remotes::install_github("moodymudskipper/datasearch")
```

## Examples

```{r, eval = FALSE}
library(datasearch)

#~~~~~~~~~~~~~ all data sets from package "dplyr" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

dplyr_all <-
datasearch("dplyr")

View(dplyr_all)
```

![dplyr](https://github.com/moodymudskipper/datasearch/raw/master/inst/images/datasearch1.gif)

```{r, eval = FALSE}
#~~~~~~~~~~~~~ datasets from package "datasets" restricted by condition ~~~~~~~~

datasets_ncol5 <-
datasearch("datasets", filter = ~is.data.frame(.) && ncol(.) == 5)

View(datasets_ncol5)
```

![datasets](https://github.com/moodymudskipper/datasearch/raw/master/inst/images/datasearch2.gif)

```{r, eval = FALSE}
#~~~~~~~~~~~~~ all datasets from all installed packages, no restriction ~~~~~~~~

# might take more or less time, depends what you have installed
all_datasets <- datasearch()

View(all_datasets)

# subsetting the output
my_subset <- subset(
all_datasets,
class1 == "data.frame" &
grepl("treatment", names_collapsed) &
nrow < 100
)

View(my_subset)
```

![all](https://github.com/moodymudskipper/datasearch/raw/master/inst/images/datasearch3.gif)