diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..91114bf --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,2 @@ +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a74739 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.Rproj.user +.Rhistory +.RData +src/*.o +src/*.so +src/*.dll diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..8f4e803 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,14 @@ +Package: decon +Type: Package +Title: What the Package Does (Title Case) +Version: 0.1 +Date: 2016-01-19 +Author: Who wrote it +Maintainer: Who to complain to +Description: More about what it does (maybe more than one line) +License: What license is it under? +LazyData: TRUE +Imports: + Rcpp (>= 0.12.1) +LinkingTo: + Rcpp \ No newline at end of file diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..bcc80ad --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,3 @@ +exportPattern("^[[:alpha:]]+") +importFrom(Rcpp, evalCpp) +useDynLib(decon) diff --git a/R/RcppExports.R b/R/RcppExports.R new file mode 100644 index 0000000..f932e1d --- /dev/null +++ b/R/RcppExports.R @@ -0,0 +1,7 @@ +# This file was generated by Rcpp::compileAttributes +# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +rcpp_hello <- function() { + .Call('decon_rcpp_hello', PACKAGE = 'decon') +} + diff --git a/R/dome.R b/R/dome.R new file mode 100644 index 0000000..147c084 --- /dev/null +++ b/R/dome.R @@ -0,0 +1,3 @@ +dome <- function(a,b){ + a == b +} diff --git a/R/hello.R b/R/hello.R new file mode 100644 index 0000000..26b1f90 --- /dev/null +++ b/R/hello.R @@ -0,0 +1,18 @@ +# Hello, world! +# +# This is an example function named 'hello' +# which prints 'Hello, world!'. +# +# You can learn more about package authoring with RStudio at: +# +# http://r-pkgs.had.co.nz/ +# +# Some useful keyboard shortcuts for package authoring: +# +# Build and Reload Package: 'Cmd + Shift + B' +# Check Package: 'Cmd + Shift + E' +# Test Package: 'Cmd + Shift + T' + +hello <- function() { + print("Hello, world!") +} diff --git a/decon.Rproj b/decon.Rproj new file mode 100644 index 0000000..f6cd4b6 --- /dev/null +++ b/decon.Rproj @@ -0,0 +1,20 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: XeLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source diff --git a/man/hello.Rd b/man/hello.Rd new file mode 100644 index 0000000..0fa7c4b --- /dev/null +++ b/man/hello.Rd @@ -0,0 +1,12 @@ +\name{hello} +\alias{hello} +\title{Hello, World!} +\usage{ +hello() +} +\description{ +Prints 'Hello, world!'. +} +\examples{ +hello() +} diff --git a/man/rcpp_hello.Rd b/man/rcpp_hello.Rd new file mode 100644 index 0000000..9084505 --- /dev/null +++ b/man/rcpp_hello.Rd @@ -0,0 +1,13 @@ +\name{rcpp_hello} +\alias{rcpp_hello} +\title{Hello, Rcpp!} +\usage{ +rcpp_hello() +} +\description{ +Returns an \R \code{list} containing the character vector +\code{c("foo", "bar")} and the numeric vector \code{c(0, 1)}. +} +\examples{ +rcpp_hello() +} diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp new file mode 100644 index 0000000..2d8bdb5 --- /dev/null +++ b/src/RcppExports.cpp @@ -0,0 +1,17 @@ +// This file was generated by Rcpp::compileAttributes +// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +#include + +using namespace Rcpp; + +// rcpp_hello +List rcpp_hello(); +RcppExport SEXP decon_rcpp_hello() { +BEGIN_RCPP + Rcpp::RObject __result; + Rcpp::RNGScope __rngScope; + __result = Rcpp::wrap(rcpp_hello()); + return __result; +END_RCPP +} diff --git a/src/rcpp_hello.cpp b/src/rcpp_hello.cpp new file mode 100644 index 0000000..487a9b2 --- /dev/null +++ b/src/rcpp_hello.cpp @@ -0,0 +1,23 @@ +#include +using namespace Rcpp; + +// This is a simple function using Rcpp that creates an R list +// containing a character vector and a numeric vector. +// +// Learn more about how to use Rcpp at: +// +// http://www.rcpp.org/ +// http://adv-r.had.co.nz/Rcpp.html +// +// and browse examples of code using Rcpp at: +// +// http://gallery.rcpp.org/ +// + +// [[Rcpp::export]] +List rcpp_hello() { + CharacterVector x = CharacterVector::create("foo", "bar"); + NumericVector y = NumericVector::create(0.0, 1.0); + List z = List::create(x, y); + return z; +}