Skip to content

Commit

Permalink
Merge pull request #16 from jamesdunham/0.2.9
Browse files Browse the repository at this point in the history
Release 0.2.9
  • Loading branch information
jamesdunham authored May 22, 2017
2 parents ba2e7aa + d58c87e commit e7403de
Show file tree
Hide file tree
Showing 92 changed files with 1,770 additions and 12,569 deletions.
24 changes: 11 additions & 13 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
^.*\.Rproj$
^.*\.Rdata$
^.*\.png$
^.*\.Rproj$
^.*tar.gz$
^Makefile$
^README.Rmd$
^README_cache$
^README/$
^README/
^\.DS_Store$
^\.Rproj\.user$
^\.travis\.yml$
^packrat/
^appveyor\.yml$
^codecov\.yml$
^cran-comments\.md$
^data-ext/
^docs/
^wercker\.yml$
^packrat/
^readme-cache/
^setup.r$
^Makefile$
^.*tar.gz$
^\.Rproj\.user$
^codecov\.yml$
^appveyor\.yml$
^cran-comments\.md$

^wercker\.yml$
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.Rproj.user
README_cache/
dgo.Rcheck/
*.tar.gz
readme-cache
src/*.o
src/*.so
src/include/models.hpp.bak
30 changes: 11 additions & 19 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: dgo
Title: Dynamic Estimation of Group-Level Opinion
Version: 0.2.8
Date: 2017-01-31
Description: Fit dynamic group-level IRT models from individual or aggregated
item response data. This package handles common preprocessing tasks and extends
functions for inspecting results, poststratification, and quick iteration over
alternative models. Under active development.
Version: 0.2.9
Date: 2017-05-21
Description: Fit dynamic group-level IRT and MRP models from individual or
aggregated item response data. This package handles common preprocessing
tasks and extends functions for inspecting results, poststratification, and
quick iteration over alternative models.
Maintainer: James Dunham <james@jdunham.io>
Authors@R: c(
person("James", "Dunham", email = "james@jdunham.io", role = c("aut", "cre")),
Expand All @@ -18,29 +18,24 @@ BugReports: https://github.com/jamesdunham/dgo/issues
Depends:
dgodata,
R (>= 3.2.2),
Rcpp (>= 0.11.0),
rstan (>= 2.8.1)
rstan (>= 2.15.1)
LazyData: true
Imports:
assertthat,
concatenate,
data.table,
ggplot2,
lubridate,
methods,
R6,
Rcpp (>= 0.12.10),
survey
Suggests:
knitr,
rmarkdown,
testthat
LinkingTo: StanHeaders (>= 2.8.0), rstan (>= 2.8.1), BH (>= 1.58.0), Rcpp (>=
0.11.0), RcppEigen
RcppModules: stan_fit42016_09_14_mod, stan_fit42016_04_20_mod,
stan_fit42015_12_16_mod, stan_fit42017_01_04_singleissue_mod,
stan_fit42017_01_04_mod
LinkingTo: Rcpp (>= 0.12.10)
NeedsCompilation: yes
Collate:
Collate:
'RcppExports.R'
'aggregate_item_responses.r'
'assertions.r'
Expand All @@ -51,25 +46,22 @@ Collate:
'class-dgirtin.r'
'class-dgmrp_fit.r'
'dgirt.r'
'dgmrp.r'
'dichotomize_item_responses.r'
'expand_rownames.r'
'methods-control.r'
'methods-dgirtfit-plot.r'
'methods-dgirtfit-poststratify.r'
'methods-dgirtfit.r'
'require_namespace.r'
'methods-dgirtin.r'
'name_helpers.r'
'package.R'
'rake_partial.r'
'restrict_input_data.r'
'reweight_item_responses.r'
'shape.r'
'stanmodels.R'
'shape_hierarchical.r'
'toy_dgirt_in.r'
'toy_dgirtfit.r'
'validate_dgirtIn.r'
'validate_input_data.r'
'zzz.R'
RoxygenNote: 6.0.1
62 changes: 38 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
# Makefile for development use

PKG := $(shell head -1 DESCRIPTION | sed 's/Package: //' | cat)
VERSION := $(shell sed -n 3p DESCRIPTION | sed 's/Version: //' | cat)
BINARY := dgo_$(VERSION).tar.gz
BINARY := $(PKG)_$(VERSION).tar.gz
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
R_ARGS := --no-site-file --no-environ --no-save \
--no-restore --no-resave-data --no-manual --quiet
ifneq (, $(findstring r-devel,$(CURRENT_DIR)))
R := R_devel.sh
else
R := R
endif

all: clean build check install readme

quick: clean

all: build check install readme doc
clean:
@rm -rf src/*.so src/*.o *tar.gz *Rcheck*

build:
R --no-site-file --no-environ \
--no-save --no-restore --quiet CMD build . \
--no-resave-data --no-manual
$(R) $(R_ARGS) CMD build .

build-cran:
$(R) CMD build . --no-resave-data --no-manual

check:
R CMD check dgo_$(VERSION).tar.gz
$(R) CMD check $(PKG)_$(VERSION).tar.gz

check-cran:
R CMD check --as-cran dgo_$(VERSION).tar.gz
$(R) CMD check --as-cran $(PKG)_$(VERSION).tar.gz

install: dgo_$(VERSION).tar.gz
R CMD INSTALL --no-multiarch --with-keep.source dgo_$(VERSION).tar.gz
check-quick $(PKG)_$(VERSION).tar.gz:
$(R) $(R_ARGS) CMD build .
$(R) CMD check $(PKG)_$(VERSION).tar.gz

install: $(PKG)_$(VERSION).tar.gz
$(R) CMD INSTALL --no-multiarch --with-keep.source \
$(PKG)_$(VERSION).tar.gz

install-code:
R CMD INSTALL --no-multiarch --with-keep.source --no-docs .
$(R) CMD INSTALL --no-multiarch --with-keep.source --no-docs .

readme: dgo_$(VERSION).tar.gz
R --vanilla --slave -e "rmarkdown::render('README.Rmd')"
install-quick:
$(R) CMD INSTALL --no-multiarch --no-docs --no-html \
--with-keep.source .

doc: dgo_$(VERSION).tar.gz
R CMD check --no-install --no-tests --no-examples dgo_$(VERSION).tar.gz
readme: $(PKG)_$(VERSION).tar.gz
$(R) --vanilla --slave -e "rmarkdown::render('README.Rmd')"

quick-install:
R CMD INSTALL --no-multiarch --no-docs --no-html \
--with-keep.source .
docs:
$(R) --vanilla --slave -e "devtools::document()"

quick-check dgo_$(VERSION).tar.gz:
R --no-site-file --no-environ \
--no-save --no-restore --quiet CMD build . \
--no-resave-data --no-manual
R CMD check dgo_$(VERSION).tar.gz
5 changes: 0 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ import(dgodata)
import(ggplot2)
import(methods)
import(rstan)
importFrom(concatenate,cc)
importFrom(concatenate,cc_and)
importFrom(concatenate,cc_or)
importFrom(concatenate,cn)
importFrom(concatenate,cn_and)
importFrom(lubridate,seconds_to_period)
importFrom(stats,as.formula)
importFrom(stats,formula)
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.2.9

* Switch from compiling Stan models at install time to compiling them at
runtime, avoiding an Rcpp module issue.
* Add `model` argument to `dgirt()` and `dgmrp()` taking for reuse a previously
compiled Stan model, as found in the `@stanmodel` slot of a `dgirt_fit`- or
`dgmrp_fit`-class object.
* The `version` argument to `dgirt()` and `dgmrp()` can be used to specify
arbitrary `.stan` files on the disk in addition to those included with the
package.
* Argument `by` to `get_n()` and `get_item_n()` methods properly accepts a
vector of variable names when combined with `aggregate` arguments.

# 0.2.8

* Improve Stan models for shorter run times
Expand Down
4 changes: 1 addition & 3 deletions R/class-dgirt_fit.r
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#' apply(as.array(toy_dgirtfit, pars = 'xi'), 3, mean)
#'
#' # access the posterior samples
#' as.array(toy_dgirtfit, pars = 'theta_bar')
#' as.data.frame(toy_dgirtfit, pars = 'theta_bar')
#' extract(toy_dgirtfit, pars = 'theta_bar')
#' head(as.data.frame(toy_dgirtfit, pars = 'theta_bar'))
dgirt_fit <- setClass("dgirt_fit", contains = c("dgo_fit"))

#' Class \code{dgirtfit}: a class for fitted models
Expand Down
3 changes: 2 additions & 1 deletion R/class-dgirtin.r
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @include constants.r
#' @import R6
#' @examples
#' data(toy_dgirt_in)
#' get_item_names(toy_dgirt_in)
#' get_n(toy_dgirt_in)
#' get_n(toy_dgirt_in, by = "year")
Expand Down Expand Up @@ -54,4 +55,4 @@ dgirtIn <- R6::R6Class("dgirtIn",
d_in_list
}),
private = list(model_objects = model_objects,
shape_objects = shape_objects))
shape_objects = shape_objects))
4 changes: 2 additions & 2 deletions R/constants.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ model_objects <- c("NNl2", "SSl2", "XX", "ZZ", "ZZ_prior", "G", "Q", "T", "N",

shape_objects <- c("gt_items", "group_grid", "group_grid_t", "group_counts",
"item_data", "target_data", "aggregate_data", "modifier_data",
"control", "hier_names", "time_observed", "geo_observed",
"call", "mod_par_names", "unmod_par_names", "pkg_version")
"control", "hier_names", "call", "mod_par_names",
"unmod_par_names", "pkg_version")

dgirt_pars <- c("separate_t", "delta_tbar_prior_mean", "delta_tbar_prior_sd",
"innov_sd_delta_scale", "innov_sd_theta_scale", "version",
Expand Down
Loading

0 comments on commit e7403de

Please sign in to comment.