Git Product home page Git Product logo

pa1test's Introduction

PA1-test: testthat

##Unit Tests for Programming Assignment 1


This project is an implementation of testthat unit tests for the Coursera R Programming course Assignment 1. The testthat package was written by Hadley Wickham to enable unit testing of the 'stringr' string manipulation package during development. The unit tests implement the examples given in the Instructions for Programming Assignment 1.

| Function Name | Description | testthat Script

---|--------------------|------------------------------|--------------------------------------------- 1 | pollutantmean | Calculate the mean of a pollutant | test-pollutantmean.r 2 | complete | Report the number of complete cases | test-complete.r 3 | corr | Calculate the correlation between two pollutants | test-corr.r

Running the testthat Scripts

  1. source the script for the assignment into your R working environment.
  • E.g., > source("pollutantmean.R")
  1. source the matching testthat script into your environment.
  • > source("test-pollutantmean.r")
  • >
  1. Notice how unobtrusive testthat is, if there is no error.

You can also run scripts using the test_file function.

> test_file("test-pollutantmean.r")
Calculate the mean of a pollutant across a specified list of monitors : .....

> 

A little more verbose, but still pretty quiet.

More Information

For more information on the testthat package see,


pa1test's People

Contributors

cbryant1000 avatar rivokl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.