# NOT RUN {
# Simple example with cor.test:
# From example(cor.test)
x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
y <- c( 2.6, 3.1, 2.5, 5.0, 3.6, 4.0, 5.2, 2.8, 3.8)
ct1 <- cor.test(x, y, method = "kendall", alternative = "greater")
uCor.test <- updateable(cor.test)
ct2 <- uCor.test(x, y, method = "kendall", alternative = "greater")
getCall(ct1) # --> NULL
getCall(ct2)
#update(ct1, method = "pearson") --> Error
update(ct2, method = "pearson")
update(ct2, alternative = "two.sided")
## predefined wrapper for 'gamm':
# }
# NOT RUN {
set.seed(0)
dat <- gamSim(6, n = 100, scale = 5, dist = "normal")
fmm1 <- uGamm(y ~s(x0)+ s(x3) + s(x2), family = gaussian, data = dat,
random = list(fac = ~1))
getCall(fmm1)
class(fmm1)
# }
# NOT RUN {
###
# }
# NOT RUN {
library(caper)
data(shorebird)
shorebird <- comparative.data(shorebird.tree, shorebird.data, Species)
fm1 <- crunch(Egg.Mass ~ F.Mass * M.Mass, data = shorebird)
uCrunch <- updateable(crunch)
fm2 <- uCrunch(Egg.Mass ~ F.Mass * M.Mass, data = shorebird)
getCall(fm1)
getCall(fm2)
update(fm2) # Error with 'fm1'
dredge(fm2)
# }
# NOT RUN {
###
# }
# NOT RUN {
# "lmekin" does not store "formula" element
library(coxme)
uLmekin <- updateable(lmekin, eval.args = "formula")
f <- effort ~ Type + (1|Subject)
fm1 <- lmekin(f, data = ergoStool)
fm2 <- uLmekin(f, data = ergoStool)
f <- wrong ~ formula # reassigning "f"
getCall(fm1) # formula is "f"
getCall(fm2)
formula(fm1) # returns the current value of "f"
formula(fm2)
# }
Run the code above in your browser using DataLab