Skip to content

Commit e7403de

Browse files
authored
Merge pull request #16 from jamesdunham/0.2.9
Release 0.2.9
2 parents ba2e7aa + d58c87e commit e7403de

File tree

92 files changed

+1770
-12569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1770
-12569
lines changed

.Rbuildignore

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
^.*\.Rproj$
21
^.*\.Rdata$
3-
^.*\.png$
2+
^.*\.Rproj$
3+
^.*tar.gz$
4+
^Makefile$
45
^README.Rmd$
5-
^README_cache$
6-
^README/$
6+
^README/
77
^\.DS_Store$
8+
^\.Rproj\.user$
89
^\.travis\.yml$
9-
^packrat/
10+
^appveyor\.yml$
11+
^codecov\.yml$
12+
^cran-comments\.md$
1013
^data-ext/
1114
^docs/
12-
^wercker\.yml$
15+
^packrat/
16+
^readme-cache/
1317
^setup.r$
14-
^Makefile$
15-
^.*tar.gz$
16-
^\.Rproj\.user$
17-
^codecov\.yml$
18-
^appveyor\.yml$
19-
^cran-comments\.md$
20-
18+
^wercker\.yml$

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.Rproj.user
2-
README_cache/
2+
dgo.Rcheck/
3+
*.tar.gz
4+
readme-cache
35
src/*.o
46
src/*.so
5-
src/include/models.hpp.bak

DESCRIPTION

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: dgo
22
Title: Dynamic Estimation of Group-Level Opinion
3-
Version: 0.2.8
4-
Date: 2017-01-31
5-
Description: Fit dynamic group-level IRT models from individual or aggregated
6-
item response data. This package handles common preprocessing tasks and extends
7-
functions for inspecting results, poststratification, and quick iteration over
8-
alternative models. Under active development.
3+
Version: 0.2.9
4+
Date: 2017-05-21
5+
Description: Fit dynamic group-level IRT and MRP models from individual or
6+
aggregated item response data. This package handles common preprocessing
7+
tasks and extends functions for inspecting results, poststratification, and
8+
quick iteration over alternative models.
99
Maintainer: James Dunham <james@jdunham.io>
1010
Authors@R: c(
1111
person("James", "Dunham", email = "james@jdunham.io", role = c("aut", "cre")),
@@ -18,29 +18,24 @@ BugReports: https://github.com/jamesdunham/dgo/issues
1818
Depends:
1919
dgodata,
2020
R (>= 3.2.2),
21-
Rcpp (>= 0.11.0),
22-
rstan (>= 2.8.1)
21+
rstan (>= 2.15.1)
2322
LazyData: true
2423
Imports:
2524
assertthat,
26-
concatenate,
2725
data.table,
2826
ggplot2,
2927
lubridate,
3028
methods,
3129
R6,
30+
Rcpp (>= 0.12.10),
3231
survey
3332
Suggests:
3433
knitr,
3534
rmarkdown,
3635
testthat
37-
LinkingTo: StanHeaders (>= 2.8.0), rstan (>= 2.8.1), BH (>= 1.58.0), Rcpp (>=
38-
0.11.0), RcppEigen
39-
RcppModules: stan_fit42016_09_14_mod, stan_fit42016_04_20_mod,
40-
stan_fit42015_12_16_mod, stan_fit42017_01_04_singleissue_mod,
41-
stan_fit42017_01_04_mod
36+
LinkingTo: Rcpp (>= 0.12.10)
4237
NeedsCompilation: yes
43-
Collate:
38+
Collate:
4439
'RcppExports.R'
4540
'aggregate_item_responses.r'
4641
'assertions.r'
@@ -51,25 +46,22 @@ Collate:
5146
'class-dgirtin.r'
5247
'class-dgmrp_fit.r'
5348
'dgirt.r'
54-
'dgmrp.r'
5549
'dichotomize_item_responses.r'
5650
'expand_rownames.r'
5751
'methods-control.r'
5852
'methods-dgirtfit-plot.r'
5953
'methods-dgirtfit-poststratify.r'
6054
'methods-dgirtfit.r'
61-
'require_namespace.r'
6255
'methods-dgirtin.r'
6356
'name_helpers.r'
6457
'package.R'
6558
'rake_partial.r'
6659
'restrict_input_data.r'
6760
'reweight_item_responses.r'
6861
'shape.r'
69-
'stanmodels.R'
62+
'shape_hierarchical.r'
7063
'toy_dgirt_in.r'
7164
'toy_dgirtfit.r'
7265
'validate_dgirtIn.r'
7366
'validate_input_data.r'
74-
'zzz.R'
7567
RoxygenNote: 6.0.1

Makefile

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,53 @@
1-
# Makefile for development use
2-
1+
PKG := $(shell head -1 DESCRIPTION | sed 's/Package: //' | cat)
32
VERSION := $(shell sed -n 3p DESCRIPTION | sed 's/Version: //' | cat)
4-
BINARY := dgo_$(VERSION).tar.gz
3+
BINARY := $(PKG)_$(VERSION).tar.gz
4+
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
5+
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
6+
R_ARGS := --no-site-file --no-environ --no-save \
7+
--no-restore --no-resave-data --no-manual --quiet
8+
ifneq (, $(findstring r-devel,$(CURRENT_DIR)))
9+
R := R_devel.sh
10+
else
11+
R := R
12+
endif
13+
14+
all: clean build check install readme
15+
16+
quick: clean
517

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

821
build:
9-
R --no-site-file --no-environ \
10-
--no-save --no-restore --quiet CMD build . \
11-
--no-resave-data --no-manual
22+
$(R) $(R_ARGS) CMD build .
1223

24+
build-cran:
25+
$(R) CMD build . --no-resave-data --no-manual
26+
1327
check:
14-
R CMD check dgo_$(VERSION).tar.gz
28+
$(R) CMD check $(PKG)_$(VERSION).tar.gz
1529

1630
check-cran:
17-
R CMD check --as-cran dgo_$(VERSION).tar.gz
31+
$(R) CMD check --as-cran $(PKG)_$(VERSION).tar.gz
1832

19-
install: dgo_$(VERSION).tar.gz
20-
R CMD INSTALL --no-multiarch --with-keep.source dgo_$(VERSION).tar.gz
33+
check-quick $(PKG)_$(VERSION).tar.gz:
34+
$(R) $(R_ARGS) CMD build .
35+
$(R) CMD check $(PKG)_$(VERSION).tar.gz
36+
37+
install: $(PKG)_$(VERSION).tar.gz
38+
$(R) CMD INSTALL --no-multiarch --with-keep.source \
39+
$(PKG)_$(VERSION).tar.gz
2140

2241
install-code:
23-
R CMD INSTALL --no-multiarch --with-keep.source --no-docs .
42+
$(R) CMD INSTALL --no-multiarch --with-keep.source --no-docs .
2443

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

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

31-
quick-install:
32-
R CMD INSTALL --no-multiarch --no-docs --no-html \
33-
--with-keep.source .
51+
docs:
52+
$(R) --vanilla --slave -e "devtools::document()"
3453

35-
quick-check dgo_$(VERSION).tar.gz:
36-
R --no-site-file --no-environ \
37-
--no-save --no-restore --quiet CMD build . \
38-
--no-resave-data --no-manual
39-
R CMD check dgo_$(VERSION).tar.gz

NAMESPACE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ import(dgodata)
2727
import(ggplot2)
2828
import(methods)
2929
import(rstan)
30-
importFrom(concatenate,cc)
31-
importFrom(concatenate,cc_and)
32-
importFrom(concatenate,cc_or)
33-
importFrom(concatenate,cn)
34-
importFrom(concatenate,cn_and)
3530
importFrom(lubridate,seconds_to_period)
3631
importFrom(stats,as.formula)
3732
importFrom(stats,formula)

NEWS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.2.9
2+
3+
* Switch from compiling Stan models at install time to compiling them at
4+
runtime, avoiding an Rcpp module issue.
5+
* Add `model` argument to `dgirt()` and `dgmrp()` taking for reuse a previously
6+
compiled Stan model, as found in the `@stanmodel` slot of a `dgirt_fit`- or
7+
`dgmrp_fit`-class object.
8+
* The `version` argument to `dgirt()` and `dgmrp()` can be used to specify
9+
arbitrary `.stan` files on the disk in addition to those included with the
10+
package.
11+
* Argument `by` to `get_n()` and `get_item_n()` methods properly accepts a
12+
vector of variable names when combined with `aggregate` arguments.
13+
114
# 0.2.8
215

316
* Improve Stan models for shorter run times

R/class-dgirt_fit.r

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
#' apply(as.array(toy_dgirtfit, pars = 'xi'), 3, mean)
2727
#'
2828
#' # access the posterior samples
29-
#' as.array(toy_dgirtfit, pars = 'theta_bar')
30-
#' as.data.frame(toy_dgirtfit, pars = 'theta_bar')
31-
#' extract(toy_dgirtfit, pars = 'theta_bar')
29+
#' head(as.data.frame(toy_dgirtfit, pars = 'theta_bar'))
3230
dgirt_fit <- setClass("dgirt_fit", contains = c("dgo_fit"))
3331

3432
#' Class \code{dgirtfit}: a class for fitted models

R/class-dgirtin.r

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#' @include constants.r
1010
#' @import R6
1111
#' @examples
12+
#' data(toy_dgirt_in)
1213
#' get_item_names(toy_dgirt_in)
1314
#' get_n(toy_dgirt_in)
1415
#' get_n(toy_dgirt_in, by = "year")
@@ -54,4 +55,4 @@ dgirtIn <- R6::R6Class("dgirtIn",
5455
d_in_list
5556
}),
5657
private = list(model_objects = model_objects,
57-
shape_objects = shape_objects))
58+
shape_objects = shape_objects))

R/constants.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ model_objects <- c("NNl2", "SSl2", "XX", "ZZ", "ZZ_prior", "G", "Q", "T", "N",
44

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

1010
dgirt_pars <- c("separate_t", "delta_tbar_prior_mean", "delta_tbar_prior_sd",
1111
"innov_sd_delta_scale", "innov_sd_theta_scale", "version",

0 commit comments

Comments
 (0)