~ubuntu-branches/ubuntu/wily/r-cran-formula/wily

« back to all changes in this revision

Viewing changes to tests/Examples/Formula-Ex.Rout.save

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2015-01-20 07:10:00 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20150120071000-hue2obmviladcax0
Tags: 1.2-0-1
* New upstream release

* debian/control: Set Build-Depends: to current R version
* debian/control: Set Standards-Version: to current version 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
 
R version 3.0.0 (2013-04-03) -- "Masked Marvel"
3
 
Copyright (C) 2013 The R Foundation for Statistical Computing
 
2
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
 
3
Copyright (C) 2014 The R Foundation for Statistical Computing
4
4
Platform: x86_64-pc-linux-gnu (64-bit)
5
5
 
6
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
213
213
> ## Formulas with '.' ##
214
214
> #######################
215
215
216
 
> ## set up Formula
 
216
> ## set up Formula with a single '.'
217
217
> F3 <- Formula(y1 | y2 ~ .)
218
218
> mf3 <- model.frame(F3, data = dat)
219
219
> ## without y1 or y2
262
262
[1] "contr.treatment"
263
263
 
264
264
 
265
> ## set up Formula with multiple '.'
 
266
> F3 <- Formula(y1 | y2 | y3 ~ . - x3 - x4 | .)
 
267
> mf3 <- model.frame(F3, data = dat)
 
268
> ## only x1-x2
 
269
> model.part(F3, data = mf3, rhs = 1)
 
270
    x1   x2
 
271
2 0.26 0.46
 
272
3 0.03 0.37
 
273
> ## all x1-x4 because '.' is processed separately (default)
 
274
> model.part(F3, data = mf3, rhs = 2, dot = "separate")
 
275
    x1   x2 x3 x4
 
276
2 0.26 0.46  a  a
 
277
3 0.03 0.37  b  b
 
278
> ## only x3-x4 because '.' is processed sequentally after first RHS
 
279
> model.part(F3, data = mf3, rhs = 2, dot = "sequential")
 
280
  x3 x4
 
281
2  a  a
 
282
3  b  b
 
283
265
284
> ##############################
266
285
> ## Process multiple offsets ##
267
286
> ##############################
291
310
292
311
> ### * <FOOTER>
293
312
> ###
 
313
> options(digits = 7L)
294
314
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
295
 
Time elapsed:  0.452 0.02 0.514 0 0 
 
315
Time elapsed:  0.252 0.008 0.261 0 0 
296
316
> grDevices::dev.off()
297
317
null device 
298
318
          1