- using R version 2.11.0 Under development (unstable) (2009-11-06 r50317)
- using session charset: UTF-8
- checking for file 'gtools/DESCRIPTION' ... OK
- this is package 'gtools' version '2.6.1'
- checking package name space information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking for executable files ... OK
- checking whether package 'gtools' can be installed ... OK
- checking package directory ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking R files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... OK
- checking whether the package can be loaded with stated dependencies ... OK
- checking whether the name space can be loaded with stated dependencies ... OK
- checking for unstated dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... NOTE
quantcut: possible error in strsplit(levs, "[^0-9+\\.\\-]+", extended =
TRUE): unused argument(s) (extended = TRUE)
running: multiple local function definitions for ‘funct’ with different
formal arguments
strmacro : ff: possible error in gsub(pattern, value, body, extended =
TRUE): unused argument(s) (extended = TRUE)
- checking Rd files ... OK
- checking Rd metadata ... OK
- checking Rd cross-references ... WARNING
Missing link(s) in documentation object './man/binsearch.Rd':
‘[base]{optim}’ ‘[base]{optimize}’ ‘[base]{uniroot}’
Missing link(s) in documentation object './man/capture.Rd':
‘[base]{capture.output}’
Missing link(s) in documentation object './man/setTCPNoDelay.Rd':
‘[utils]{socketConnection}’
See the information in section 'Cross-references' of the 'Writing R
Extensions' manual.
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking data for non-ASCII characters ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking for portable use of $BLAS_LIBS ... OK
- checking examples ... ERROR
Running examples in 'gtools-Ex.R' failed.
The error most likely occurred in:
> ### * defmacro
>
> flush(stderr()); flush(stdout())
>
> ### Name: defmacro
> ### Title: Define a macro
> ### Aliases: defmacro strmacro
> ### Keywords: programming
>
> ### ** Examples
>
> ####
> # macro for replacing a specified missing value indicator with NA
> # within a dataframe
> ###
> setNA <- defmacro(df, var, values,
+ expr={
+ df$var[df$var %in% values] <- NA
+ })
>
> # create example data using 999 as a missing value indicator
> d <- data.frame(
+ Grp=c("Trt", "Ctl", "Ctl", "Trt", "Ctl", "Ctl", "Trt", "Ctl", "Trt", "Ctl"),
+ V1=c(1, 2, 3, 4, 5, 6, 999, 8, 9, 10),
+ V2=c(1, 1, 1, 1, 1, 2, 999, 2, 999, 999)
+ )
> d
Grp V1 V2
1 Trt 1 1
2 Ctl 2 1
3 Ctl 3 1
4 Trt 4 1
5 Ctl 5 1
6 Ctl 6 2
7 Trt 999 999
8 Ctl 8 2
9 Trt 9 999
10 Ctl 10 999
>
> # Try it out
> setNA(d, V1, 999)
> setNA(d, V2, 999)
> d
Grp V1 V2
1 Trt 1 1
2 Ctl 2 1
3 Ctl 3 1
4 Trt 4 1
5 Ctl 5 1
6 Ctl 6 2
7 Trt NA NA
8 Ctl 8 2
9 Trt 9 NA
10 Ctl 10 NA
>
>
> ###
> # Expression macro
> ###
> plot.d <- defmacro( df, var, DOTS, col="red", title="", expr=
+ plot( df$var ~ df$Grp, type="b", col=col, main=title, ... )
+ )
>
> plot.d( d, V1)
> plot.d( d, V1, col="blue" )
> plot.d( d, V1, lwd=4) # use optional 'DOTS' argument
>
> ###
> # String macro (note the quoted text in the calls below)
> #
> # This style of macro can be useful when you are reading
> # function arguments from a text file
> ###
> plot.s <- strmacro( DF, VAR, COL="'red'", TITLE="''", DOTS="", expr=
+ plot( DF$VAR ~ DF$Grp, type="b", col=COL, main=TITLE, DOTS)
+ )
>
> plot.s( "d", "V1")
Error in gsub(pattern, value, body, extended = TRUE) :
unused argument(s) (extended = TRUE)
Calls: plot.s -> gsub
Execution halted