From 8a2c71224034bcce23c923d648c7c937bd0b6613 Mon Sep 17 00:00:00 2001 From: Bob Kubinec Date: Thu, 2 Jan 2025 15:13:05 -0500 Subject: [PATCH] fix some bugs --- R/Helpers.R | 2 +- R/Plot.R | 4 ++-- man/id_estimate.Rd | 5 +---- vignettes/Package_Introduction.qmd | 7 +++++-- vignettes/Time_Series.qmd | 10 ++++++---- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/R/Helpers.R b/R/Helpers.R index fafa3c0..1ffb964 100755 --- a/R/Helpers.R +++ b/R/Helpers.R @@ -1358,7 +1358,7 @@ process_init_pathfinder <- function(init, num_procs, model_variables = NULL, .check_quoted <- function(quoted=NULL,default_val) { if(is.null(quoted)) { quoted <- default_val - } else if(class(quoted)=='character') { + } else if(inherits(quoted,'character')) { quoted <- as.name(quoted) quoted <- enquo(quoted) } else { diff --git a/R/Plot.R b/R/Plot.R index ee2d52d..7aca2f4 100755 --- a/R/Plot.R +++ b/R/Plot.R @@ -124,7 +124,7 @@ id_plot_legis <- function(object,return_data=FALSE, } - if(class(object)=='idealstan') { + if(inherits(object,'idealstan')) { person_params <- .prepare_legis_data(object, high_limit=high_limit, low_limit=low_limit,include=include, @@ -635,7 +635,7 @@ id_plot_legis_dyn <- function(object,return_data=FALSE, } - if(class(object)=='idealstan') { + if(inherits(object,'idealstan')) { person_params <- .prepare_legis_data(object, high_limit=high_limit, low_limit=low_limit, diff --git a/man/id_estimate.Rd b/man/id_estimate.Rd index 26bcba8..0faa7c2 100755 --- a/man/id_estimate.Rd +++ b/man/id_estimate.Rd @@ -86,10 +86,7 @@ See below.} \item{inflate_zero}{If the outcome is distributed as Poisson (count/unbounded integer), setting this to -\code{TRUE} will fit a traditional zero-inflated model. -To use correctly, the value for -zero must be passed as the \code{miss_val} option to \code{\link{id_make}} before -running a model so that zeroes are coded as missing data.} +\code{TRUE} will fit a traditional zero-inflated model.} \item{vary_ideal_pts}{Default \code{'none'}. If \code{'random_walk'}, \code{'AR1'}, \code{'GP'}, or \code{'splines'}, a diff --git a/vignettes/Package_Introduction.qmd b/vignettes/Package_Introduction.qmd index 5d5e3cd..4714bd8 100755 --- a/vignettes/Package_Introduction.qmd +++ b/vignettes/Package_Introduction.qmd @@ -3,6 +3,7 @@ title: "Introduction to Idealstan" author: "Robert Kubinec" date: last-modified format: html +cache: false vignette: > %\VignetteIndexEntry{Time-Varying Ideal Points} %\VignetteEngine{R.rsp::asis} @@ -11,12 +12,14 @@ vignette: > ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE,warning=FALSE,fig.align = 'center',fig.width=6, fig.height=5) -options(cmdstanr_warn_inits = FALSE) + library(idealstan) library(dplyr) library(ggplot2) library(tidyr) library(tinytable) + +options(cmdstanr_warn_inits = FALSE) ``` *Note: To report bugs with the package, please file an issue on the [Github page](https://github.com/saudiwin/idealstan/issues).* @@ -36,7 +39,7 @@ The approach to handling missing data in this package is to model cases where mi The package includes the following models: | Model ID | Model Type | Response Type | Missing Data Adjustment | -|-----------------|---------------------|-----------------|-----------------| +|----|----|----|----| | 1 | IRT 2-PL | Binary | No | | 2 | IRT 2-PL | Binary | Yes | | 3 | IRT rating scale | Ordinal | No | diff --git a/vignettes/Time_Series.qmd b/vignettes/Time_Series.qmd index d0eea4c..0b6b0a5 100755 --- a/vignettes/Time_Series.qmd +++ b/vignettes/Time_Series.qmd @@ -12,10 +12,12 @@ vignette: > ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE,message = FALSE,warning=FALSE,fig.align = 'center',fig.width=6, fig.height=5) -require(idealstan) -require(dplyr) -require(ggplot2) -require(lubridate) +library(idealstan) +library(dplyr) +library(ggplot2) +library(lubridate) + +options(cmdstanr_warn_inits = FALSE) ``` *Note: To report bugs with the package, please file an issue on the [Github page](https://github.com/saudiwin/idealstan/issues).*