Coder Social home page Coder Social logo

explainr's Introduction

explainr

What is explainr?

explainr translates S3 objects into text using standard templates in a simple and convenient way.

For help with the explainr R-package, there is a vignette available in the /vignettes folder.

Installation

The package can be installed with

devtools::install_github("hilaryparker/explainr")

After installation, the package can be loaded into R.

library(explainr)

Using explainr

The main function in the explainr package is explain().

ptest <- prop.test(x = 500, n = 1008)
explain(ptest)

Bug reports

Report bugs as issues on the GitHub repository

Contributors

Inspiration

This project draws inspiration from the CausalImpact package.

explainr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

explainr's Issues

Readme should have output of explain

You give an example, bit don't show what the output is. If you had a readme.Rmd, and then knit to readme.md, you could show what the output looks like, which might motivate more people to try it out when they see what it actually does.

Install from .zip doesn't include dependency on knitr

I did

devtools::install(pkg="./explainr-master")

where the explainr-master folder was extracted from the github zip file download. It installed 11 packages (assertthat, broom, DBI, dplyr, lazyeval, mnormt, plyr, psych, reshape2, tidyr, yaml). But running

ptest <- prop.test(x = 500, n = 1008)
library(explainr)
explain(ptest)

yields an error

Error in loadNamespace(name) : there is no package called ‘knitr’

Manually installing knitr -- install.packages("knitr") -- fixes this, but I thought you might like to know.

error with ptest

missing import: evaluate

explain(ptest)

Quitting from lines 3-8 ()
Error in loadNamespace(name) : there is no package called 'evaluate'

cryptic error in `prop.test` explainer with 3 or more proportions

I tried adding a check for it in the code, but I don't think I understand the big picture well enough to capture the error effectively.

> prop.test(c(11, 10, 4), c(12, 12, 12)) %>% explain()
Quitting from lines 124-128 () 
## Error in if (x$p.value < 1 - attr(x$conf.int, "conf")) {: argument is of length zero
## Warning: NAs introduced by coercion
## Error in if (x$p.value < 1 - attr(x$conf.int, "conf")) "reject" else "do not reject": argument is of length zero
Warning message:
In prop.test(c(11, 10, 4), c(12, 12, 12)) :
  Chi-squared approximation may be incorrect

"imports" not imported in RMarkdown?

I get errors when I try to knit the following RMarkdown snippet:

library(explainr)
lm(dist ~ speed, data = cars) %>% explain(theme = "visual")

Specifically, it complains that it can't find %>%. Even if I add a line with library(dplyr), it still complains that I don't have tidy (from the broom package).

I think that what's going on is that code in the inst folder isn't receiving information from imports in the DESCRIPTION. One solution is to just add library(broom) to the script for explain.lm, but there might be better options.

"knitr" dependency

Hi,

Great package. Just tried the ptest() example and I got the following error:

Error in loadNamespace(name) : there is no package called ‘knitr’

Of course, installing "knitr" fixed this, but I figured it would be best to add it to the package dependencies that are loaded when you install explainr().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.