Updating packages for 2.14.0 ===========================+ Package maintainers should be aware of the following changes scheduled to appear in 2.14.0 on 31 October 2011. Lazy-loading ============ All packages will be lazy-loaded. Please remove any LazyLoad field from the DESCRIPTION file: false values will give a warning on installation. Very few packages were affected by this: in most cases they had top-level code with side-effects, something 'Writing R Extensions' has warned about for many years. Namespaces ========== All packages will have a namespace, and R CMD INSTALL will create a NAMESPACE file if one is not supplied (and R CMD build will add one, using the same code). The automatically-generated NAMESPACE file works well in the vast majority of cases (well over 1000 packages on CRAN), but should be regarded as a starting point for updating the package. Known issues include: - The default namespace exports all symbols (even those names starting with '.'): you probably want to be much more selective. - If you have a .First.lib() function, it is run as .onAssign. In many cases this is only used to load compiled code and can be replaced by a useDynLib directive in the NAMESPACE file. In others the .First.lib() function should be renamed as .onAssign() or .onLoad(): in a few cases it needs to split into two functions. There are exceptions where it has been found that .First.lib should be run as .onLoad: these are listed in object base::.Firstlib_as_onLoad. - The package environment is sealed, so you cannot use it to store changing values. Use a separate environment instead: there are examples in package 'grDevices' for example. - There may be scoping issues. If as for package 'quantreg' you make use of a function t() from package SparseM, the namespace needs to import SparseM (or just the functions used from SparseM). This is most common where S4 generics which mask functions in 'base' are to be used. - If the package defines S3 methods for generics in other packages such as 'stats', it should import the generic and register the method with an S3method directive. - Packages which set S4 methods which create an S4 generic by taking over a function in another package (notably plot()) need to import the function they take over, e.g. by importFrom(graphics, plot). (This may appear to work without in R 2.14.x, but the package will then not install in R 2.13.x.) Vignette sources ================ The preferred location for vignette sources is now directory 'vignettes' and not 'inst/doc'. If you want to maintain compatibility with R <= 2.13.x for the time being, do at least make use of a .Rinstignore file to avoid installing anything other than the vignette .Rnw (etc) and .pdf files, plus any other files needed for end-users to run the vignette code. If you know a priori that the vignettes cannot be re-made on CRAN (e.g. because you use unusual LaTeX files), set the BuildVignettes field in the DESCRIPTION file to a false value. (The R code in the vignettes as extracted by Stangle still needs to be runnable.) Deprecation =========== Using mean(x) and sd(x) directly on data frames (or also matrices, for sd) x, is deprecated, and produces warnings now. Both uses have been relatively widespread, and should be replaced by sapply(), vapply() or, for mean, colMeans().