Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petulla/readroper
Read single and multi-card ASCII polling datasets in R
https://github.com/petulla/readroper
ascii data-analysis polling-data r
Last synced: 13 days ago
JSON representation
Read single and multi-card ASCII polling datasets in R
- Host: GitHub
- URL: https://github.com/petulla/readroper
- Owner: petulla
- License: other
- Created: 2018-02-27T02:47:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-14T23:55:21.000Z (over 4 years ago)
- Last Synced: 2024-10-04T10:58:14.732Z (about 1 month ago)
- Topics: ascii, data-analysis, polling-data, r
- Language: R
- Homepage:
- Size: 33.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# readroper
[![Build Status](https://travis-ci.org/petulla/readroper.svg?branch=master)](https://travis-ci.org/petulla/readroper)Use this package to read ASCII fixed-width data files from the Roper Center and other polling providers into R.
## Installation
You can install the released version of readroper from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("readroper")
```The development version from [GitHub](https://github.com/) is installed with:
``` r
# install.packages("devtools")
devtools::install_github("petulla/readroper")
```
## UsageTo read three questions from a multicard ASCII polling file and weights and output a csv file, you'll want something like:
```r
weights df <- read_rpr(col_positions=c(1),
widths=c(3),
col_names=c('Weights'),
filepath='data.txt')
card2 <- read_rpr(col_positions=c(1,2,4),
widths=c(1,2,1),
col_names=c('Q1','Q2','Q3'),
filepath='data.txt',
card_read=1,
cards=2)
GALLUP <- cbind(weights,card2)
GALLUP$Weights = as.numeric(GALLUP$Weights)/100
write.csv(GALLUP,file='cnngallup.csv', row.names=FALSE)
```For instructions on use see the [vignette](https://github.com/petulla/readroper/tree/master/vignettes).