Skip to content

Commit

Permalink
Correcting mess with NAMESPACE
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Aug 10, 2023
1 parent de180d6 commit ab9d67b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ RoxygenNote: 7.2.3
LinkingTo:
Rcpp
Imports:
Rcpp
Rcpp,
stats
Depends:
R (>= 2.10),
stats4
Expand Down
8 changes: 2 additions & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
S3method("+",DEFM)
S3method(as.data.frame,defm_motif_census)
S3method(names,defm_motif_census)
S3method(nobs,DEFM)
S3method(print,DEFM)
S3method(print,defm_motif_census)
S3method(stats4::nobs,DEFM)
export(defm_mle)
export(get_X_names)
export(get_Y_names)
Expand All @@ -18,6 +18,7 @@ export(motif_census)
export(ncol_defm_x)
export(ncol_defm_y)
export(new_defm)
export(nobs.DEFM)
export(nobs_defm)
export(nrow_defm)
export(nterms_defm)
Expand All @@ -32,10 +33,5 @@ export(term_defm_transition)
export(term_defm_transition_formula)
import(stats4)
importFrom(Rcpp,sourceCpp)
importFrom(stats,AIC)
importFrom(stats,BIC)
importFrom(stats,coef)
importFrom(stats,nobs)
importFrom(stats,pnorm)
importFrom(stats,vcov)
useDynLib(defm, .registration = TRUE)
1 change: 0 additions & 1 deletion R/defm-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ new_defm <- function(
#' @param object An object of class [DEFM].
#' @return - `nobs` is an alias for `nobs_defm()`.
#' @param ... Not used.
#' @importFrom stats nobs
#' @export
#' @exportS3Method stats4::nobs
nobs.DEFM <- function(object, ...) {
Expand Down
16 changes: 9 additions & 7 deletions R/defm_mle.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ defm_mle <- function(

}

#' @importFrom stats pnorm
pval_calc <- function(obj) {
stats::pnorm(-abs(stats::coef(obj)/sqrt(diag(vcov(obj))))) * 2
stats::pnorm(
-abs(stats4::coef(obj)/sqrt(diag(stats4::vcov(obj))))
) * 2
}

#' @export
Expand All @@ -120,17 +123,16 @@ pval_calc <- function(obj) {
#' with the estimates, se, and pvalues. If `as_texreg = TRUE`, then it will
#' return a texreg object.
#' @rdname defm_mle
#' @importFrom stats AIC BIC coef vcov
summary_table <- function(object, as_texreg = FALSE, ...) {

# Generating the output table
tab <- list(
coef.names = names(stats::coef(object)),
coef = stats::coef(object),
se = sqrt(diag(stats::vcov(object))),
coef.names = names(stats4::coef(object)),
coef = stats4::coef(object),
se = sqrt(diag(stats4::vcov(object))),
gof.names = c("AIC", "BIC", "N"),
gof = c(stats::AIC(object), stats::BIC(object), stats::nobs(object)),
gof.decimal = c(T,T,F),
gof = c(stats4::AIC(object), stats4::BIC(object), stats4::nobs(object)),
gof.decimal = c(T, T, F),
pvalues = pval_calc(object)
)

Expand Down
2 changes: 1 addition & 1 deletion man/DEFM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab9d67b

Please sign in to comment.