Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/leeper/webuse

Import Stata 'webuse' Datasets
https://github.com/leeper/webuse

cran data-import dataset r stata stata-datasets

Last synced: 24 days ago
JSON representation

Import Stata 'webuse' Datasets

Awesome Lists containing this project

README

        

# Import Stata 'webuse' Datasets

This package provides a Stata-style `webuse()` function for importing named datasets from Stata's online collection.

## Package Installation

This package can be installed from R using `install.packages("webuse")` or from GitHub using **remotes**:

```R
if(!require("remotes")){
install.packages("remotes")
}
remotes::install_github("leeper/webuse")
```

[![Build Status](https://travis-ci.org/leeper/webuse.svg?branch=master)](https://travis-ci.org/leeper/webuse)
[![CRAN Version](http://www.r-pkg.org/badges/version/webuse)](http://cran.r-project.org/package=webuse)
![Downloads](http://cranlogs.r-pkg.org/badges/webuse)

## Code Examples

```{r, echo=FALSE, results='hide'}
options(width = 100)
```

Functionality is simple. Load **webuse** and then access any online Stata dataset using the `webuse()` function. This will assign the named dataset to the `.GlobalEnv` (or another environment, if specified):

```{r}
library("webuse")
webuse("auto")
head(auto)

webuse("uslifeexp")
head(uslifeexp)
```

The `webuselist` object contains a list of "core" Stata datasets:

```{r}
str(webuselist)
```