Skip to content

Commit

Permalink
first commit, start of nomisr project
Browse files Browse the repository at this point in the history
  • Loading branch information
evanodell committed Jan 19, 2018
1 parent ec38192 commit f8062f7
Show file tree
Hide file tree
Showing 16 changed files with 236 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^README-.*\.png$
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
src/*.o
src/*.so
src/*.dll
11 changes: 11 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: nomisr
Type: Package
Title: What the Package Does in One 'Title Case' Line
Version: 1.0
Date: 2018-01-19
Author: Your Name
Maintainer: Your Name <your@email.com>
Description: One paragraph description of what the package does as one or more full sentences.
License: GPL (>= 2)
Imports: Rcpp (>= 0.12.14)
LinkingTo: Rcpp
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
useDynLib(nomisr, .registration=TRUE)
exportPattern("^[[:alpha:]]+")
importFrom(Rcpp, evalCpp)
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@





# nomisr 0.0.1

Start of project

7 changes: 7 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

rcpp_hello_world <- function() {
.Call(`_nomisr_rcpp_hello_world`)
}

3 changes: 3 additions & 0 deletions R/nomisr-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


# Docs: https://www.nomisweb.co.uk/api/v01/help
15 changes: 15 additions & 0 deletions R/search.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### function for searching




nomis_search <- function(search, keyword=FALSE){

mydata <- dplyr::if_else(keyword==FALSE,
jsonlite::fromJSON(paste0("https://www.nomisweb.co.uk/api/v01/dataset/def.sdmx.json?search=*", search, "*"), flatten = TRUE),
jsonlite::fromJSON(paste0("https://www.nomisweb.co.uk/api/v01/dataset/def.sdmx.json?search=keywords-", search, "*"), flatten = TRUE))

df <- mydata$structure$keyfamilies$keyfamily


}
35 changes: 35 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# nomisr

The goal of nomisr is to ...

## Installation

You can install nomisr from github with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("evanodell/nomisr")
```
<!--
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
## basic example code
```
-->
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# nomisr

<!-- README.md is generated from README.Rmd. Please edit that file -->
nomisr
======

The goal of nomisr is to ...

Installation
------------

You can install nomisr from github with:

``` r
# install.packages("devtools")
devtools::install_github("evanodell/nomisr")
```

<!--
## Example
This is a basic example which shows you how to solve a common problem:
```r
## basic example code
```
-->
8 changes: 8 additions & 0 deletions Read-and-delete-me
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Edit the help file skeletons in 'man', possibly combining help files for multiple functions.
* Edit the exports in 'NAMESPACE', and add necessary imports.
* Put any C/C++/Fortran code in 'src'.
* If you have compiled code, add a useDynLib() directive to 'NAMESPACE'.
* Run R CMD build to build the package tarball.
* Run R CMD check to check the package tarball.

Read "Writing R Extensions" for more information.
34 changes: 34 additions & 0 deletions man/nomisr-package.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
\name{nomisr-package}
\alias{nomisr-package}
\alias{nomisr}
\docType{package}
\title{
A short title line describing what the package does
}
\description{
A more detailed description of what the package does. A length
of about one to five lines is recommended.
}
\details{
This section should provide a more detailed overview of how to use the
package, including the most important functions.
}
\author{
Your Name, email optional.

Maintainer: Your Name <your@email.com>
}
\references{
This optional section can contain literature or other references for
background information.
}
\keyword{ package }
\seealso{
Optional links to other man pages
}
\examples{
\dontrun{
## Optional simple examples of the most important functions
## These can be in \dontrun{} and \donttest{} blocks.
}
}
17 changes: 17 additions & 0 deletions man/rcpp_hello_world.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
\name{rcpp_hello_world}
\alias{rcpp_hello_world}
\docType{package}
\title{
Simple function using Rcpp
}
\description{
Simple function using Rcpp
}
\usage{
rcpp_hello_world()
}
\examples{
\dontrun{
rcpp_hello_world()
}
}
17 changes: 17 additions & 0 deletions nomisr.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
27 changes: 27 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

// rcpp_hello_world
List rcpp_hello_world();
RcppExport SEXP _nomisr_rcpp_hello_world() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(rcpp_hello_world());
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_nomisr_rcpp_hello_world", (DL_FUNC) &_nomisr_rcpp_hello_world, 0},
{NULL, NULL, 0}
};

RcppExport void R_init_nomisr(DllInfo *dll) {
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}
13 changes: 13 additions & 0 deletions src/rcpp_hello_world.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#include <Rcpp.h>
using namespace Rcpp;

// [[Rcpp::export]]
List rcpp_hello_world() {

CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z = List::create( x, y ) ;

return z ;
}

0 comments on commit f8062f7

Please sign in to comment.