Skip to content

Commit

Permalink
Update for CRAN submission; maily documentation and NAMESPACE issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mclements committed Jul 27, 2015
1 parent 8cc2d59 commit 6d99869
Showing 9 changed files with 33 additions and 31 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ Authors@R: c(person("Mark", "Clements", role = c("aut", "cre"),
person("Paul", "Lambert", role = "ctb", email="pl4@leicester.ac.uk"))
Version: 1.2.2
Date: 2015-07-12
Depends: R (>= 2.10), methods
Imports: graphics, Rcpp (>= 0.10.2), numDeriv, splines, stats, survival, mgcv, bbmle (>= 1.0.3)
Depends: R (>= 2.10), methods, survival, splines
Imports: graphics, Rcpp (>= 0.10.2), numDeriv, stats, mgcv, bbmle (>= 1.0.3)
Suggests: RUnit, gaussquad
LinkingTo: Rcpp,RcppArmadillo
Author: Mark Clements [aut, cre], Xing-Rong Liu [aut], Paul Lambert [ctb]
30 changes: 12 additions & 18 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
useDynLib(rstpm2)
export(stpm2,pstpm2,incrVar,nsx,predictnl,predictnl.default)
exportMethods(
"plot",
"predict",
"predictnl"
)
exportClasses(
"stpm2",
"pstpm2" #,"tvcCoxph"
)

export(stpm2,pstpm2,incrVar,nsx,predictnl,"coef<-")
exportClasses(stpm2,pstpm2) # tvcCoxph
S3method(makepredictcall, nsx)
S3method(predict, nsx)
## All methods for imported generics:
exportMethods(plot,predict,predictnl,coef,confint,summary,update,anova,vcov,formula,anova,
AIC,AICc,qAICc,simulate)

importFrom(graphics,plot,lines,matplot,par,polygon)
importFrom(splines,bs,ns)
## importFrom(splines,bs,ns,spline.des,splineDesign)
importFrom(stats, quantile, lm, as.formula, coef, makepredictcall, na.fail, predict,
contrasts,delete.response, get_all_vars, model.extract, model.frame,
model.matrix, model.weights, na.pass, optimHess, pweibull,
terms, terms.formula)
importFrom(survival,survfit,coxph,Surv)
importFrom(bbmle,mle2,"parnames<-")
terms, terms.formula, .checkMFClasses, .getXlevels)
importFrom(mgcv,gam,s)
importFrom(Rcpp,sourceCpp)
import(methods)
import(bbmle,methods,survival,splines)

importClassesFrom(bbmle,mle2)

S3method(makepredictcall, nsx)
S3method(predict, nsx)
8 changes: 7 additions & 1 deletion R/pm2-3.R
Original file line number Diff line number Diff line change
@@ -241,8 +241,14 @@ numDeltaMethod <- function(object,fun,...) {
se.est <- as.vector(sqrt(colSums(gd* (Sigma %*% gd))))
data.frame(Estimate = est, SE = se.est)
}
"coef<-" <- function (x, value)
UseMethod("coef<-")
predictnl <- function (object, ...)
UseMethod("predictnl")
"coef<-.default" <- function(x,value) {
x$coefficients <- value
x
}
predictnl.default <- function(object,fun,newdata=NULL,...)
{
## link=c(I,log,sqrt),invlink=NULL
@@ -706,7 +712,7 @@ stpm2 <- function(formula, data,
optimizer = "optim",
xlevels = .getXlevels(mt, mf),
##contrasts = attr(X, "contrasts"),
contrasts = NULL, # wrong!
contrasts = contrasts,
logli = logli,
##weights = weights,
Call = Call,
Binary file modified data/colon.rda
Binary file not shown.
10 changes: 6 additions & 4 deletions man/colon.Rd
Original file line number Diff line number Diff line change
@@ -33,17 +33,19 @@ Colon cancer.

}
}
%% \details{
%% %% ~~ If necessary, more details than the __description__ above ~~
%% }
\details{
Caution: there is a \code{colon} dataset in the \code{survival}
package. We recommend using \code{data(colon,package="rstpm2")} to
ensure the correct dataset is used.
}
%% \source{
%% %% ~~ reference to a publication or URL from which the data were obtained ~~
%% }
%% \references{
%% %% ~~ possibly secondary sources and usages ~~
%% }
\examples{
data(colon)
data(colon,package="rstpm2") # avoids name conflict with survival::colon
## maybe str(colon) ; ...
}
\keyword{datasets}
1 change: 0 additions & 1 deletion man/predict.nsx.Rd
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
\code{\link{nsx}}.
}
\examples{
require(stats)
basis <- nsx(women$height, df = 5)
newX <- seq(58, 72, length.out = 51)
# evaluate the basis at the new data
2 changes: 1 addition & 1 deletion man/stpm2.Rd
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ two variables define the time}

}
\value{
An \code{stpm2-class} object.
An \code{stpm2-class} object that inherits from \code{mle2-class}.
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
9 changes: 5 additions & 4 deletions vignettes/Introduction.Rnw
Original file line number Diff line number Diff line change
@@ -63,11 +63,11 @@ Initially, we merge the patient data with the all cause mortality rates.

<<echo=FALSE,results=hide>>=
options(width=80,useFancyQuotes="UTF-8")
require(rstpm2); require(survival)
require(rstpm2)
@
<<>>=
data(popmort)
data(colon)
data(popmort, package="rstpm2")
data(colon,package="rstpm2")
popmort2 <- transform(popmort,exitage=age,exityear=year,age=NULL,year=NULL)
colon2 <- within(colon, {
status <- ifelse(surv_mm>120.5,1,status)
@@ -81,7 +81,8 @@ colon2 <- within(colon, {
colon2 <- merge(colon2,popmort2)
@
For comparisons, we fit the relative survival model without and with cure.
<<results=hide>>=
%% <<results=hide>>=
<<>>=
fit0 <- stpm2(Surv(tm,status %in% 2:3)~I(year8594=="Diagnosed 85-94"),
data=colon2,
bhazard=colon2$rate, df=5)
Binary file modified vignettes/Introduction.pdf
Binary file not shown.

0 comments on commit 6d99869

Please sign in to comment.