Skip to content

Commit

Permalink
Fix embarassing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
statwonk committed Sep 20, 2015
1 parent d01d97a commit a4f9ac8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions R/opennhtsa.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ NULL
#' model_year("2010") %>%
#' vehicle_make("ford") %>%
#' vehicle_model("f-150") %>%
#' nhsta_fetch()
#' nhtsa_fetch()
#' }
#'
#' @aliases chain_query
Expand All @@ -33,7 +33,7 @@ NULL

api_url <- function() { "http://www.nhtsa.gov/webapi/api" }

#' @title Choose the NHSTA facility
#' @title Choose the NHTSA facility
#'
#' @return data.frame
#' @export
Expand Down Expand Up @@ -82,7 +82,7 @@ response_format <- function(q, type = "json") {
#'
#' @return data.frame
#' @export
nhsta_fetch <- function(url, debug=FALSE) {
nhtsa_fetch <- function(url, debug=FALSE) {
# This function is verbatim copied from:
# https://github.com/rOpenHealth/openfda/blob/master/R/openfda.R

Expand All @@ -94,7 +94,7 @@ nhsta_fetch <- function(url, debug=FALSE) {
# The API servers return 404 for empty search results, so
# distinguish that case from 'real' errors.
if (result$status_code == 404) {
warning('Received 404 response from NHSTA servers.\n',
warning('Received 404 response from NHTSA servers.\n',
'Interpreting as an empty result set.')
return(data.frame(results=c()));
}
Expand All @@ -104,9 +104,9 @@ nhsta_fetch <- function(url, debug=FALSE) {
fromJSON(httr::content(result, as='text'))$Results
}

#' openNHSTA: A package for interfacing with the U.S. Department of Transportation's National Highway Traffic Safety Administration API
#' openNHTSA: A package for interfacing with the U.S. Department of Transportation's National Highway Traffic Safety Administration API
#'
#' This package provides a simple wrapper around the NHSTA API (http://www.nhtsa.gov/webapi/Default.aspx?Recalls/API/83).
#' This package provides a simple wrapper around the NHTSA API (http://www.nhtsa.gov/webapi/Default.aspx?Recalls/API/83).
#' Credit for the design and architecture of the wrapper should go to the authors of the openfda wrapper housed here: https://github.com/rOpenHealth/openfda/
#' Many parts of this wrapper are direct copies of their work and hence this package is released under license GPL v2.
#'
Expand All @@ -120,15 +120,15 @@ nhsta_fetch <- function(url, debug=FALSE) {
#' model_year("2010") %>%
#' vehicle_make("ford") %>%
#' vehicle_model("fusion") %>%
#' nhsta_fetch()
#' nhtsa_fetch()
#'
#' facility("complaints") %>%
#' model_year("2010") %>%
#' vehicle_make("ford") %>%
#' vehicle_model("fusion") %>%
#' nhsta_fetch()
#' nhtsa_fetch()
#' }
#'
#' @docType package
#' @name openNHSTA
#' @name openNHTSA
NULL
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Once devtools is installed, you can grab this package:

```R
library("devtools")
devtools::install_github("statwonk/openNHSTA")
devtools::install_github("statwonk/openNHTSA")
```

Load it in like any other package:
Expand All @@ -36,15 +36,15 @@ opts_knit$set(upload.fun = imgur_upload, base.url = NULL)

```{r}
complaints <- facility("complaints") %>%
nhsta_fetch()
nhtsa_fetch()
head(complaints, 5)
```

```{r}
complaints_2010 <- facility("complaints") %>%
model_year("2010") %>%
nhsta_fetch()
nhtsa_fetch()
head(complaints_2010, 5)
```
Expand All @@ -53,7 +53,7 @@ head(complaints_2010, 5)
ford_2010_complaints <- facility("complaints") %>%
model_year("2010") %>%
vehicle_make("ford") %>%
nhsta_fetch()
nhtsa_fetch()
head(ford_2010_complaints, 5)
```
Expand All @@ -64,7 +64,7 @@ ford_fusion_2010_complaints <- facility("complaints") %>%
model_year("2010") %>%
vehicle_make("ford") %>%
vehicle_model("fusion") %>%
nhsta_fetch()
nhtsa_fetch()
str(ford_fusion_2010_complaints)
```
Expand Down

0 comments on commit a4f9ac8

Please sign in to comment.