hrbrmstr
9 years ago
13 changed files with 207 additions and 4 deletions
@ -1,2 +1,7 @@ |
|||||
^.*\.Rproj$ |
^.*\.Rproj$ |
||||
^\.Rproj\.user$ |
^\.Rproj\.user$ |
||||
|
^README\.Rmd$ |
||||
|
^README-.*\.png$ |
||||
|
^\.travis\.yml$ |
||||
|
^CONDUCT\.md$ |
||||
|
^README\.md$ |
||||
|
@ -0,0 +1,5 @@ |
|||||
|
# Sample .travis.yml for R projects |
||||
|
|
||||
|
language: r |
||||
|
warnings_are_errors: true |
||||
|
sudo: required |
@ -0,0 +1,25 @@ |
|||||
|
# Contributor Code of Conduct |
||||
|
|
||||
|
As contributors and maintainers of this project, we pledge to respect all people who |
||||
|
contribute through reporting issues, posting feature requests, updating documentation, |
||||
|
submitting pull requests or patches, and other activities. |
||||
|
|
||||
|
We are committed to making participation in this project a harassment-free experience for |
||||
|
everyone, regardless of level of experience, gender, gender identity and expression, |
||||
|
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. |
||||
|
|
||||
|
Examples of unacceptable behavior by participants include the use of sexual language or |
||||
|
imagery, derogatory comments or personal attacks, trolling, public or private harassment, |
||||
|
insults, or other unprofessional conduct. |
||||
|
|
||||
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, |
||||
|
commits, code, wiki edits, issues, and other contributions that are not aligned to this |
||||
|
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed |
||||
|
from the project team. |
||||
|
|
||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by |
||||
|
opening an issue or contacting one or more of the project maintainers. |
||||
|
|
||||
|
This Code of Conduct is adapted from the Contributor Covenant |
||||
|
(http:contributor-covenant.org), version 1.0.0, available at |
||||
|
http://contributor-covenant.org/version/1/0/0/ |
@ -1,8 +1,12 @@ |
|||||
Package: berate |
Package: berate |
||||
Title: What the Package Does (one line, title case) |
Title: Provide Insightful Motivation During Interactive Sessions |
||||
Version: 0.0.0.9000 |
Version: 0.0.0.9000 |
||||
Authors@R: c(person("Bob", "Rudis", email = "bob@rudis.net", role = c("aut", "cre"))) |
Authors@R: c(person("Bob", "Rudis", email = "bob@rudis.net", role = c("aut", "cre"))) |
||||
Description: What the package does (one paragraph). |
Description: We've all been there. We do our best to crank out an analysis but those |
||||
Depends: R (>= 3.2.2) |
pesky errors still remain. Why not add some helpful motivational information to |
||||
|
encourage you to be a bit more careful about what you type. |
||||
|
Depends: R (>= 3.0.0) |
||||
License: AGPL + file LICENSE |
License: AGPL + file LICENSE |
||||
LazyData: true |
LazyData: true |
||||
|
Suggests: testthat |
||||
|
Imports: xml2, rvest |
||||
|
@ -1 +1,5 @@ |
|||||
exportPattern("^[^\\.]") |
# Generated by roxygen2 (4.1.1): do not edit by hand |
||||
|
|
||||
|
importFrom(rvest,html_nodes) |
||||
|
importFrom(rvest,html_text) |
||||
|
importFrom(xml2,read_html) |
||||
|
@ -0,0 +1,8 @@ |
|||||
|
#' Provide Insightful Motivation During Interactive Sessions |
||||
|
#' |
||||
|
#' @name berate |
||||
|
#' @docType package |
||||
|
#' @author Bob Rudis (@@hrbrmstr) |
||||
|
#' @importFrom xml2 read_html |
||||
|
#' @importFrom rvest html_nodes html_text |
||||
|
NULL |
@ -0,0 +1,17 @@ |
|||||
|
berate <- function(err) { |
||||
|
|
||||
|
if (stats::runif(1) < 0.1) { return(invisible()) } |
||||
|
|
||||
|
msg <- tryCatch(html_text(html_nodes(read_html("http://www.programmerinsults.com/"), "h1")), |
||||
|
error=function(err) { return("\\_(o_O)_/") }) |
||||
|
cat(msg) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.onAttach <- function(libname, pkgname) { |
||||
|
options(error=berate) |
||||
|
} |
||||
|
|
||||
|
.onLoad <- function(libname, pkgname) { |
||||
|
options(error=berate) |
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
--- |
||||
|
output: |
||||
|
md_document: |
||||
|
variant: markdown_github |
||||
|
--- |
||||
|
|
||||
|
<!-- README.md is generated from README.Rmd. Please edit that file --> |
||||
|
|
||||
|
```{r, echo = FALSE} |
||||
|
knitr::opts_chunk$set( |
||||
|
collapse = TRUE, |
||||
|
comment = "#>", |
||||
|
fig.path = "README-" |
||||
|
) |
||||
|
``` |
||||
|
|
||||
|
berate : Provide Insightful Motivation During Interactive Sessions |
||||
|
|
||||
|
No user exposed functions. Just add `library(berate)` to your `.Rprofile` or any interactive session to receive "helpful" motivations to code or type better. |
||||
|
|
||||
|
### News |
||||
|
|
||||
|
- Version 0.0.0.9999 released |
||||
|
|
||||
|
### Installation |
||||
|
|
||||
|
```{r eval=FALSE} |
||||
|
devtools::install_github("hrbrmstr/berate") |
||||
|
``` |
||||
|
|
||||
|
```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE} |
||||
|
options(width=120) |
||||
|
``` |
||||
|
|
||||
|
### Usage |
||||
|
|
||||
|
```{r} |
||||
|
library(berate) |
||||
|
|
||||
|
# current verison |
||||
|
packageVersion("berate") |
||||
|
|
||||
|
``` |
||||
|
|
||||
|
### Test Results |
||||
|
|
||||
|
```{r} |
||||
|
library(berate) |
||||
|
library(testthat) |
||||
|
|
||||
|
date() |
||||
|
|
||||
|
test_dir("tests/") |
||||
|
``` |
||||
|
|
||||
|
### Code of Conduct |
||||
|
|
||||
|
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). |
||||
|
By participating in this project you agree to abide by its terms. |
@ -0,0 +1,42 @@ |
|||||
|
<!-- README.md is generated from README.Rmd. Please edit that file --> |
||||
|
berate : Provide Insightful Motivation During Interactive Sessions |
||||
|
|
||||
|
No user exposed functions. Just add `library(berate)` to your `.Rprofile` or any interactive session to receive "helpful" motivations to code or type better. |
||||
|
|
||||
|
### News |
||||
|
|
||||
|
- Version 0.0.0.9999 released |
||||
|
|
||||
|
### Installation |
||||
|
|
||||
|
``` r |
||||
|
devtools::install_github("hrbrmstr/berate") |
||||
|
``` |
||||
|
|
||||
|
### Usage |
||||
|
|
||||
|
``` r |
||||
|
library(berate) |
||||
|
|
||||
|
# current verison |
||||
|
packageVersion("berate") |
||||
|
#> [1] '0.0.0.9000' |
||||
|
``` |
||||
|
|
||||
|
### Test Results |
||||
|
|
||||
|
``` r |
||||
|
library(berate) |
||||
|
library(testthat) |
||||
|
|
||||
|
date() |
||||
|
#> [1] "Thu Oct 29 09:19:13 2015" |
||||
|
|
||||
|
test_dir("tests/") |
||||
|
#> testthat results ======================================================================================================== |
||||
|
#> OK: 0 SKIPPED: 0 FAILED: 0 |
||||
|
``` |
||||
|
|
||||
|
### Code of Conduct |
||||
|
|
||||
|
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. |
@ -0,0 +1,14 @@ |
|||||
|
% Generated by roxygen2 (4.1.1): do not edit by hand |
||||
|
% Please edit documentation in R/berate-package.r |
||||
|
\docType{package} |
||||
|
\name{berate} |
||||
|
\alias{berate} |
||||
|
\alias{berate-package} |
||||
|
\title{Provide Insightful Motivation During Interactive Sessions} |
||||
|
\description{ |
||||
|
Provide Insightful Motivation During Interactive Sessions |
||||
|
} |
||||
|
\author{ |
||||
|
Bob Rudis (@hrbrmstr) |
||||
|
} |
||||
|
|
@ -0,0 +1,4 @@ |
|||||
|
library(testthat) |
||||
|
library(berate) |
||||
|
|
||||
|
test_check("berate") |
@ -0,0 +1,6 @@ |
|||||
|
context("basic functionality") |
||||
|
test_that("we can do something", { |
||||
|
|
||||
|
#expect_that(some_function(), is_a("data.frame")) |
||||
|
|
||||
|
}) |
Loading…
Reference in new issue